ocean_ideal_age_young_val Function

public 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.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: young_val
real(kind=wp), intent(in) :: sfc_growth_rate
real(kind=wp), intent(in) :: t

Return Value real(kind=wp)


Called by

proc~~ocean_ideal_age_young_val~~CalledByGraph proc~ocean_ideal_age_young_val ocean_ideal_age_young_val proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~ocean_ideal_age_young_val proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~ocean_ideal_age_young_val proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step proc~engine_step->proc~ocean_dyn_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Source Code

   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