# NaN or Infinity detected in VDIFF

**URL:** <https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384>\
**Category:** Run Time Errors and Issues\
**Tags:** cmaq\
**Created:** [June 26, 2022, 2:49pm UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384 "2022-06-26T14:49:53Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![gc13141112](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/gc13141112/32/78_2.png) [@gc13141112](https://forum.cmascenter.org/u/gc13141112)\
**Post date:** [June 26, 2022, 2:49pm UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/1 "2022-06-26T14:49:53Z")

</div>

Hi, I am using CMAQv5.3.3 with enabling ISAM and my simulation fails on the 21th time step. The errors are as follows:  
Processing Day/Time [YYYYDDD:HHMMSS]: 2020226:210000  
Which is Equivalent to (UTC): 21:00:00 Thursday, Aug. 13, 2020  
Time-Step Length (HHMMSS): 000640

```
 After VDIFF : Gas 7.862E+31 | Aer NaN | Non 1.014E+31
 
 *** ERROR ABORT in subroutine CKSUMMER
 NaN or Infinity detected in VDIFF
 Date and time 21:00:00 Aug. 13, 2020 (2020226:210000)
 Processing Day/Time [YYYYDDD:HHMMSS]: 2020226:210000
   Which is Equivalent to (UTC): 21:00:00 Thursday, Aug. 13, 2020
   Time-Step Length (HHMMSS): 000640
 
 After VDIFF : Gas 7.862E+31 | Aer NaN | Non 1.014E+31
 
 *** ERROR ABORT in subroutine CKSUMMER
 NaN or Infinity detected in VDIFF
 Date and time 21:00:00 Aug. 13, 2020 (2020226:210000)

```

Any recommendations for how to solve this or investigate further?  
Thanks!  
[CTM\_LOG\_000.v533\_intel\_Bench\_2011\_12SE1\_20200813.txt](https://forum.cmascenter.org/uploads/short-url/lJviQ3riIGt5662cdSuXUBNfe1V.txt) (470.4 KB)

---

<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:** [June 26, 2022, 3:24pm UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/2 "2022-06-26T15:24:19Z")

</div>

You might try a run that is compiled using the debug/check-everything compile-flags used in the corresponding I/O API \*Makeinclude._dbg_ – that should give you the subroutine and line-number at which the `NaN` occurs.

---

<div class="post-metadata">

**Author:** ![gc13141112](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/gc13141112/32/78_2.png) [@gc13141112](https://forum.cmascenter.org/u/gc13141112)\
**Post date:** [June 29, 2022, 7:48am UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/3 "2022-06-29T07:48:21Z")

</div>

Thanks. I figured out the issue.

---

<div class="post-metadata">

**Author:** ![jstergiou](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jstergiou](https://forum.cmascenter.org/u/jstergiou)\
**Post date:** [July 27, 2022, 7:20pm UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/4 "2022-07-27T19:20:39Z")

</div>

could you please tell me what was the issue, cause im having the same problem!

---

<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:** [August 3, 2022, 9:24pm UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/5 "2022-08-03T21:24:01Z")

</div>

@jstergiou please post your log files so that we can provide you with assistance.

---

<div class="post-metadata">

**Author:** ![jstergiou](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jstergiou](https://forum.cmascenter.org/u/jstergiou)\
**Post date:** [August 4, 2022, 6:55am UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/6 "2022-08-04T06:55:19Z")

</div>

Its ok i set CTM\_ABFLUX to N and it worked! Thank you.

---

<div class="post-metadata">

**Author:** ![paanjii2](https://avatars.discourse-cdn.com/v4/letter/p/97f17d/32.png) [@paanjii2](https://forum.cmascenter.org/u/paanjii2)\
**Post date:** [August 4, 2022, 1:51pm UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/7 "2022-08-04T13:51:10Z")

</div>

NaN can be tested by comparing the value against itself (they are defined to not be equal any values).

---

<div class="post-metadata">

**Author:** ![paanjii2](https://avatars.discourse-cdn.com/v4/letter/p/97f17d/32.png) [@paanjii2](https://forum.cmascenter.org/u/paanjii2)\
**Post date:** [October 11, 2022, 11:00am UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/8 "2022-10-11T11:00:05Z")

</div>

I figured out the issue.[.](https://myfiosgateway.one/)[.](https://tutuappvip.co/mobdro-download)

---

<div class="post-metadata">

**Author:** ![Starry](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Starry](https://forum.cmascenter.org/u/Starry)\
**Post date:** [October 17, 2023, 2:15am UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/9 "2023-10-17T02:15:52Z")

</div>

> [@jstergiou](#):
>
> CTM\_ABFLUX

Hi, I met the same issue with CMAQv5.4, and setting CTM\_ABFLUX to N wouldn’t work for me. Here is my log file, any help would be grateful.  
[CTM\_LOG\_000.v54\_intel\_china27km\_20220726.txt](https://forum.cmascenter.org/uploads/short-url/gNiQBKSgT23zDLSCoH1jg2R2ndP.txt) (130.7 KB)

---

<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:** [October 17, 2023, 11:14am UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/10 "2023-10-17T11:14:48Z")

</div>

I would recommend compiling CCTM in debug mode to find out where in the code the computations causing the NaN value occur - the same recommendation given by @cjcoats in the second post from the top.

---

<div class="post-metadata">

**Author:** ![Starry](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Starry](https://forum.cmascenter.org/u/Starry)\
**Post date:** [October 18, 2023, 2:22am UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/11 "2023-10-18T02:22:37Z")

</div>

Thank you for your advice, I will try.

---

<div class="post-metadata">

**Author:** ![LMZ](https://avatars.discourse-cdn.com/v4/letter/l/a587f6/32.png) [@LMZ](https://forum.cmascenter.org/u/LMZ)\
**Post date:** [January 11, 2025, 1:53am UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/12 "2025-01-11T01:53:50Z")

</div>

Hello, Professor, I also met the same problem, I would like to ask you how you finally solved it?

```
After VDIFF : Gas NaN | Aer 1.384E+09 | Non 1.138E-04

 *** ERROR ABORT in subroutine CKSUMMER
 NaN or Infinity detected in VDIFF
 Date and time 0:00:00 June 29, 2017 (2017180:000000)

```

(END)

---

<div class="post-metadata">

**Author:** ![Starry](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Starry](https://forum.cmascenter.org/u/Starry)\
**Post date:** [January 14, 2025, 6:32am UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/13 "2025-01-14T06:32:38Z")

</div>

Hi  
It turns out that there is NaN in my emission inputs, which can be checked with ncview, I removed the NaN and the problem was solved.

---

<div class="post-metadata">

**Author:** ![xzhang](https://avatars.discourse-cdn.com/v4/letter/x/df705f/32.png) [@xzhang](https://forum.cmascenter.org/u/xzhang)\
**Post date:** [May 10, 2025, 10:33pm UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/14 "2025-05-10T22:33:25Z")

</div>

Hi there, I have recently encountered the same issue. Could you please share how you solved this? Thanks!

---

<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:** [May 19, 2025, 8:46pm UTC](https://forum.cmascenter.org/t/nan-or-infinity-detected-in-vdiff/3384/15 "2025-05-19T20:46:57Z")

</div>


