# Issue about CCTM in CMAQv5.3.1

**URL:** <https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814>\
**Category:** Run Time Errors and Issues\
**Created:** [October 5, 2020, 11:54pm UTC](https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814 "2020-10-05T23:54:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@Ryan](https://forum.cmascenter.org/u/Ryan)\
**Post date:** [October 5, 2020, 11:54pm UTC](https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814/1 "2020-10-05T23:54:35Z")

</div>

Dear all,  
When I try to run CMAQv5.3.1 with my emission file, the CMAQ model crashed with the following error info. Can anyone help me with this issue?  
I have also attached my run scripts and log files.

[serial\_test\_1274822.txt](https://forum.cmascenter.org/uploads/short-url/2U7abnUiouVZG64Rw9Af8eTm8Pk.txt) (58.7 KB)  
[CTM\_LOG\_000.v531\_intel\_test\_2012\_4kmCA\_20120713.txt](https://forum.cmascenter.org/uploads/short-url/lL3q3kvWUeeu2JwKCggClblXYSv.txt) (56.9 KB)

forrtl: severe (27): too many records in I/O statement, unit -5, file Internal Formatted Write  
Image PC Routine Line Source  
CCTM\_v531.exe 000000000094200B for\_\_io\_return Unknown Unknown  
CCTM\_v531.exe 000000000098D7B1 for\_write\_int\_fmt Unknown Unknown  
CCTM\_v531.exe 00000000005F9446 Unknown Unknown Unknown  
CCTM\_v531.exe 00000000005ECAE8 Unknown Unknown Unknown  
CCTM\_v531.exe 00000000005FE170 Unknown Unknown Unknown  
CCTM\_v531.exe 000000000067A536 Unknown Unknown Unknown  
CCTM\_v531.exe 000000000060ABCE Unknown Unknown Unknown  
CCTM\_v531.exe 0000000000603EA3 Unknown Unknown Unknown  
CCTM\_v531.exe 00000000006026AE Unknown Unknown Unknown  
CCTM\_v531.exe 000000000040F8A2 Unknown Unknown Unknown  
libc-2.17.so 00002AAB5537A555 \_\_libc\_start\_main Unknown Unknown  
CCTM\_v531.exe 000000000040F7A9 Unknown Unknown Unknown

Thanks!  
Ryan

@hogrefe.christian @cgnolte @cjcoats@lizadams

---

<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:** [October 6, 2020, 12:26am UTC](https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814/2 "2020-10-06T00:26:31Z")

</div>

Hi Ryan,

I found the following after doing a google search.

> <https://stackoverflow.com/questions/31360099/unclear-cause-of-too-many-records-in-i-o-statement-error>

Perhaps this will help others diagnose what is going on.

Liz

---

<div class="post-metadata">

**Author:** ![Ryan](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@Ryan](https://forum.cmascenter.org/u/Ryan)\
**Post date:** [October 6, 2020, 2:08am UTC](https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814/3 "2020-10-06T02:08:52Z")

</div>

When I use the CCTM with debug mode, I get the following results:  
Processing Day/Time [YYYYDDD:HHMMSS]: 2012195:000000  
Which is Equivalent to (UTC): 0:00:00 Friday, July 13, 2012  
Time-Step Length (HHMMSS): 000230  
forrtl: severe (27): too many records in I/O statement, unit -5, file Internal Formatted Write  
Image PC Routine Line Source  
CCTM\_v531.exe 0000000001A1AD8B Unknown Unknown Unknown  
CCTM\_v531.exe 0000000001A66531 Unknown Unknown Unknown  
CCTM\_v531.exe 0000000000E31A1A emis\_defn\_mp\_chec 2245 EMIS\_DEFN.F  
CCTM\_v531.exe 0000000000DD1D66 emis\_defn\_mp\_emis 1239 EMIS\_DEFN.F  
CCTM\_v531.exe 0000000000D8076A emis\_defn\_mp\_emis 209 EMIS\_DEFN.F  
CCTM\_v531.exe 0000000001005006 vdiff\_ 266 vdiffproc.F  
CCTM\_v531.exe 0000000000E78F3E sciproc\_ 232 sciproc.F  
CCTM\_v531.exe 0000000000E5FB67 cmaq\_driver\_ 679 driver.F  
CCTM\_v531.exe 0000000000E580E8 MAIN\_\_ 96 cmaq\_main.F  
CCTM\_v531.exe 000000000040FCA2 Unknown Unknown Unknown  
libc-2.17.so 00007F0105BC3555 \_\_libc\_start\_main Unknown Unknown  
CCTM\_v531.exe 000000000040FBA9 Unknown Unknown Unknown

---

<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:** [October 6, 2020, 4:24am UTC](https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814/4 "2020-10-06T04:24:56Z")

</div>

> [@Ryan](#):
>
> 1239

I would look at the emission control namelist file: EmissCtrl\_\*.nml that is in your BLD directory and make sure that the contents matches your emissions input files.  
Line 2245 contains:

```auto
2242 ! Check for Time Units
2243 X = X + 2
2244 IF ( UNITS(X:) .EQ. 'S' .OR. UNITS(X:) .EQ. 'S-1' .OR.
2245 & UNITS(X:) .EQ. 'SEC'.OR.UNITS(X:) .EQ. 'SEC-1' .OR.

```

Line 1239 contains

```auto
1236 ! Write Out All Available Stream Families to the Log File
1237 WRITE( LOGDEV, '(/,5x,A)' ),'|> Emission Stream Family Definitions:'
1238 WRITE( LOGDEV, '(5x,A)' ),'======================================'
1239 WRITE( LOGDEV,'(8x,A19,15x,A)' ),'Stream Family Label','Stream Family Members'

```

Perhaps the error occurred when trying to write out the Emission Stream Family Definitions?

Line 209 contains

```auto
205 C Map the Emissions Species Available on the Input Files To the
 206 C Surrogates Identified by the User via the Namelists and Stop the model
 207 C or Print Warnings if Mistakes Are Made.
 208 
 209 CALL EMIS_SPC_MAP( JDATE, JTIME )

```

---

<div class="post-metadata">

**Author:** ![Ryan](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@Ryan](https://forum.cmascenter.org/u/Ryan)\
**Post date:** [October 6, 2020, 4:39am UTC](https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814/5 "2020-10-06T04:39:05Z")

</div>

Hi Liz,  
Thanks for your further clarification. However, I didn’t revise my EmissCtrl\ __.nml after compiling it. I have attached my EmissCtrl\__.nml file here. Could you please have a look at it?  
[EmissCtrl\_saprc07tic\_ae7i\_aq.nml.txt](https://forum.cmascenter.org/uploads/short-url/hmCQuUS7UOyVbNucfUmfcfTTFw5.txt) (32.9 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 6, 2020, 12:17pm UTC](https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814/6 "2020-10-06T12:17:56Z")

</div>

I think lines 2245-2250 in CMAQv5.3.1 contain the following block

> ```
> WRITE( XMSG,'(A,A16,A,/,I3,A11,A16,A,/,A)' ),
> & 'ERROR: Surrogate Species ',TRIM(SPEC),' on emission stream ',
> & ISRM, ' has units ',TRIM(UNITS),' which are unkown to CMAQ. ',
> & 'Please correct them to proceed.'
> CALL LOG_MESSAGE( OUTDEV, XMSG )
> STOP
> 
> ```

This points to units in one or more of your emission files that aren’t known to CMAQ (e.g. not moles/s, g/s, etc.), and somehow the formatting of these unknown-to-CMAQ units trips up the formatted writing of this error message. If this formatted write hadn’t failed, CMAQ would have exited with the message shown above, pointing to the unknown units and species. I don’t know why the formatted write failed, but the underlying reason are unknown emission units.

To solve this, please check the units of **all** variables in your emission files, even for non-emission variables you might have in your files. CMAQ currently expects all variables contained in emission files to be emission variables and exits if any of them has units not recognized as valid emission units.

---

<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:** [October 6, 2020, 1:23pm UTC](https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814/7 "2020-10-06T13:23:19Z")

</div>

Good catch – I suspect this is exactly what is going on. It’s a syntax error in the source, which could be fixed by getting rid of the slash (/) new-record directives. And that is then hiding the underlying error in the model-setup, which is probably what Christian Hogrefe indicates.

---

<div class="post-metadata">

**Author:** ![Ryan](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@Ryan](https://forum.cmascenter.org/u/Ryan)\
**Post date:** [October 6, 2020, 11:18pm UTC](https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814/8 "2020-10-06T23:18:06Z")

</div>

Hi all,  
Thanks a lot for all kind support. I have successfully solved this issue and Christian’s solution works for me. There is a wrong variable unit in the emission file. After making the correction, the model runs perfectly.

With regards,  
Ryan

---

<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 6, 2020, 11:46pm UTC](https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814/9 "2020-10-06T23:46:00Z")

</div>

@Ryan , I’m glad you were able to find the problem with the emission units in your input file.

The article linked by @lizadams and the concurring statement by @cjcoats about the “/” being interpreted as new-record directive in the formatted write helped solve my confusion about why the formatted write had failed. This is something that’ll need to fixed in the CCTM code in the future.

---

<div class="post-metadata">

**Author:** ![Ryan](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@Ryan](https://forum.cmascenter.org/u/Ryan)\
**Post date:** [October 7, 2020, 2:23am UTC](https://forum.cmascenter.org/t/issue-about-cctm-in-cmaqv5-3-1/1814/10 "2020-10-07T02:23:52Z")

</div>

Hi Christian,  
I agree with this. Look forward to seeing the updated CCTM code in the future.
