eos_apply_tfreeze_set Subroutine

public pure subroutine eos_apply_tfreeze_set(eos, code)

Write the named liquidus coefficient SET onto the EOS handle. Called once, at configure time, from the earliest configure_ocean_* stage — before the flat-POD handle is copied onto the vmix / EPBL / kappa-shear / tidal-mixing slots and before ocean_state_enter_data, so every copy and every device kernel taking eos_t by value sees the configured set (same contract as rho0 / p_ref; no !$acc update device is owed).

TFREEZE_SET_INVALID leaves the handle UNTOUCHED — the abort belongs to validate_config, which owns the fail-loud message; this routine is pure and cannot speak.

Arguments

Type IntentOptional Attributes Name
type(eos_t), intent(inout) :: eos
integer, intent(in) :: code

Called by

proc~~eos_apply_tfreeze_set~~CalledByGraph proc~eos_apply_tfreeze_set eos_apply_tfreeze_set proc~configure_ocean_drag configure_ocean_drag proc~configure_ocean_drag->proc~eos_apply_tfreeze_set proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_drag 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

   pure subroutine eos_apply_tfreeze_set(eos, code)
      !! Write the named liquidus coefficient SET onto the EOS handle.
      !! Called once, at configure time, from the earliest
      !! `configure_ocean_*` stage — before the flat-POD handle is copied
      !! onto the vmix / EPBL / kappa-shear / tidal-mixing slots and
      !! before `ocean_state_enter_data`, so every copy and every device
      !! kernel taking `eos_t` by value sees the configured set (same
      !! contract as `rho0` / `p_ref`; no `!$acc update device` is owed).
      !!
      !! `TFREEZE_SET_INVALID` leaves the handle UNTOUCHED — the abort
      !! belongs to `validate_config`, which owns the fail-loud message;
      !! this routine is `pure` and cannot speak.
      type(eos_t), intent(inout) :: eos
      integer, intent(in) :: code

      select case (code)
      case (TFREEZE_SET_ISOMIP)
         eos%tfr_s = TFR_ISOMIP_S_COEFF
         eos%tfr_0 = TFR_ISOMIP_0_COEFF
         eos%tfr_p = TFR_ISOMIP_P_COEFF
      case (TFREEZE_SET_SEAICE)
         eos%tfr_s = TFR_S_COEFF
         eos%tfr_0 = TFR_0_COEFF
         eos%tfr_p = TFR_P_COEFF
      case default
         ! TFREEZE_SET_INVALID (and anything else): leave the handle at
         ! whatever it already carries — the default sea-ice set unless a
         ! caller has already applied one.  `validate_config` owns the
         ! fail-loud; this routine is `pure` and cannot report.
      end select
   end subroutine eos_apply_tfreeze_set