# ERROR in subroutine READNML

**URL:** https://forum.cmascenter.org/t/error-in-subroutine-readnml/905
**Category:** MCIP
**Created:** [September 3, 2019, 7:15pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905 "2019-09-03T19:15:43Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![cristianarango2](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cristianarango2](https://forum.cmascenter.org/u/cristianarango2)
#### Post date: [September 3, 2019, 7:15pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/1 "2019-09-03T19:15:43Z")

</div>

Hi!

I am running mcip V5.0 And I get the following error:

* * *

\*\*\* SUBROUTINE: READNML  
\*\*\* ERROR READING NAMELIST FILE ON UNIT 8  
\*\*\* NAMELIST FILE NAME = namelist.mcip  
\*\*\* NAMELIST = filenames  
\*\*\* IOSTAT = 5010

* * *

```
 *** ERROR ABORT in subroutine READNML
 ABNORMAL TERMINATION IN READNML

```

Error running mcip

Does anybody knows what is wrong?

Thanks in advance.

---

<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: [September 3, 2019, 8:02pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/2 "2019-09-03T20:02:50Z")

</div>

What Fortran compiler are you using? PGI?

The error-numbers (5010) are vendor specific; you probably want to do a search for your compiler together with “runtime error status”.

This isn’t Intel, presumably: their error numbers top out at 781; and if you’re using _gfortran_, lots of luck: I can’t find their error-status numbers documented **anywhere** on the web (something that, to my mind, disqualfies them from being a professional quality compiler).

---

<div class="post-metadata">

### Author: ![tlspero](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@tlspero](https://forum.cmascenter.org/u/tlspero)
#### Post date: [September 3, 2019, 8:14pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/3 "2019-09-03T20:14:04Z")

</div>

@cristianarango2 –

Have you updated your MCIP script to use the version that accompanied MCIPv5.0? If not, that is likely the source of your error. There are several elements in the namelist, “filenames”, that changed between MCIPv4.5 and MCIPv5.0.

Please let me know if that works.

–Tanya

---

<div class="post-metadata">

### Author: ![cristianarango2](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cristianarango2](https://forum.cmascenter.org/u/cristianarango2)
#### Post date: [September 3, 2019, 8:17pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/4 "2019-09-03T20:17:18Z")

</div>

> [@cristianarango2](#):
>
> IOSTAT = 5010

thanks a lot for you reply. I am using gfortran. this are the error codes of gfortran:  
-3 LIBERROR\_FIRST = -3,  
-2 LIBERROR\_EOR = -2,  
-1 LIBERROR\_END = -1,  
0 LIBERROR\_OK = 0,  
5000 LIBERROR\_OS = 5000,  
5001 LIBERROR\_OPTION\_CONFLICT  
5002 LIBERROR\_BAD\_OPTION  
5003 LIBERROR\_MISSING\_OPTION  
5004 LIBERROR\_ALREADY\_OPEN  
5005 LIBERROR\_BAD\_UNIT  
5006 LIBERROR\_FORMAT  
5007 LIBERROR\_BAD\_ACTION  
5008 LIBERROR\_ENDFILE  
5009 LIBERROR\_BAD\_US  
5010 LIBERROR\_READ\_VALUE  
5011 LIBERROR\_READ\_OVERFLOW  
5012 LIBERROR\_INTERNAL  
5013 LIBERROR\_INTERNAL\_UNIT  
5014 LIBERROR\_ALLOCATION  
5015 LIBERROR\_DIRECT\_EOR  
5016 LIBERROR\_SHORT\_RECORD  
5017 LIBERROR\_CORRUPT\_FILE  
5018 LIBERROR\_INQUIRE\_INTERNAL\_UNIT

But I don´t know what value is wrong

---

<div class="post-metadata">

### Author: ![cristianarango2](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cristianarango2](https://forum.cmascenter.org/u/cristianarango2)
#### Post date: [September 3, 2019, 8:19pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/5 "2019-09-03T20:19:30Z")

</div>

Thanks a lot for your Reply

Yes, I am using the mcip script from the version 5.0, indeed, there are some differences between script versions.

---

<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: [September 3, 2019, 8:46pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/6 "2019-09-03T20:46:40Z")

</div>

Thanks for the list. Where did you find it?

You have `5010 LIBERROR_READ_VALUE` which means that there is probably what _gfortran_ thinks is a formatting-error somewhere in the list – maybe an extra comma or decimal point. Check it character-by-character; these things are notoriously hard to find (which is one of the reasons the I/O API encourages environment variables instead of namelists…)

---

<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: [September 3, 2019, 9:47pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/7 "2019-09-03T21:47:38Z")

</div>

…and the _gfortran_ authors have a particularly idiosyncratic way of reading the Fortran standard ;-(

---

<div class="post-metadata">

### Author: ![cristianarango2](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cristianarango2](https://forum.cmascenter.org/u/cristianarango2)
#### Post date: [September 4, 2019, 3:45pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/8 "2019-09-04T15:45:21Z")

</div>

Hi!

I got it from [http://www.hep.manchester.ac.uk/u/samt/misc/gfortran\_errors.html](http://www.hep.manchester.ac.uk/u/samt/misc/gfortran_errors.html)  
I checked the namelist.mcip and compared with namelist in previous versions that I have run and everything seems to be ok.

Can I run mcip 4.2 with WRF4.1? I made a proof but it seems that not recognize wrf 4.

---

<div class="post-metadata">

### Author: ![tlspero](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@tlspero](https://forum.cmascenter.org/u/tlspero)
#### Post date: [September 4, 2019, 4:10pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/9 "2019-09-04T16:10:18Z")

</div>

@cristianarango2 –

I’m sorry you’re experiencing this issue with MCIPv5.0. There is another user with the same issue, so I’d like to get more information to solve the problem. I tested with GFortran on my system, and I did not encounter any errors. Can you please attach your namelist that was generated from your MCIPv5.0 run?

You cannot use MCIPv4.2 with WRFv4.0+. Only MCIPv5.0 is set up for WRFv4.0+ at this time.

–Tanya

---

<div class="post-metadata">

### Author: ![cristianarango2](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cristianarango2](https://forum.cmascenter.org/u/cristianarango2)
#### Post date: [September 4, 2019, 4:19pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/10 "2019-09-04T16:19:38Z")

</div>

Hi Tanya, thanks a lot for your help.

Below my namelist.mcip and the script tha generates it is attached

&FILENAMES  
file\_gd = “/SIMCAB/meteorologia/mcip5/d01/GRIDDESC”  
file\_mm = “/SIMCAB/meteorologia/WRF/WRFV4/run/wrfout\_d01\_2019-08-30\_00:00:00”,  
file\_ter = “/SIMCAB/meteorologia/WRF/WPSV4/geo\_em.d01.nc”  
ioform = 1  
&END

&USERDEFS  
lpv = 0  
lwout = 0  
luvbout = 1  
mcip\_start = “2019-08-30-00:00:00.0000”  
mcip\_end = “2019-08-31-00:00:00.0000”  
intvl = 60  
coordnam = “Colombia”  
grdnam = “CMAQBogota”  
btrim = -1  
lprt\_col = 0  
lprt\_row = 0  
wrf\_lc\_ref\_lat = 40.0  
&END

&WINDOWDEFS  
x0 = 1  
y0 = 1  
ncolsin = 179  
nrowsin = 154  
&END[run\_mcip.csh](https://forum.cmascenter.org/uploads/short-url/4PDp515MLLlZNWZYgVcKDzNZefh.csh) (18.7 KB)

---

<div class="post-metadata">

### Author: ![tlspero](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@tlspero](https://forum.cmascenter.org/u/tlspero)
#### Post date: [September 4, 2019, 5:08pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/11 "2019-09-04T17:08:36Z")

</div>

@cristianarango2 –

Thank you for providing your namelist. This is just a guess, but I’d like you to try it. Please edit namelist.mcip to remove the comma after the first element of “file\_mm”. Then execute mcip.exe. If you cannot execute mcip.exe without your script, edit your script so that you do not overwrite namelist.mcip (for example) by temporarily changing “cat namelist.mcip \>\> !” to “cat junk \>\> !”.

Please let me know if that works.

–Tanya

---

<div class="post-metadata">

### Author: ![cristianarango2](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cristianarango2](https://forum.cmascenter.org/u/cristianarango2)
#### Post date: [September 4, 2019, 8:18pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/12 "2019-09-04T20:18:31Z")

</div>

Hi Tanya

Yes, we already try it modifying the run\_mcip.csh part that generates the namelist.mcip, but it doesn´t work.

Thanks for your help!

---

<div class="post-metadata">

### Author: ![mtchuang100](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mtchuang100](https://forum.cmascenter.org/u/mtchuang100)
#### Post date: [September 26, 2019, 12:34pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/13 "2019-09-26T12:34:22Z")

</div>

I am using PGI and meet the same problem. Have you found the solution? Thanks.

* * *

\*\*\* SUBROUTINE: READNML  
\*\*\* ERROR READING NAMELIST FILE ON UNIT 8  
\*\*\* NAMELIST FILE NAME = namelist.mcip  
\*\*\* NAMELIST = filenames  
\*\*\* IOSTAT = 239

* * *

```
 *** ERROR ABORT in subroutine READNML
 ABNORMAL TERMINATION IN READNML

```

Error running mcip

---

<div class="post-metadata">

### Author: ![thayna.gomes](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@thayna.gomes](https://forum.cmascenter.org/u/thayna.gomes)
#### Post date: [October 1, 2019, 9:04pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/14 "2019-10-01T21:04:23Z")

</div>

Hello @cristianarango2 @tlspero @mtchuang100

I checked the run\_mcip file posted, and it uses IfGeo = “T”.  
Please, check the post below. Maybe it can help…

> [@MCIP version 5.0 Release (August 2019)](https://forum.cmascenter.org/t/mcip-version-5-0-release-august-2019/890/18):
>
> @Catalyst2682 Hello! I had the same issue. Could you try to change this line?? set IfGeo = “T” --\> try using .TRUE. In my case, I’m still having issues, but the log file has changed, and it seems that the script ran a little bit further. I noticed that the default is “F” (and when testing the default, I got the same error when using .TRUE.), but apparently it does not work with “T” (no idea why). Well, since I’m new on this and still having problems, I dont know if it helps, but maybe…

---

<div class="post-metadata">

### Author: ![epenning](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@epenning](https://forum.cmascenter.org/u/epenning)
#### Post date: [November 1, 2019, 10:21pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/15 "2019-11-01T22:21:54Z")

</div>

Hi all,

I had the same issue and am using gfortran (from gccv7.3.0). I removed the comma from the MCIP run script (where file\_mm is defined and written, around line 360) but this did not resolve the issue. Changing ‘IfGeo = “T”’ to ‘IfGeo = .TRUE.’ makes the program run further, but this is because the corresponding if statements (there are 3 of them, around lines 295, 335, 375) are only checking for “T”. When they’re revised to check for .TRUE., the original READNML error appears. I’m able to view my geo\_em file from WRFv4.1.2 in VERDI, so I believe it was generated successfully.

Please let me know if a solution is found.

Thank you,  
Elyse

---

<div class="post-metadata">

### Author: ![Shivang](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@Shivang](https://forum.cmascenter.org/u/Shivang)
#### Post date: [November 14, 2019, 5:30pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/16 "2019-11-14T17:30:08Z")

</div>

* * *

\*\*\* SUBROUTINE: READNML  
\*\*\* ERROR READING NAMELIST FILE ON UNIT 8  
\*\*\* NAMELIST FILE NAME = namelist.mcip  
\*\*\* NAMELIST = filenames  
\*\*\* IOSTAT = 19

* * *

```
 *** ERROR ABORT in subroutine READNML
 ABNORMAL TERMINATION IN READNML

```

We are using WRF 4.0, and MCIP 5.0, this is the error that we are facing, we tried all the possible solutions mentioned in the thread, but none worked, can you guys help in anyway, because it is creating a big problem to the research.  
A possible bypass solution to this was to use geogrid.exe,ungrib.exe and metgrid.exe in WRF4.0 but run realtime.exe and wrf.exe with older WRF version and use old mcip and CMAQ for the computing, it works!! 🙂 but the problem is we want to use CMAQv5.3, because of its easy coupled compatibility with WRF. Please if someone can help, that would be appreciable. Thank you!

---

<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: [November 17, 2019, 2:57am UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/17 "2019-11-17T02:57:06Z")

</div>

Shivang –  
Are you using the MCIP script as it is provided on GitHub, or did you modify it? Post your namelist.mcip file, so that we can verify that it was generated correctly.

What compiler and version are you using?

---

<div class="post-metadata">

### Author: ![Shivang](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@Shivang](https://forum.cmascenter.org/u/Shivang)
#### Post date: [November 17, 2019, 10:40am UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/18 "2019-11-17T10:40:39Z")

</div>

Hi Chris,  
We are using the script (run\_mcip.csh) as it is, we did not modify it, and we are using GCC 4.8.5 compiler.  
namelist.mcip::

&FILENAMES  
file\_gd = “/home/hpc5/WRF4.0/Build\_WRF/WRF/test/em\_real/mcip\_trial/GRIDDESC”  
file\_hdr = “/home/hpc5/WRF4.0/Build\_WRF/WRF/test/em\_real/mcip\_trial/mmheader.d01\_3DINDIA\_20191102” #added from old mcip run file  
file\_mm = “/home/hpc5/WRF4.0/Build\_WRF/WRF/test/em\_real/wrfout\_d01\_2019-11-02\_00:00:00”,  
“/home/hpc5/WRF4.0/Build\_WRF/WRF/test/em\_real/wrfout\_d01\_2019-11-02\_00:00:00”,  
“/home/hpc5/WRF4.0/Build\_WRF/WRF/test/em\_real/wrfout\_d01\_2019-11-03\_00:00:00”,  
file\_ter = “/home/hpc5/WRF4.0/Build\_WRF/WRF/test/em\_real/geo\_em.d01.nc”  
ioform = 1  
&END

&USERDEFS  
lpv = 0  
lwout = 0  
luvbout = 1  
mcip\_start = “2019-11-02\_00:00:00.0000”  
mcip\_end = “2019-11-03\_00:00:00.0000”  
intvl = 60  
coordnam = “3DINDIA”  
grdnam = “3DINDIA”  
btrim = 5  
lprt\_col = 0  
lprt\_row = 0  
wrf\_lc\_ref\_lat =  
&END

&WINDOWDEFS  
x0 =  
y0 =  
ncolsin =  
nrowsin =  
&END

We would be glad if you could help us.

---

<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: [November 17, 2019, 8:20pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/19 "2019-11-17T20:20:30Z")

</div>

The script [run\_mcip.csh](https://github.com/USEPA/CMAQ/blob/master/PREP/mcip/scripts/run_mcip.csh) generates namelist.mcip. The namelist you have provided does not look like what would be produced by the script.  
In particular, you have an embedded comment (line beginning with a #) in the &FILENAMES namelist. I believe this is not legal in Fortran90, and that is exactly what your error message is telling you.  
There are other differences as well between your namelist.mcip and the version generated by the script. The structure of namelist.mcip that is required may vary from one version of MCIP to another. As noted in the release notes, the source code to readnml.f90 has changed; there is no longer a file\_hdr variable.  
I suggest you try the version “out of the box” with the tutorial case, verify that works, then modify for your application.

---

<div class="post-metadata">

### Author: ![tlspero](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@tlspero](https://forum.cmascenter.org/u/tlspero)
#### Post date: [November 17, 2019, 10:16pm UTC](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905/20 "2019-11-17T22:16:48Z")

</div>

@Catalyst2682, @cristianarango2, @mtchuang100, @epenning, @Shivang –

I think I finally figured out the issue with the script and MCIPv5.0. I believe I introduced an error in the MCIP script when I removed the MM5 processing. Inside MCIP, I changed the name of the file that we used to load either TERRAIN (from MM5) or Geogrid (from WRF) output from “file\_ter” to “file\_geo” to be more reflective of the WRF input that we use. However, I forgot to change its setting in the MCIP script where the namelist is generated. Unfortunately, I never used that part of the script in my testing because I already had the fractional land use in the wrfout files…so I never ran into this issue.

Please see: [https://github.com/USEPA/CMAQ/blob/master/PREP/mcip/scripts/run\_mcip.csh](https://github.com/USEPA/CMAQ/blob/master/PREP/mcip/scripts/run_mcip.csh)

In line 377, please change “file\_ter” to “file\_geo”. That will hopefully solve the issue.

I apologize for the inconvenience. The script will be updated in the next release. Please let me know in this thread if the solution I proposed here works for you.

Thanks, also, to @cjcoats and @cgnolte for weighing in on this issue.

–Tanya

[Next page](https://forum.cmascenter.org/t/error-in-subroutine-readnml/905.md?page=2)
