Seed the surface buoyancy restoring (MOM6 RESTOREBUOY)
parameters and set the has_restore_T / has_restore_S gates.
Sibling to set_surface_flux_const / set_sw_penetration —
kept separate so existing callers are unchanged. The piston
velocities arrive in m/day (the MOM6 FLUXCONST_* unit) and
are converted to MKS m/s here. Effective-enable guard:
has_restore_* = enable_* .and. piston /= 0, so an enabled
switch with a zero piston is a silent no-op (rather than
restoring everything toward the 0-degC / 0-PSU default target).
Host only; all knobs are read host-side as by-value arguments to
the device _impl, so no extra device sync beyond copyin(this).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_surface_flux_t), | intent(inout) | :: | this | |||
| logical, | intent(in) | :: | enable_T | |||
| logical, | intent(in) | :: | enable_S | |||
| real(kind=wp), | intent(in) | :: | piston_t_day | |||
| real(kind=wp), | intent(in) | :: | piston_s_day | |||
| real(kind=wp), | intent(in) | :: | T_target | |||
| real(kind=wp), | intent(in) | :: | S_target |
subroutine ocean_surfflux_set_restore(this, enable_T, enable_S, & piston_t_day, piston_s_day, & T_target, S_target) !! Seed the surface buoyancy restoring (MOM6 `RESTOREBUOY`) !! parameters and set the `has_restore_T` / `has_restore_S` gates. !! Sibling to `set_surface_flux_const` / `set_sw_penetration` — !! kept separate so existing callers are unchanged. The piston !! velocities arrive in **m/day** (the MOM6 `FLUXCONST_*` unit) and !! are converted to MKS m/s here. Effective-enable guard: !! `has_restore_* = enable_* .and. piston /= 0`, so an enabled !! switch with a zero piston is a silent no-op (rather than !! restoring everything toward the 0-degC / 0-PSU default target). !! Host only; all knobs are read host-side as by-value arguments to !! the device `_impl`, so no extra device sync beyond `copyin(this)`. class(ocean_surface_flux_t), intent(inout) :: this logical, intent(in) :: enable_T, enable_S real(wp), intent(in) :: piston_t_day, piston_s_day real(wp), intent(in) :: T_target, S_target this%restore_piston_T = piston_t_day/SECONDS_PER_DAY this%restore_piston_S = piston_s_day/SECONDS_PER_DAY this%restore_T_target = T_target this%restore_S_target = S_target this%has_restore_T = (enable_T .and. this%restore_piston_T /= 0.0_wp) this%has_restore_S = (enable_S .and. this%restore_piston_S /= 0.0_wp) end subroutine ocean_surfflux_set_restore