# NAN in ASENS file when running CMAQ-DDM v5.4

**URL:** <https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907>\
**Category:** CMAQ-DDM-3D\
**Tags:** ddm\
**Created:** [May 1, 2024, 6:30pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907 "2024-05-01T18:30:04Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [May 1, 2024, 6:30pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/1 "2024-05-01T18:30:04Z")

</div>

Hi all,

The CMAQ-DDM v5.4 was running fine the day before, but the ASENS file generated the next day contains all NaN values, while the CONC file is still normal. I saw another person’s question on the forum mentioning NaN issues, but their problem was due to emissions. I’m using EQUATES for emissions, which should have been evaluated. What could be the possible reasons for this?

---

<div class="post-metadata">

**Author:** ![sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@sergey](https://forum.cmascenter.org/u/sergey)\
**Post date:** [May 15, 2024, 12:10pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/2 "2024-05-15T12:10:39Z")

</div>

Please, try downloading and compiling the 5.4+ branch instead of the base version. There were a lot of small bug fixes in that version that came out after the base 5.4 release and its possible one of these is causing your issue.

Also, please, delete the other duplicate post asking the same question.

Cheers,

Sergey

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [May 15, 2024, 5:03pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/3 "2024-05-15T17:03:47Z")

</div>

Thanks Sergey! Despite downloading version 5.4+, the issue persists.

Initially, I suspected it was related to emissions. Upon examining the ASENS file, I noticed NaN values appearing from 6:00 on December 18, 2023, onwards. Upon observing the input emissions, I found that NOx emissions from agricultural fires summed to zero between 4:00 to 12:00. However, even after disabling agricultural fire emissions, the problem persisted. Hence, emissions may not be the root cause.

Could you suggest other potential solutions? I attached the log file.  
[log.txt](https://forum.cmascenter.org/uploads/short-url/cAglRYZ7IV9Vdtre5fx5QeJARnf.txt) (367.2 KB)

---

<div class="post-metadata">

**Author:** ![sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@sergey](https://forum.cmascenter.org/u/sergey)\
**Post date:** [May 15, 2024, 6:44pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/4 "2024-05-15T18:44:08Z")

</div>

Are you running the MEGAN biogenic emissions option? I think some users reported problems with that in the past. If that’s the case for you and you running the EQUATES case, it could be possible to track that down.

Sergey

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [May 15, 2024, 7:31pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/6 "2024-05-15T19:31:01Z")

</div>

I’m using BEIS to calculate in-line biogenic emissions (setenv CTM\_BIOGEMIS\_BE Y). Yes, I’m running the EQUATES case.

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [May 16, 2024, 10:50pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/7 "2024-05-16T22:50:51Z")

</div>

Hi Sergey,

Even after setting the biogenic emissions to “False,” I encountered the same issue.

I’ve noticed an interesting pattern: when I disable agricultural fires, the appearance of NaN values shifts from 5:00 to 6:00 on December 18, 2023. Similarly, when I turn off biogenic emissions, the first NaN value appears at 7:00. This leads me to wonder if there’s an overflow issue causing these problems.

---

<div class="post-metadata">

**Author:** ![fsidi](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@fsidi](https://forum.cmascenter.org/u/fsidi)\
**Post date:** [May 17, 2024, 1:14am UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/8 "2024-05-17T01:14:58Z")

</div>

@nna,

If there is an overflow issue, I suggest compiling in “debug” mode see: [CMAQ/DOCS/Users\_Guide/Tutorials/CMAQ\_UG\_tutorial\_debug.md at main · USEPA/CMAQ · GitHub](https://github.com/USEPA/CMAQ/blob/main/DOCS/Users_Guide/Tutorials/CMAQ_UG_tutorial_debug.md#if-the-program-crashed).

This will enable compilation with “debug” flags which will check and trap for floating point exceptions (divide by zeros, overflow, etc). Hopefully if a floating point calculation is going erroneous it will be flagged and will give you the line number.

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [May 21, 2024, 5:08pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/9 "2024-05-21T17:08:05Z")

</div>

Hi Fahim,

Thank you! I reran it in “debug” mode. However, it encountered an error immediately instead of running as before, stopping at the 8th hour. Here are the log files. I believe it’s primarily related to the nodes on our server. We’ll need to address the server issues first before determining if it’s an overflow problem.

[log.txt](https://forum.cmascenter.org/uploads/short-url/xqg03dFedykP9I2RcyBJwH1zixe.txt) (24.3 KB)  
[CTM\_LOG\_000.v54\_DDM3D\_intel\_2023\_12US1\_20231218.txt](https://forum.cmascenter.org/uploads/short-url/nk9qNnWSfefWY55sEppehILygvp.txt) (204.3 KB)

---

<div class="post-metadata">

**Author:** ![fsidi](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@fsidi](https://forum.cmascenter.org/u/fsidi)\
**Post date:** [May 21, 2024, 5:52pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/10 "2024-05-21T17:52:26Z")

</div>

@nna,

While I can’t rule out sever issues, failing immediately is not uncommon in this case because compiling in debug mode enables floating point checks.

Looking at your log.txt, it’s preety clear that the code is encountering an overflow issue while doing tracer advection of the DDM “species”. I don’t think there is an issue with the advection routine itself, but instead the concentrations going into the routine.

Are you able to run the same scenario successfully without DDM turned on to verify that works and everything looks reasonable?

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [May 22, 2024, 1:46am UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/11 "2024-05-22T01:46:57Z")

</div>

I have ruled out the sever issues. Here’s my summary:

DDM in debug mode: immediately fails as described in the log above.  
DDM not in debug mode: runs but generates NaN values at the 8th hour.  
Without DDM: works fine, and the NO2 concentration appears reasonable.

Could you help me in further diagnosing an overflow issue? Thanks!

---

<div class="post-metadata">

**Author:** ![sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@sergey](https://forum.cmascenter.org/u/sergey)\
**Post date:** [May 22, 2024, 2:39pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/12 "2024-05-22T14:39:57Z")

</div>

Which specific EQUATES episode are you running and what sensitivities are you specifying in the sensinput.dat file? I am not sure how to diagnose this remotely, but I can try to reproduce the problem here.

Sergey

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [May 22, 2024, 3:07pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/13 "2024-05-22T15:07:56Z")

</div>

Hi Sergey,

I’m using the emissions from December 13, 2023 to December 18, 2023 for the simulation of the corresponding days in 2023. And the NAN issue in ASENS file occurs on December 18.

The details in the sensinput.dat file are as follows:

EMIS  
TOTA  
SPECIES  
NO2, NO

---

<div class="post-metadata">

**Author:** ![fsidi](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@fsidi](https://forum.cmascenter.org/u/fsidi)\
**Post date:** [May 22, 2024, 4:08pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/14 "2024-05-22T16:08:38Z")

</div>

@nna,

Since this problem occurs on the last day, this maybe an issue that has manifested itself over the course of your run. I suspect the sensitivity concentrations in your IC file are what’s probably driving the issue.

I suggest restarting the run on the first day Dec. 13, 2023 using the debug flags and see what it catches.

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [May 22, 2024, 4:21pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/15 "2024-05-22T16:21:13Z")

</div>

Thanks! I’ll try it.

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [May 23, 2024, 7:17pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/16 "2024-05-23T19:17:30Z")

</div>

Hi Fahim,

I understand that debug mode can be time-consuming, but does it really take around 700 seconds for a 5-minute simulation? At this rate, it would take half a month to run a simulation from December 13 to 18.

---

<div class="post-metadata">

**Author:** ![fsidi](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@fsidi](https://forum.cmascenter.org/u/fsidi)\
**Post date:** [May 23, 2024, 9:11pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/17 "2024-05-23T21:11:28Z")

</div>

@nna,

Yes it can be quite time consuming and very slow because its checking each and every line of code.

Often it is useful to narrow down your search, but I’m not sure what your skill level with writing Fortran code is how comfortable you are with editing the CMAQ Fortran source code yourself.

If you are quite fluent in Fortran, you could adapt the CMAQ routine cksummer.F to check the DDM sensitivities for NaNs/Infs, then run debug mode on that specific day. If you do go that route note that unlike the CGRID species DDM sensitives can be negative and positive so be sure to use the absolute value when summing sensitives.

---

<div class="post-metadata">

**Author:** ![nna](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nna](https://forum.cmascenter.org/u/nna)\
**Post date:** [May 27, 2024, 5:08pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/18 "2024-05-27T17:08:08Z")

</div>

Thanks for your suggestion!

---

<div class="post-metadata">

**Author:** ![atmos007](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@atmos007](https://forum.cmascenter.org/u/atmos007)\
**Post date:** [December 26, 2024, 3:05am UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/19 "2024-12-26T03:05:38Z")

</div>

@nna @sergey @fsidi Hi, I have encounted the same question. I simulated the O3 sensitivity to NOx and VOCs for July 2020 with CMAQ-DDM v5.4. From the 4 July 2020, the ASENS had NANs during 18:00-24:00 everyday, but only for VOC sensitivity(O3\_EVC, HONO\_EVC… ), as figures below shown. Is there a possibility that something went wrong? Thanks！  
My sensinput settings are:

```auto
ENX
 EMIS
  GRIDDED_EMIS
 SPECIES
  NO, NO2
EVC
 EMIS
  GRIDDED_EMIS
 SPECIES
  FORM, ALD2, ALDX, ETOH, MEOH, ETHA, PAR, ETH, OLE, TERP, TOL, IOLE, ISOP 
END

```

 ![2020070423](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/7/7a22a9c71c4d3689a6115dcb0438afd8a62c23aa.jpeg)  
 ![2020070422](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/9/9a6b0bb933ba72bb7e659fd441749521bd232a2e.jpeg)  
 ![2020070419](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/5/5bf9ec38ba8615b1a806a7ad52ce47a006ed6199.jpeg)  
 ![2020070418](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/0/074e9feb4bfa5e4f0355780f7ad8887d9da91184.jpeg)

---

<div class="post-metadata">

**Author:** ![sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@sergey](https://forum.cmascenter.org/u/sergey)\
**Post date:** [January 2, 2025, 2:38pm UTC](https://forum.cmascenter.org/t/nan-in-asens-file-when-running-cmaq-ddm-v5-4/4907/20 "2025-01-02T14:38:10Z")

</div>

This first thing for you to try is to make sure you have the latest code available to run your simulation. CMAQ v5.4 had updates to DDM released through the 5.4+ branch, but there is is also v5.5 available now.

Sergey
