# Program can't load CGRID file properly

**URL:** <https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452>\
**Category:** Run Time Errors and Issues\
**Created:** [December 20, 2018, 2:58pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452 "2018-12-20T14:58:27Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![zyj.jess](https://avatars.discourse-cdn.com/v4/letter/z/8dc957/32.png) [@zyj.jess](https://forum.cmascenter.org/u/zyj.jess)\
**Post date:** [December 20, 2018, 2:58pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/1 "2018-12-20T14:58:28Z")

</div>

Hello;

I have an issue with running CCTM. It can;’ tread or load the CGRID correctly. I tried different ICFILE or INIT\_GASC\_1 but they all did not work well. The error is shown below.

```
 >>--->> WARNING in subroutine RDTFLAG
 Time step error for file: INIT_GASC_1
 M3WARN: DTBUF 0:00:00 Jan. 1, 2014 (2014001:000000)
 
 >>--->> WARNING in subroutine XTRACT3
 Time step not available for file: INIT_GASC_1
 M3WARN: DTBUF 0:00:00 Jan. 1, 2014 (2014001:000000)

 *** ERROR ABORT in subroutine LOAD_CGRID on PE 000      
 Could not read NO2 from INIT_GASC_1

```

And the settings are here.

#\> Initial conditions  
if ($NEW\_START == true || $NEW\_START == TRUE ) then  
setenv ICFILE ts20140101.bpch.ICON.nc  
#setenv ICFILE ICON\_v52\_profile  
setenv INITIAL\_RUN Y #related to restart soil information file  
rm -rf LOGDIR/CTM\_LOG\*{RUNID}\* # Remove all Log Files Since this is a new start  
mkdir -p $OUTDIR

Would you help me look at it? Appreciate your help!

Yijia

---

<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:** [December 20, 2018, 3:47pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/2 "2018-12-20T15:47:38Z")

</div>

> [@zyj.jess](#):
>
> ts20140101.bpch.ICON.nc

Please try to use the following command to check that the ICFILE you are using is complete.  
`ncdump -h ts20140101.bpch.ICON.nc | grep NO2`  
You should see NO2 listed as follows:

```
float NO2(TSTEP, LAY, ROW, COL) ;
	NO2:long_name = "NO2 " ;
	NO2:units = "ppmV " ;
	NO2:coordinates = "lon lat" ;
	NO2:var_desc = "Variable NO2 " ;
	:VAR-LIST = "AIRDEN NO2 NO O3 ...

```

`

---

<div class="post-metadata">

**Author:** ![wong.david-c](https://avatars.discourse-cdn.com/v4/letter/w/bcef8e/32.png) [@wong.david-c](https://forum.cmascenter.org/u/wong.david-c)\
**Post date:** [December 26, 2018, 1:00pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/3 "2018-12-26T13:00:36Z")

</div>

Hi Yijia,

```
I wonder how did you generate the IC file. According to the ncdump information you have provided, it does not look like a "normal" IOAPI file.

```

Cheers,  
David

---

<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:** [December 26, 2018, 3:54pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/4 "2018-12-26T15:54:19Z")

</div>

Hi Yijia and David,

The \*bpch.ICON.nc" file may need to be processed to put it in the format used for the initial condition for CMAQ. Until we determine how to do this, you could try using m3tshift ([https://www.cmascenter.org/ioapi/documentation/all\_versions/html/M3TSHIFT.html](https://www.cmascenter.org/ioapi/documentation/all_versions/html/M3TSHIFT.html)) to change the date on an ICON file for June 01, 2014 that is available on the google drive:  
[https://drive.google.com/drive/u/1/folders/1\_6jVTUxAq9pBAZY-W4og6kxxEuqK4NNs](https://drive.google.com/drive/u/1/folders/1_6jVTUxAq9pBAZY-W4og6kxxEuqK4NNs)

Liz

---

<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:** [January 2, 2019, 8:27pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/5 "2019-01-02T20:27:50Z")

</div>

Hi Yijia,

It looks like you need to use the geos2cmaq program available here:

> **[barronh/geos2cmaq](https://github.com/barronh/geos2cmaq)**
>
> GEOS2CMAQ maps GEOS-Chem outputs to CMAQ boundary conditions for any chemical mechanism. - barronh/geos2cmaq

  
This can be used to convert the geochem output file into a CMAQ ICON input file.

Liz

---

<div class="post-metadata">

**Author:** ![The\_Samuelson](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@The\_Samuelson](https://forum.cmascenter.org/u/The_Samuelson)\
**Post date:** [April 16, 2019, 4:04pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/6 "2019-04-16T16:04:16Z")

</div>

Hello,

I am trying to run WRF-CMAQ and having a similar problem as the OP (not reading ICON file correctly). See my error message below:

```
>>--->> WARNING in subroutine XTRACT3
     Error in row-bounds VNAME for file INIT_GASC_1 variable NO2
     M3WARN: DTBUF 0:00:00 July 1, 2011 (2011182:000000)

     *** ERROR ABORT in subroutine LOAD_CGRID on PE 000
     Could not read NO2 from INIT_GASC_1
     Date and time 0:00:00 July 1, 2011 (2011182:000000)

```

I am using the SE52BENCH single day ICBC file.

```
set ICFILE = ICON_20110630_bench.nc
setenv INIT_GASC_1 $ICpath/$ICFILE

```

The ICFILE is a readable netcdf… ncdump shows values for NO2 on date 2011182 (July 1, 2011).

I’m a little lost as to what the issue is. Thanks for any hints!

-mj

---

<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:** [April 17, 2019, 1:00pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/7 "2019-04-17T13:00:50Z")

</div>

What does “readaable netCDF” mean – where did this file come from?

Note (from the I/O API Home Page, [https://www.cmascenter.org/ioapi/documentation/all\_versions/html/index.html](https://www.cmascenter.org/ioapi/documentation/all_versions/html/index.html)),  
**The Models-3 I/O API is A _[programming interface](https://en.wikipedia.org/wiki/Application_programming_interface), not a data format !!_**

_I/O API files are not synonymous with “netCDF files” !!_  
Instead, netCDF is one of four (and a half) distinct lower layers on which the data and metadata structures for I/O API files are currently available…

Carlie J. Coats, Jr., Ph.D. cjcoats@email.unc.edu  
Senior Software Engineer I/O API Author/Maintainer  
Center for Environmental Modeling for Policy Development,  
UNC Institute for the Environment www.ie.unc.edu  
100 Europa Dr., Suite 490 Rm 4051 / Campus Box 1105 919.843.5951  
Chapel Hill, NC 27599-1105 Fax 919.966.9920

---

<div class="post-metadata">

**Author:** ![The\_Samuelson](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@The\_Samuelson](https://forum.cmascenter.org/u/The_Samuelson)\
**Post date:** [April 17, 2019, 1:57pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/8 "2019-04-17T13:57:08Z")

</div>

Hello Dr. Coats,

The netCDF came from the CMAQ provided single-day test data SE52BENCH. By “readable” I mean ncdump reads the file fine and outputs what looks like reasonable values for the NO2 variable.

-mj

---

<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:** [April 17, 2019, 2:12pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/9 "2019-04-17T14:12:07Z")

</div>

There should have been messages of the form:  
Lower bound: …  
Upper bound: …  
Actual number of rows:…  
that indicate the lower and upper row arguments for XTRACT3, followed by the actual file’s grid row-dimension. XTRACT3 claims that the arguments don’t fit inside the file. Compare the file’s grid dimensions with the CMAQ grid dimensions; possibly you have an ICFILE for the wrong test case?

[BTW, you _haven’t_ mucked around with I/O API parameters-file PARMS3.EXT, have you?]

---

<div class="post-metadata">

**Author:** ![The\_Samuelson](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@The\_Samuelson](https://forum.cmascenter.org/u/The_Samuelson)\
**Post date:** [April 17, 2019, 2:29pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/10 "2019-04-17T14:29:39Z")

</div>

Thanks for your continued attention, Dr. Coats! I haven’t done any mucking around, no 🙂

Here’s more of the tail end of the rsl.out.0000 log file for the wrf-cmaq run…

> ```
> 109 VSVPO2 1.0000
> 110 VSVPO3 1.0000
> 111 VIVPO1 1.0000
> 112 VLVOO1 1.0000
> 113 VLVOO2 1.0000
> 114 VSVOO1 1.0000
> 115 VSVOO2 1.0000
> 116 VSVOO3 1.0000
> 117 PCVOC 1.0000
> 118 PCSOARXN 1.0000
> No IC found for species FORM_PRIMARY in INIT_GASC_1; set to 1.00E-30
> No IC found for species ALD2_PRIMARY in INIT_GASC_1; set to 1.00E-30
> No IC found for species BUTADIENE13 in INIT_GASC_1; set to 1.00E-30
> No IC found for species ACROLEIN in INIT_GASC_1; set to 1.00E-30
> No IC found for species ACRO_PRIMARY in INIT_GASC_1; set to 1.00E-30
> No IC found for species TOLU in INIT_GASC_1; set to 1.00E-30
> No IC found for species HG in INIT_GASC_1; set to 1.00E-30
> No IC found for species HGIIAER in INIT_GASC_1; set to 1.00E-30
> No IC found for species HGIIGAS in INIT_GASC_1; set to 1.00E-30
> Lower bound: 11907
> Upper bound: 11986
> Actual number of layers: 80
> 
> >>--->> WARNING in subroutine XTRACT3
> Error in row-bounds VNAME for file INIT_GASC_1 variable NO2
> M3WARN: DTBUF 0:00:00 July 1, 2011 (2011182:000000)
> 
> *** ERROR ABORT in subroutine LOAD_CGRID on PE 000
> Could not read NO2 from INIT_GASC_1
> Date and time 0:00:00 July 1, 2011 (2011182:000000)
> 
> ```

---

<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:** [April 17, 2019, 6:43pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/11 "2019-04-17T18:43:17Z")

</div>

…  
Lower bound: 11907  
Upper bound: 11986  
…  
This is clearly a problem coming from the subroutine LOAD\_CGRID that is calling XTRACT3. With 80 rows in the model-grid, both of these should be between 1 and 80.

So this is a model-problem somehow…

– Carlie

---

<div class="post-metadata">

**Author:** ![The\_Samuelson](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@The\_Samuelson](https://forum.cmascenter.org/u/The_Samuelson)\
**Post date:** [April 17, 2019, 7:31pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/12 "2019-04-17T19:31:37Z")

</div>

Thanks for the hints.

Do you mean a systemic problem in the XTRACT3 module or a problem with my model setup?

---

<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:** [April 18, 2019, 4:57pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/13 "2019-04-18T16:57:38Z")

</div>

either model-setup or model-implementation

---

<div class="post-metadata">

**Author:** ![The\_Samuelson](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@The\_Samuelson](https://forum.cmascenter.org/u/The_Samuelson)\
**Post date:** [April 18, 2019, 5:20pm UTC](https://forum.cmascenter.org/t/program-cant-load-cgrid-file-properly/452/14 "2019-04-18T17:20:59Z")

</div>

Thank you!

I sorted this issue by examining and modifying the following parameters in the wrf-cmaq run script…

```
setenv CMAQ_COL_DIM
setenv CMAQ_ROW_DIM
setenv TWOWAY_DELTA_X
setenv TWOWAY_DELTA_Y
```
