# Icon nesting error

**URL:** <https://forum.cmascenter.org/t/icon-nesting-error/5586>\
**Category:** CMAQ-PREP\
**Tags:** cmaq\
**Created:** [February 13, 2025, 4:25am UTC](https://forum.cmascenter.org/t/icon-nesting-error/5586 "2025-02-13T04:25:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TJDOFLEARN](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@TJDOFLEARN](https://forum.cmascenter.org/u/TJDOFLEARN)\
**Post date:** [February 13, 2025, 4:25am UTC](https://forum.cmascenter.org/t/icon-nesting-error/5586/1 "2025-02-13T04:25:51Z")

</div>

When I run the icon nesting, the error is as shown below

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/8/8a8ee1dab11630d53297b59b1b7313c35eb23493.png)

The error file is  
[slurm-3368111.txt](https://forum.cmascenter.org/uploads/short-url/xVd1jdZhsROL3JreLgE3USPyHOI.txt) (8.2 KB)

Interestingly, my CCTM\_CONC\_v55\_gcc\_huabei\_20200630.nc file is generated from the METCRO3D\_huabei.nc file.The runfile is as follows  
[run\_cctm.csh](https://forum.cmascenter.org/uploads/short-url/6arELyVMx6yQojTsei8s7qjXOrK.csh) (39.2 KB)  
[run\_icon.csh](https://forum.cmascenter.org/uploads/short-url/yOzzP0sMRePcZJUFxDkVxxnRFjR.csh) (6.1 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:** [February 14, 2025, 4:31pm UTC](https://forum.cmascenter.org/t/icon-nesting-error/5586/2 "2025-02-14T16:31:13Z")

</div>

Hello @TJDOFLEARN ,

there are several approaches you could take in your specific case.

- Given that you’re certain that your grids match and you’re just dealing with a precision issue, you could comment out the relevant grid consistency checks on lines 176 - 237 of subroutine [m3\_ck\_ctmmet.F](https://github.com/USEPA/CMAQ/blob/main/PREP/icon/src/m3conc/m3_ck_ctmmet.F) and then recompile ICON

- you could presumably also edit line 277 in the same file linked above to change `94000 FORMAT( E15.5 )` to `94000 FORMAT( E15.4 )` or `94000 FORMAT( E15.3 )` to require a lower level of precision matching but leave the actual consistency checks in place and then recompile ICON

- for a more robust and general solution, the code in lines 176 - 237 could be updated along the lines described by @cjcoats in this [related post](https://forum.cmascenter.org/t/cmaq-v5-2-ddm-error-for-init-casc-1/3122/9).

---

<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:** [February 14, 2025, 5:04pm UTC](https://forum.cmascenter.org/t/icon-nesting-error/5586/3 "2025-02-14T17:04:04Z")

</div>

This doesn’t quite work.  
Assuming the program does a perfect job of rounding (something **not guaranteed** by the Fortran Standard), no such look-at-ASCII-strings test works, as I have written extensively elsewhere. See NOTE below.

What is really is needed is to **measure the relative error** : how big is the difference when compared to the original numbers – something like  
`ABS( B-A)/(0.5*A + 0.5*B) < TOLERANCE`  
(or various other relative-error formulations like those found in `DBLERR` from _ioapi/chkfil3.f90_ (which is what the author of this code should have used anyway).

_NOTE_

```
DOUBLE PRECISION, PARAMETER :: A = 1.234565D0
DOUBLE PRECISION, PARAMETER :: E = 1.0D-15
DOUBLE PRECISION, PARAMETER :: X = A - E
DOUBLE PRECISION, PARAMETER :: Y = A + E
```

X and Y are _incredibly_ close; however (assuming perfect rounding), they fail the _ICON_-code test, which treats X as 1.23456 and Y as 1.23457 for purposes of its comparison.  
Making matters worse, the _ICON_ code reports the numbers to the log using a different format than it does for the comparison…
