Summary
sfclay1d in src/core_atmosphere/physics/physics_wrf/module_sf_sfclay.F computes
fluxc = max(hfx(i)/rhox(i)/cp + ep1*tskv*qfx(i)/rhox(i), 0.)
VCONV = vconvc*(g/tgdsa(i)*pblh(i)*fluxc)**.33 ! line 510
On the first timestep (pblh not yet diagnosed, and/or fluxc clamped to 0) the base of the real-exponent power is exactly zero. The result (0) is correct, but the power raises the FP invalid-operation flag inside the math library, so with trapping enabled (-Ktrap=fp,inv,ovf, NVHPC 25.11) the run aborts at timestep 1.
Observed (MPAS-A 8.4.1 at 91c5eac, sf_monin_obukhov + YSU, 240 km x1.10242, NVHPC 25.11)
Caught signal 8 (Floating point exception: floating-point invalid operation)
2 0x... module_sf_sfclay_sfclay1d_() .../physics_wrf/module_sf_sfclay.F:510
Without trapping the model runs normally and produces finite output.
Why it matters
It prevents using FP trapping as a whole-model check on MPAS physics, and the correct-by-accident result relies on the library's tolerant pow(0, y) path. A guard (if (pblh(i)*fluxc > 0.) then ... else VCONV = 0.) or a max(..., tiny) base would make the statement well-defined at the endpoint with no change for nonzero inputs. Happy to open a PR if wanted. (The same pattern exists in MYNN's psi_init; reported separately to NCAR/MMM-physics.)
Summary
sfclay1dinsrc/core_atmosphere/physics/physics_wrf/module_sf_sfclay.FcomputesOn the first timestep (
pblhnot yet diagnosed, and/orfluxcclamped to 0) the base of the real-exponent power is exactly zero. The result (0) is correct, but the power raises the FP invalid-operation flag inside the math library, so with trapping enabled (-Ktrap=fp,inv,ovf, NVHPC 25.11) the run aborts at timestep 1.Observed (MPAS-A 8.4.1 at 91c5eac,
sf_monin_obukhov+ YSU, 240 km x1.10242, NVHPC 25.11)Without trapping the model runs normally and produces finite output.
Why it matters
It prevents using FP trapping as a whole-model check on MPAS physics, and the correct-by-accident result relies on the library's tolerant
pow(0, y)path. A guard (if (pblh(i)*fluxc > 0.) then ... else VCONV = 0.) or amax(..., tiny)base would make the statement well-defined at the endpoint with no change for nonzero inputs. Happy to open a PR if wanted. (The same pattern exists in MYNN'spsi_init; reported separately to NCAR/MMM-physics.)