# Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation

**URL:** <https://forum.cmascenter.org/t/program-received-signal-sigfpe-floating-point-exception-erroneous-arithmetic-operation/5221>\
**Category:** CMAQ\
**Tags:** cmaq\
**Created:** [September 16, 2024, 4:54am UTC](https://forum.cmascenter.org/t/program-received-signal-sigfpe-floating-point-exception-erroneous-arithmetic-operation/5221 "2024-09-16T04:54:47Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [September 16, 2024, 11:30am UTC](https://forum.cmascenter.org/t/program-received-signal-sigfpe-floating-point-exception-erroneous-arithmetic-operation/5221/3 "2024-09-16T11:30:20Z")

</div>

Hello Hasibul,

Line 652 which the backtrace is pointing to in the m3dry.F code is this one:

```
           rstom = MET_DATA%RS( c,r ) * dwat / dif0( l )
 & + 1.0 / ( heff_ap / 3000.0 + 100.0 * meso( l ) ) / laicr

```

My suspicion is that there is some inconsistency in your WRF fields between the LWMASK or VEGF fields and the LAI fields. Specifically, I suspect your WRF fields may have grid cells where LAI is zero (causing a divide-by-zero error) despite having a non-zero VEGF value and/or a LWMASK indicating land.

Stomatal resistance (rstom) in line 652 is only calculated over land cells.

Line 502 determines whether a grid cell should be treated as all water (unvegetated)

```
        IF ( ( NINT(GRID_DATA%LWMASK( c,r )) .EQ. 0 ) .OR. ( vegcr .EQ. 0.0 ) ) THEN ! water

```

Line 563 then starts the “else” branch of that “if” condition with the land-based calculations, including the calculation of rstom that assumes LAI to be non-zero.

The issue you are encountering seems similar to the one in this thread:

> [@CCTM5.3.3 run error: Program received signal SIGFPE: Floating-point exception](https://forum.cmascenter.org/t/cctm5-3-3-run-error-program-received-signal-sigfpe-floating-point-exception/3297):
>
> Hi, I got following error when I run CMAQv5.3.3: Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation. Backtrace for this error: #0 0x2AC6866D4697 #1 0x2AC6866D4CDE #2 0x2AC6871673FF #3 0x9381DA in m3dry\_ #4 0x6CC539 in \_\_depv\_defn\_MOD\_get\_depv at DEPV\_DEFN.F:544 #5 0x91E7E4 in vdiff\_ at vdiffproc.F:411 #6 0x86810D in sciproc\_ at sciproc.F:237 #7 0x8566DD in cmaq\_driver\_ at driver.F:717 #8 0x8510C4 in MAIN\_\_ at cmaq\_main.F:97 =====================…

Similar to the discussion in that thread, you would want to perform a careful analysis of your LWMASK, VEGF, and LAI fields to identify and hopefully resolve any inconsistencies that currently exist.

---

_[View the full topic](https://forum.cmascenter.org/t/program-received-signal-sigfpe-floating-point-exception-erroneous-arithmetic-operation/5221)._
