# CMAQ ICON/BCON runtime error

**URL:** <https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484>\
**Category:** CMAQ-PREP\
**Created:** [August 8, 2022, 10:26am UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484 "2022-08-08T10:26:35Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henry](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@Henry](https://forum.cmascenter.org/u/Henry)\
**Post date:** [August 8, 2022, 10:26am UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/1 "2022-08-08T10:26:35Z")

</div>

Hi,  
I’m running CMAQ v5.3.2. The ICON/BCON running for ‘profile’ type was good, but it went wrong with ‘regrid’ mode. I recompiled it in debug version and got error message as follows:

```auto
forrtl: severe (408): fort: (3): Subscript #1 of the array VGDESC has value -9999 which is less than the lower bound of 1

Image PC Routine Line Source             
ICON_v532.exe 000000000055513F Unknown Unknown Unknown
ICON_v532.exe 0000000000434D1E m3_vinterp_ 259 m3_vinterp.F
ICON_v532.exe 000000000042FB00 m3_icout_ 456 m3_icout.F
ICON_v532.exe 0000000000426557 m3_inic_ 304 m3_driver.F
ICON_v532.exe 000000000040FEF0 MAIN__ 142 icon.F
ICON_v532.exe 000000000040DDE2 Unknown Unknown Unknown
libc-2.17.so 00002BA7D6AB6505 __libc_start_main Unknown Unknown
ICON_v532.exe 000000000040DCE9 Unknown Unknown Unknown

```

I checked the files that ICON/BCON required and found that the values of these files for VGTYP (value of array VGDESC) are -9999 instead of 1-7 according to correspounding fortran scripts required. All the files generated by MCIP didn’t contain the correct value of VGTYP. Meanwhile i also received warnings in running MCIP: `WARNING: Vertical grid/coordinate type: -9999 "MISSING" in file "MET_CRO_3D"`

So i was wondering if i had any mistakes in setting MCIP run scripts or the output of wrf contained not vertical grid type. If so, how can I confirm the vertical grip type values in wrfout files?

I really appreciate your help!  
Chen

---

<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:** [August 8, 2022, 9:14pm UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/2 "2022-08-08T21:14:13Z")

</div>

MCIP and downstream CMAQ programs like ICON, BCON, and CCTM use VGTYP=-9999 to indicate the hybrid vertical coordinate system used as default in WRF starting with WRF version 4 (or thereabouts). The ICON and BCON handling of this VGTYP=-9999 indicator was updated in CMAQv5.3.3, so we recommend that you update your code to this latest version. For additional details, please see the relevant section of the [CMAQv5.3.3 release notes.](https://github.com/USEPA/CMAQ/blob/main/DOCS/Release_Notes/CMAQv5.3.3_ICON_BCON_updates.md)

---

<div class="post-metadata">

**Author:** ![Henry](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@Henry](https://forum.cmascenter.org/u/Henry)\
**Post date:** [August 12, 2022, 6:31am UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/3 "2022-08-12T06:31:58Z")

</div>

Hi, I updated CMAQ to v5.3.3 and ran through mcip to generate corresponding files for ICON/BCON.  
However this time i encoutered warnings and errors as follows:

` \>\>—\>\> WARNING in subroutine M3\_VINTERP:INTERP3  
Size error for ZH from MET\_CRO\_3D\_CRS–REQ: 46689 ACT: 653646  
M3WARN: DTBUF 0:00:00 Jan. 1, 2018 (2018001:000000)

```
 *** ERROR ABORT in subroutine M3_VINTERP
 Could not read layer heights from file MET_CRO_3D_CRS
 Date and time 0:00:00 Jan. 1, 2018 (2018001:000000)` 

```

Do you have any suggestions or solutions to this problem. I really appreciate it!

---

<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:** [August 12, 2022, 11:18am UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/4 "2022-08-12T11:18:14Z")

</div>

This looks like a grid-mixup between the _MET\_CRO\_3D\_CRS_ and the BCON run: check whether the grid descriptions from the file header (do the command _ncdump -h $MET\_CRO\_3D\_CRS_) and from the BCON run are the same.

---

<div class="post-metadata">

**Author:** ![Henry](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@Henry](https://forum.cmascenter.org/u/Henry)\
**Post date:** [August 13, 2022, 6:18am UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/5 "2022-08-13T06:18:01Z")

</div>

Hi,

I’ve checked the METCRO3D files used for ICON/BCON, and there were ZH and PRES data. The values of ZH seemed to be fine. I have no idea what does the warning ‘size error for ZH’ mean.  
Which fortran scripts in ICON/BCON should i check for errors besides M3\_VINTERP.F

On the other hand, I’m using same file for _MET\_CRO\_3D\_CRS_ and _MET\_CRO\_3D\_FIN_. Meanwhile the CONC file is also generated by these MCIP files. I’m wondering why i’m receiving message `The COORD.EXT and CTM vertical grid types are different. Vertical interpolation using ZH from the MET_CRO_3D files`. And how should i check the vertical grid type for these files?

Thanks!

---

<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:** [August 13, 2022, 9:10am UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/6 "2022-08-13T09:10:30Z")

</div>

> I’m using same file for MET\_CRO\_3D\_CRS and MET\_CRO\_3D\_FIN

**This does not work.**

Among other things, the grid-dimensions for the `CRS` and `FIN` grids are different, and `INTERP3` is complaining of a dimension-mismatch between what;'s on the file and what it expects (preventing further errors on your part)…

Maybe have a look at how to characterize horizontal grids? See [https://www.cmascenter.org/ioapi/documentation/all\_versions/html/GRIDS.html#horiz](https://www.cmascenter.org/ioapi/documentation/all_versions/html/GRIDS.html#horiz)

---

<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:** [August 13, 2022, 3:43pm UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/7 "2022-08-13T15:43:00Z")

</div>

To add to @cjcoats’ comment, could you please elaborate on what you are trying to do? The intended use of BCON and ICON in “regrid” mode is to take model output from a larger domain (typically but not necessarily with a coarser grid spacing) to prepare initial and boundary conditions for a smaller domain (typically but not necessarily with a finer grid spacing).

For this to work, BCON needs a) the coarse grid concentration file (CTM\_CONC\_1), b) the coarse grid meteorological file (typically from MCIP) containing ZH and PRES data (MET\_CRO\_3D\_CRS), and c) the fine grid MCIP METBDY3D file defining the boundary of the fine grid, also containing ZH and PRES (MET\_BDY\_3D\_FIN). [as an aside, CTM\_CONC\_1 and MET\_CRO\_3D\_CRS can point to the same file if that file contains both concentrations and the required meteorological fields ZH and PRES]. The requirements for ICON are the same, except that c) needs to be the fine grid MCIP meteorological file defining the fine grid and containing ZH and PRES (MET\_CRO\_3D\_FIN).

---

<div class="post-metadata">

**Author:** ![Henry](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@Henry](https://forum.cmascenter.org/u/Henry)\
**Post date:** [August 14, 2022, 6:25am UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/8 "2022-08-14T06:25:10Z")

</div>

My research domain was a 27km resolution grid nested with a 9km grid. I ran CMAQ with profiled ICON/BCON to obtain concentration file for the coarse grid of 27km. And was testing nested (regrid) ICON/BCON for the finer grid of 9km.

So currently I have a coarser grid concentration file (CTM\_CONC\_1\_27km) and also the MCIP files (MET\_CRO\_3D and MET\_BDY\_3D) for 27km grid. Meanwhile, MET\_CRO\_3D\_FIN file was generated from MCIP using wrfout files for 9km resolution grid.

I’ve checked the headers of MET\_CRO\_3D\_CRS file and ICON/BCON output files (unfinished). Global attributes defining grid dimension were the same. So I was wondering what could cause the mismatch between them. I’m attaching the headers of the two files in following txts.  
[ICON\_regrid.txt](https://forum.cmascenter.org/uploads/short-url/sUQCyq8ho4QBYH5zwJlq0i9amHy.txt) (80.3 KB)  
[METCRO3D.txt](https://forum.cmascenter.org/uploads/short-url/7QrIgw9RJKmKHi62jgArFVuLLx3.txt) (11.0 KB)

Besides, the only difference is that my CTM\_CONC\_1 file had 1 layer output (NLAYS=1). Could it be this causing errors?

Thanks!

---

<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:** [August 14, 2022, 12:30pm UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/9 "2022-08-14T12:30:45Z")

</div>

Thanks for the additional information. A few thoughts:

- In the ICON run script used to generated the (unfinished) regridded ICON file for which you posted the header, are you sure that you specified the 9km METCRO3D file from MCIP rather than the 27km METCRO3D file from MCIP as MET\_CRO\_3D\_FIN? The ICON header shows the same grid information as for the coarse 27 km domain defined in the METCRO3.txt file you posted. If you previously tried to run ICON with the 27 km METCRO3D file as MET\_CRO\_3D\_FIN and then changed the run script to point to the 9 km METCRO3D file, make sure to delete the incomplete ICON file prior to rerunning.

- Yes, your CTM\_CONC\_1 file for the coarse domain absolutely needs to span the entire vertical extent of your intended fine domain. In order for ICON and BCON to compute boundary and initial conditions for all layers of the fine domain, 3D information needs to be available from the coarse domain.

- Please post your ICON and BCON run scripts if you continue to encounter issues after checking and addressing the points above.

---

<div class="post-metadata">

**Author:** ![Henry](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@Henry](https://forum.cmascenter.org/u/Henry)\
**Post date:** [August 15, 2022, 10:16am UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/10 "2022-08-15T10:16:08Z")

</div>

It worked! I span the vertical domain of CTM\_CONC\_1 to whole layers, which is equivalent to MET\_CRO\_3D files and BCON/ICON finished successfully. Also I looked up ioapi documentations from cmascenter which described the how INTERP3() function works.  
[https://www.cmascenter.org/ioapi/documentation/all\_versions/html/AA.html#ioapi](https://www.cmascenter.org/ioapi/documentation/all_versions/html/AA.html#ioapi)  
It requires the grid size of CTM\_CONC\_1 (NROWS_NCOLS_NLAYS) to be consistent with MET\_CRO\_3D\_CRS, which in my case it is not, causing size errors.

Thanks for the replies and advices from both of you! I really appreciate it.

---

<div class="post-metadata">

**Author:** ![hhallaji](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/hhallaji/32/3723_2.png) [@hhallaji](https://forum.cmascenter.org/u/hhallaji)\
**Post date:** [December 25, 2024, 8:21pm UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/11 "2024-12-25T20:21:50Z")

</div>

Hi @Henry,

Thank you for sharing your solution and insights! I am currently facing the same error:

" \*\*\* ERROR ABORT in subroutine M3\_VINTERP  
Could not read layer heights from file MET\_CRO\_3D\_CRS  
Date and time 0:00:00 July 2, 2017 (2017183:000000)."

In my case, the `NLAYS` value in the `CTM_CONC_1` file is 1, while the corresponding `MET_CRO_3D_CRS` file has 35 layers. This mismatch might be causing the issue. Could you provide guidance on how to properly run `INTERP3` to address this?

Any additional tips from your experience would be greatly appreciated.

Thanks in advance!

---

<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:** [December 26, 2024, 1:18pm UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/12 "2024-12-26T13:18:20Z")

</div>

Hello @hhallaji ,

in order to create initial and boundary conditions for an inner domain, you need 3D outputs from your outer domain. This means that when you perform CCTM simulations for your outer domain, you should use `setenv CONC_BLEV_ELEV " 1 35"` in your run script (since you say your MET\_CRO\_3D\_CRS file has 35 layers), or comment out this line altogether. in which case the number of layers in the CCTM\_CONC file automatically will match the number of layers in the MET\_CRO\_3D\_CRS.

---

<div class="post-metadata">

**Author:** ![hhallaji](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/hhallaji/32/3723_2.png) [@hhallaji](https://forum.cmascenter.org/u/hhallaji)\
**Post date:** [December 26, 2024, 2:56pm UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/13 "2024-12-26T14:56:12Z")

</div>

@hogrefe.christian ,

Thank you so much for your helpful insight! I’ll make sure to be cautious about the CONC\_BLEV\_ELEV setting in future runs, as it’s critical to ensure consistency with the number of layers in the MET\_CRO\_3D\_CRS file. This will undoubtedly save me from similar issues.

Follow-up Question:

I was wondering if there are any alternative ways to process CMAQ results when working with data that only has one vertical layer (NLAYS=1). I am using input data files from a previous study to run ICON/BCON for the 4km domain, but I’ve encountered grid mismatches between these input files. These mismatches are making it difficult to align the data. Do you have any suggestions or tips on how to address these challenges effectively?

---

<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:** [December 26, 2024, 3:16pm UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/14 "2024-12-26T15:16:25Z")

</div>

> [@hhallaji](#):
>
> I was wondering if there are any alternative ways to process CMAQ results when working with data that only has one vertical layer (NLAYS=1).

Could you please elaborate on what you mean by “process CMAQ results”? If you refer to generating initial and boundary conditions from CMAQ output that contains data for the surface layer only, then no, that’s generally not possibly, unless you make some assumptions about the vertical profiles of all pollutants and write code to manually apply these profiles to generate 3D fields from your existing 2D fields.

You could theoretically also fall back to running ICON and BCON in profile mode using the profile file distributed with CMAQ in the PREP/bcon/src/profile folders, but since this profile represents clean background conditions over a marine environment during a specific year and using a specific version of hemispheric CMAQ, it might not at all be applicable to your domain of interest where pollutant inflow might be important.

> [@hhallaji](#):
>
> I am using input data files from a previous study to run ICON/BCON for the 4km domain, but I’ve encountered grid mismatches between these input files. These mismatches are making it difficult to align the data. Do you have any suggestions or tips on how to address these challenges effectively?

Without specific details on the challenges you are encountering, we cannot provide suggestions on how to address them.

---

<div class="post-metadata">

**Author:** ![hhallaji](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/hhallaji/32/3723_2.png) [@hhallaji](https://forum.cmascenter.org/u/hhallaji)\
**Post date:** [December 26, 2024, 3:57pm UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/15 "2024-12-26T15:57:54Z")

</div>

I am currently running CMAQ / ICON-BCON v5.4 to generate initial conditions (IC) and boundary conditions (BC) for the inner domain (4km) using the “regrid” method. The input for the inner domain is based on the output from a previous CMAQ run for the outer domain (12km). However, during this process, I encountered the following warnings and errors:

```
 Vertical interpolation method: Linear                                           

 The COORD.EXT and CTM vertical grid types are different. 
 Vertical interpolation using ZH from the MET_CRO_3D files
 
 >>--->> WARNING in subroutine M3_VINTERP:INTERP3
 Size error for ZH from MET_CRO_3D_CRS--REQ: 117130 ACT:4099550
 M3WARN: DTBUF 0:00:00 July 2, 2017 (2017183:000000)
 
 *** ERROR ABORT in subroutine M3_VINTERP
 Could not read layer heights from file MET_CRO_3D_CRS
 Date and time 0:00:00 July 2, 2017 (2017183:000000)

```

To provide additional context, I have attached the log files for your review.

[run\_icon\_regrid\_4km.log.txt](https://forum.cmascenter.org/uploads/short-url/y1ad4zrQxIr3As3q4LUdyNLqQk6.txt) (33.6 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:** [December 26, 2024, 4:25pm UTC](https://forum.cmascenter.org/t/cmaq-icon-bcon-runtime-error/3484/16 "2024-12-26T16:25:37Z")

</div>

Well, right, this is the problem caused by trying to use a 2D rather than a 3D CONC file from your 12 km domain to generate initial and boundary conditions for your 4 km domain. The only solution is to have your 12 km simulation output 3D CONC files, the same solution confirmed by @Henry in post #9 to have solved their identical issue. This is not an issue of a ‘grid mismatch’ causing problems with ‘data alignment’, it’s purely a 12 km run script output option issue.

If you do not have the option of rerunning your 12 km simulation to generate 3D output files, you will have to look for alternate data sources to generate initial and boundary conditions, such as archived [3D hemispheric CMAQ output data](https://github.com/USEPA/CMAQ/blob/main/DOCS/Users_Guide/Tutorials/CMAQ_UG_tutorial_HCMAQ_IC_BC.md). However, you will have to carefully examine whether this or any other alternate source of 3D data to create initial and boundary conditions is appropriate for your domain and time period.
