Host-scalar evaluation of the surface-band age value A_young(t)
(s), MOM6 ideal_age_example.F90’s young_val computation
(:380-385), taken exactly in spirit including the
growth_rate == 0 short-circuit (no exp call, no t
dependence) — this is what keeps the default bit-identical:
young = young_val if sfc_growth_rate == 0
young = young_val * exp(sfc_growth_rate*t) otherwise
t is model time (s) since run start. young_val (s) and
sfc_growth_rate (1/s) are host scalars from ocean_dyn_t;
call this ONCE per outer step on the host, never inside a
do concurrent body.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | young_val | |||
| real(kind=wp), | intent(in) | :: | sfc_growth_rate | |||
| real(kind=wp), | intent(in) | :: | t |
pure function ocean_ideal_age_young_val(young_val, sfc_growth_rate, t) result(young) !! Host-scalar evaluation of the surface-band age value `A_young(t)` !! (s), MOM6 `ideal_age_example.F90`'s `young_val` computation !! (`:380-385`), taken exactly in spirit including the !! `growth_rate == 0` short-circuit (no `exp` call, no `t` !! dependence) — this is what keeps the default bit-identical: !! `young = young_val` if sfc_growth_rate == 0 !! `young = young_val * exp(sfc_growth_rate*t)` otherwise !! `t` is model time (s) since run start. `young_val` (s) and !! `sfc_growth_rate` (1/s) are host scalars from `ocean_dyn_t`; !! call this ONCE per outer step on the host, never inside a !! `do concurrent` body. real(wp), intent(in) :: young_val real(wp), intent(in) :: sfc_growth_rate real(wp), intent(in) :: t real(wp) :: young if (sfc_growth_rate == 0.0_wp) then young = young_val else young = young_val*exp(sfc_growth_rate*t) end if end function ocean_ideal_age_young_val