ocean_surfflux_set_restore Subroutine

private 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).

Type Bound

ocean_surface_flux_t

Arguments

Type IntentOptional 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

Called by

proc~~ocean_surfflux_set_restore~~CalledByGraph proc~ocean_surfflux_set_restore ocean_surface_flux_t%ocean_surfflux_set_restore proc~engine_setup engine_setup proc~engine_setup->proc~ocean_surfflux_set_restore proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Source Code

   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