# CMAQv5.4 stops after the first hour is written to output files, while code seems to run in an infinite loop

**URL:** <https://forum.cmascenter.org/t/cmaqv5-4-stops-after-the-first-hour-is-written-to-output-files-while-code-seems-to-run-in-an-infinite-loop/5269>\
**Category:** CMAQ\
**Tags:** cmaq\
**Created:** [October 4, 2024, 1:01am UTC](https://forum.cmascenter.org/t/cmaqv5-4-stops-after-the-first-hour-is-written-to-output-files-while-code-seems-to-run-in-an-infinite-loop/5269 "2024-10-04T01:01:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tesfamichaelb](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tesfamichaelb](https://forum.cmascenter.org/u/tesfamichaelb)\
**Post date:** [October 4, 2024, 1:01am UTC](https://forum.cmascenter.org/t/cmaqv5-4-stops-after-the-first-hour-is-written-to-output-files-while-code-seems-to-run-in-an-infinite-loop/5269/1 "2024-10-04T01:01:34Z")

</div>

Greetings:  
CMAQv5.4 has been running without issues for first PM2.5 modeling case. But when another PM2.5 case is used for a similar simulation, I got this problem of CCTM immediately stopping after a few seconds of run only giving the first hour output, but without any notable error message. The interesting part is the 12 processors are busy with the “CCTM\_v54.exe” occupying all the memory of the server in an endless loop, as if it is executing the actual job.  
I have even tried editing a file from the VDIFF subdirectory per one modeler’s tip, following his quote here=\> {{{I finally found that CCTM is running instead of halting but never reaching to the convergence criteria, and then CCTM actually gets into a infinite loop at Line 281, module SEDIMENTATION.F dealing with sedimentation of aerosols:  
281 do while ( adts .lt. dtsec )  
I changed this line into the following after I referred to the same module in CMAQ 5.3,  
281 do while ( adts .lt. dtsec .and. iter .le. 20). ! you can test different criteria (10, 20, …)  
282 iter = iter + 1.}}}

But there is no change any change at all. I have tried to attach the CCTM-logs and \*.csh file, but this page refused to allow me saying “new users can’t upload file”.  
Please, your help is highly requested.  
Thank you,  
Tes

---

<div class="post-metadata">

**Author:** ![cgnolte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/cgnolte/32/53_2.png) [@cgnolte](https://forum.cmascenter.org/u/cgnolte)\
**Post date:** [October 4, 2024, 1:22pm UTC](https://forum.cmascenter.org/t/cmaqv5-4-stops-after-the-first-hour-is-written-to-output-files-while-code-seems-to-run-in-an-infinite-loop/5269/2 "2024-10-04T13:22:00Z")

</div>

Tes,  
Does this second modeling case use different emissions, different meteorology, or both?  
In giving the first hour of output, do you mean the hour that is a copy of the initial conditions, or do you mean the model has performed calculations for an hour of simulation?  
The first thing I would try is compiling in debug mode (set Debug\_cctm in bldit\_cctm.csh) and seeing if that leads to a crash. Sometimes the model can hang due to a data error.

---

<div class="post-metadata">

**Author:** ![tesfamichaelb](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tesfamichaelb](https://forum.cmascenter.org/u/tesfamichaelb)\
**Post date:** [October 4, 2024, 5:23pm UTC](https://forum.cmascenter.org/t/cmaqv5-4-stops-after-the-first-hour-is-written-to-output-files-while-code-seems-to-run-in-an-infinite-loop/5269/3 "2024-10-04T17:23:47Z")

</div>

Thank you for the quick reply, cgnolte!  
Yes, they are different cases in time, 2013 vs 2019 (different in emis & met). Last night, before I left my desk I loaded the job with the following command:  
/] nohup ./run\_cctm.csh \>& cctm\_Oct2019nudg.log &  
And I am very surprised to see this morning the model is actually running normally and producing outputs for 8 days already (it is supposed to run for a month and half). In the past several days, I didn’t use the “nohup - run a command immune to hangups” Unix command. Perhaps, the “&” symbol at the end of the command without the “nohup” was suspending/killing the job execution before.  
I will update if I encounter a different/new situation.  
I wish you a wonderful weekend!  
Tes
