# Error running CMAQv5.4\_2018\_12NE3\_Benchmark\_2Day\_Input

**URL:** <https://forum.cmascenter.org/t/error-running-cmaqv5-4-2018-12ne3-benchmark-2day-input/5679>\
**Category:** Benchmark Issues and Errors\
**Created:** [March 18, 2025, 5:02pm UTC](https://forum.cmascenter.org/t/error-running-cmaqv5-4-2018-12ne3-benchmark-2day-input/5679 "2025-03-18T17:02:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pamelap](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@pamelap](https://forum.cmascenter.org/u/pamelap)\
**Post date:** [March 18, 2025, 5:02pm UTC](https://forum.cmascenter.org/t/error-running-cmaqv5-4-2018-12ne3-benchmark-2day-input/5679/1 "2025-03-18T17:02:42Z")

</div>

Hi everyone. I am trying to run the WRF-CMAQ benchmark mentioned in the title to test my configuration, that is:

- NetCDF-C 4.8.1, NetCDF-Fortran 4.5.4 (together in a single folder) and I/O API 3.2, compiled following [this tutorial](https://github.com/USEPA/CMAQ/blob/main/DOCS/Users_Guide/Tutorials/CMAQ_UG_tutorial_build_library_gcc.md);

- WRF 4.5.2 coupled with CMAQ 5.5, compiled following [this tutorial](https://usepa.github.io/CMAQ/DOCS/Users_Guide/Tutorials/CMAQ_UG_tutorial_WRF-CMAQ_Benchmark.html).

I’m also using gcc, g++ and gfortran 9.5.0, as well as OpenMPI 5.0.7, running on Ubuntu 24.04 LTS.

I was able to compile all the libraries and the coupled model succesfully, obtaining the executables. I’m using the attached script to run the benchmark  
[run\_cctm\_Bench\_2018\_12NE3.WRFCMAQ.csh](https://forum.cmascenter.org/uploads/short-url/w0rqhKDoRD707pPTpb699tSEF0Z.csh) (51.4 KB).

The WRF model starts running together with CMAQ just fine, until it reaches the third simulation hour: the output for hour 3 is written, but the simulation crashes with a “Segmentation Fault - Invalid Memory reference” error. I suspect there is something wrong with the emission files (I am currently using the ones suggested by the tutorial): CMAQ probably tries to read them at hour 3 but fails, for some reason. All the paths to the libraries and the folders seem to be set correctly (in the script), as well as the necessary environment variables.

I also attached the first rsl.error [rsl.error.0000.txt](https://forum.cmascenter.org/uploads/short-url/mybbxjI6s1NjHnA8rd5HqXpjQ2N.txt) (670 KB) and rsl.out  
[rsl.out.0000.txt](https://forum.cmascenter.org/uploads/short-url/83JRx6MVZTGoGRQ6ICujHjLCiCK.txt) (377.3 KB) files , as well as the benchmark output [cmaq\_log.txt](https://forum.cmascenter.org/uploads/short-url/wJsiK6aoanBdXCT2QrqCUEUegay.txt) (3.1 KB).

Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [March 18, 2025, 5:14pm UTC](https://forum.cmascenter.org/t/error-running-cmaqv5-4-2018-12ne3-benchmark-2day-input/5679/2 "2025-03-18T17:14:58Z")

</div>

Can you compile everything with -`g -O0 -fbacktrace` and re-run?

This should give the routine and line-number at which the SEGFAULT occurs (you need the `-g -O0` in addition to the `-fbacktrace` because optimization can “play games” with the line-numbers at which the problem happens while the compiler is doing such things as loop-optimization).

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [March 18, 2025, 5:29pm UTC](https://forum.cmascenter.org/t/error-running-cmaqv5-4-2018-12ne3-benchmark-2day-input/5679/3 "2025-03-18T17:29:36Z")

</div>

If you are using csh or tcsh, please also try this:

limit stacksize unlimited

If you are using sh or bash, use this command:

ulimit -s unlimited

This may not solve your problem but the default stack size is often quite small and may result in segmentation faults due to insufficient stack memory.

---

<div class="post-metadata">

**Author:** ![pamelap](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@pamelap](https://forum.cmascenter.org/u/pamelap)\
**Post date:** [March 19, 2025, 5:44pm UTC](https://forum.cmascenter.org/t/error-running-cmaqv5-4-2018-12ne3-benchmark-2day-input/5679/4 "2025-03-19T17:44:10Z")

</div>

Thank you @cjcoats and @lizadams for your answers. I recompiled following your suggestions, but the benchmark keeps crushing. To be thorough, I’m attaching the relative rsl.out [rsl.out.0001.txt](https://forum.cmascenter.org/uploads/short-url/mXtwQSWLDpkwg5E1TxY82ZDnvZm.txt) (7.4 KB) and rsl.error[rsl.error.0001.txt](https://forum.cmascenter.org/uploads/short-url/8J2lmjpM1uNZikkRcisad3GM7yY.txt) (4.3 KB) files (only the ones that seem to show some more information). However, I found that this same benchmark runs smoothly if recompiling CMAQ 5.5 using WRF 4.5.1, instead of any newer version: this behaviour may be related to what is explained [in this post](https://github.com/USEPA/CMAQ/wiki/CMAQ-Release-Notes:-WRF-CMAQ-Coupled-Model#compatibility-issues-with-wrf-versions-452-and-later) from the official repository. I actually didn’t try using the workaround suggested there, but may be doing so in the near future.

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [March 20, 2025, 1:36pm UTC](https://forum.cmascenter.org/t/error-running-cmaqv5-4-2018-12ne3-benchmark-2day-input/5679/5 "2025-03-20T13:36:04Z")

</div>

Given the lack of traceback, it is clear that you failed to run such a debug/traceback executable.

- Make sure you compiled the entire system for debug/traceback.

- Check the scripts very carefully to ensure that they did not over-ride the choice of executable that you wanted.

---

<div class="post-metadata">

**Author:** ![hogrefe.christian](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@hogrefe.christian](https://forum.cmascenter.org/u/hogrefe.christian)\
**Post date:** [March 20, 2025, 2:45pm UTC](https://forum.cmascenter.org/t/error-running-cmaqv5-4-2018-12ne3-benchmark-2day-input/5679/6 "2025-03-20T14:45:02Z")

</div>

> [@pamelap](#):
>
> However, I found that this same benchmark runs smoothly if recompiling CMAQ 5.5 using WRF 4.5.1, instead of any newer version: this behaviour may be related to what is explained [in this post](https://github.com/USEPA/CMAQ/wiki/CMAQ-Release-Notes:-WRF-CMAQ-Coupled-Model#compatibility-issues-with-wrf-versions-452-and-later) from the official repository. I actually didn’t try using the workaround suggested there, but may be doing so in the near future.

Your issue very likely is related to the use of WRF \> v4.5.1 to build the twoway model. If sticking with WRFv4.5.1 (which you confirmed is running for you) is not an option for you, you will need to follow the steps described in our documentation to update your copy of WRFv4.5.2 with the two specific pieces of WRFv4.5.1 code (WRFv451/share/wrf\_tsin.F and WRFv451/frame/module\_domain\_type.F).
