Adcroft reciprocal: 1/x, but 0 -> 0 (zero-width faces give
zero inverse, no NaN/Inf). Single source for every metric
inverse (D4).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | x |
elemental pure function adcroft_recip(x) result(r) !! Adcroft reciprocal: `1/x`, but `0 -> 0` (zero-width faces give !! zero inverse, no NaN/Inf). Single source for every metric !! inverse (D4). real(wp), intent(in) :: x real(wp) :: r if (x /= 0.0_wp) then r = 1.0_wp/x else r = 0.0_wp end if end function adcroft_recip