max(N^2, 0) for the PE release, with a non-finite N^2 read as 0
(a bare max is NaN-blind under relaxed FP, CLAUDE.md).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | n2 |
pure function gm_pos_n2(n2) result(np) !$acc routine seq !! `max(N^2, 0)` for the PE release, with a non-finite N^2 read as 0 !! (a bare `max` is NaN-blind under relaxed FP, CLAUDE.md). real(wp), intent(in) :: n2 real(wp) :: np np = 0.0_wp if (ieee_is_finite(n2)) np = max(n2, 0.0_wp) end function gm_pos_n2