# 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:** 1\
**Showing post:** 3

<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…

---

_[View the full topic](https://forum.cmascenter.org/t/icon-nesting-error/5586)._
