eos_t Derived Type

type, public :: eos_t


Inherited by

type~~eos_t~~InheritedByGraph type~eos_t eos_t type~ocean_epbl_t ocean_epbl_t type~ocean_epbl_t->type~eos_t eos type~ocean_kappa_shear_t ocean_kappa_shear_t type~ocean_kappa_shear_t->type~eos_t eos type~ocean_state_t ocean_state_t type~ocean_state_t->type~eos_t eos type~ocean_state_t->type~ocean_epbl_t epbl type~ocean_state_t->type~ocean_kappa_shear_t kshear type~ocean_tidal_mixing_t ocean_tidal_mixing_t type~ocean_state_t->type~ocean_tidal_mixing_t vmix_tidal type~ocean_vmix_t ocean_vmix_t type~ocean_state_t->type~ocean_vmix_t vmix type~ocean_tidal_mixing_t->type~eos_t eos type~ocean_vmix_t->type~eos_t eos type~ocean_engine_t ocean_engine_t type~ocean_engine_t->type~ocean_state_t state type~ocean_handle_t ocean_handle_t type~ocean_handle_t->type~ocean_state_t state type~ocean_handle_t->type~ocean_engine_t engine

Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: S_ref = 35.0_wp

Reference salinity for linear EOS (PSU).

real(kind=wp), public :: T_ref = 10.0_wp

Reference temperature for linear EOS (degC).

real(kind=wp), public :: alpha_T = 1.7e-4_wp

Thermal expansion coeff (linear EOS), kg/m^3 per degC. NOTE: this default is ~1000× smaller than the standard seawater value (~0.17 kg/m³/K). The small value suppresses baroclinic feedback from PPM round-off in tests that don’t care about realistic density gradients. Density-driven tests (e.g. lock_exchange_2layer) MUST override to the realistic value.

real(kind=wp), public :: beta_S = 7.6e-4_wp

Haline contraction coeff (linear EOS), kg/m^3 per PSU. See alpha_T for the rationale on this small default.

logical, public :: is_init = .false.

True between init and destroy. Prefer this to allocated(...) — tracks GPU device attachment too.

real(kind=wp), public :: p_ref = 0.0_wp

Reference pressure (Pa) at which eos_compute_arrays evaluates ms%rho_layer — i.e. the pressure the model’s POTENTIAL density is referenced to. Set from &ocean_eos_nml p_ref (default 0 ⇒ surface/potential density, bit-identical to every run before the knob existed). The Wright and Roquet branches read it; the linear branch has no pressure dependence and ignores it.

It is a SCALAR on purpose and must stay horizontally uniform. rho_layer is differenced ALONG a layer (the Montgomery PGF, the FV-lite / FV-MOM6-PCM integrands) and VERTICALLY (the vmix N² builders); a reference pressure that varied with (i,j) would make two columns of identical water at the same geopotential depth differ by ∂ρ/∂p · Δp_ref and manufacture an along-layer density gradient out of nothing. A surface load therefore belongs in the IN-SITU pressure builders (&ocean_psurf_nml in_eos → multilayer_state_t%p_top), never here.

What raising it DOES buy: the thermobaric state at which the effective α/β are evaluated. Near the freezing point at cavity pressures the sign and magnitude of thermal expansion move appreciably, so a cavity or deep-ocean study is better referenced to a representative depth (2e7 Pa ≈ 2000 dbar) than to the surface — the usual σ₂ choice.

Distinct from &vcoord_nml rho_ref_pressure, which references the RHO / HYCOM target-density COORDINATE and the density-space diagnostic remap. They are independent knobs; for a density-coordinate run they should normally be set to the SAME value, so the coordinate and the dynamics agree on what “density” means (they are deliberately not tied together — a diagnostic remap to σ₂ under a σ₀ dynamics is a legitimate, if unusual, request).

Flat POD: read BY VALUE into eos_compute_arrays’ _impl calls, so a host assignment at configure needs no !$acc update device under mem:separate (same contract as rho0).

real(kind=wp), public :: rho0 = 1035.0_wp

Boussinesq reference density (kg/m^3).

real(kind=wp), public :: tfr_0 = TFR_0_COEFF

Liquidus intercept λ2 (degC). Exactly 0.0 for the default sea-ice set — see eos_freezing_point for the (signed-zero only) bit-identity argument this exactness underwrites.

real(kind=wp), public :: tfr_p = TFR_P_COEFF

Liquidus pressure coefficient λ3 (degC/Pa).

real(kind=wp), public :: tfr_s = TFR_S_COEFF

Liquidus slope λ1 (degC per PSU) — the S coefficient of eos_freezing_point. Selected as a NAMED SET by &ocean_eos_nml tfreeze_set (eos_apply_tfreeze_set), never knob-by-knob: the three numbers are a fitted triple and mixing λ1 from one source with λ2 from another is a silent physics error. Default = the SIS2 sea-ice set ⇒ bit-identical to every run before the knob existed.

integer, public :: ts_convention = TS_POT_PRAC

Tracer T/S convention this EOS expects (TS_POT_PRAC / TS_CONS_ABS). Identity for linear + Wright. This type is a flat POD — NO allocatable component — so it copies into registers for free when passed by value into the device point routines (!$acc routine seq).

integer, public :: variant = EOS_VARIANT_LINEAR

Active EOS variant. Defaults to linear two-tracer (the simplest implemented branch). Wright (1997) rational EOS is also shipped — opt in by setting variant = EOS_VARIANT_WRIGHT_97. TEOS-10 reserved.


Type-Bound Procedures

procedure, public, non_overridable :: destroy => eos_destroy

  • private subroutine eos_destroy(this)

    Arguments

    Type IntentOptional Attributes Name
    class(eos_t), intent(inout) :: this

procedure, public, non_overridable :: init => eos_init

  • private subroutine eos_init(this, grid)

    Arguments

    Type IntentOptional Attributes Name
    class(eos_t), intent(inout) :: this
    type(hgrid_t), intent(in) :: grid

Source Code

   type :: eos_t
      logical :: is_init = .false.
         !! True between `init` and `destroy`.  Prefer this to
         !! `allocated(...)` — tracks GPU device attachment too.
      integer  :: variant = EOS_VARIANT_LINEAR
         !! Active EOS variant.  Defaults to linear two-tracer
         !! (the simplest implemented branch).  Wright (1997)
         !! rational EOS is also shipped — opt in by setting
         !! `variant = EOS_VARIANT_WRIGHT_97`.  TEOS-10 reserved.
      real(wp) :: rho0 = 1035.0_wp
         !! Boussinesq reference density (kg/m^3).
      real(wp) :: T_ref = 10.0_wp
         !! Reference temperature for linear EOS (degC).
      real(wp) :: S_ref = 35.0_wp
         !! Reference salinity for linear EOS (PSU).
      real(wp) :: alpha_T = 1.7e-4_wp
         !! Thermal expansion coeff (linear EOS), kg/m^3 per degC.
         !! NOTE: this default is ~1000× smaller than the standard
         !! seawater value (~0.17 kg/m³/K).  The small value
         !! suppresses baroclinic feedback from PPM round-off in
         !! tests that don't care about realistic density gradients.
         !! Density-driven tests (e.g. `lock_exchange_2layer`) MUST
         !! override to the realistic value.
      real(wp) :: beta_S = 7.6e-4_wp
         !! Haline contraction coeff (linear EOS), kg/m^3 per PSU.
         !! See `alpha_T` for the rationale on this small default.
      real(wp) :: p_ref = 0.0_wp
         !! Reference pressure (Pa) at which `eos_compute_arrays` evaluates
         !! `ms%rho_layer` — i.e. the pressure the model's POTENTIAL
         !! density is referenced to.  Set from `&ocean_eos_nml p_ref`
         !! (default 0 ⇒ surface/potential density, bit-identical to every
         !! run before the knob existed).  The Wright and Roquet branches
         !! read it; the linear branch has no pressure dependence and
         !! ignores it.
         !!
         !! **It is a SCALAR on purpose and must stay horizontally
         !! uniform.** `rho_layer` is differenced ALONG a layer (the
         !! Montgomery PGF, the FV-lite / FV-MOM6-PCM integrands) and
         !! VERTICALLY (the vmix N² builders); a reference pressure that
         !! varied with `(i,j)` would make two columns of identical water
         !! at the same geopotential depth differ by `∂ρ/∂p · Δp_ref` and
         !! manufacture an along-layer density gradient out of nothing.
         !! A surface load therefore belongs in the IN-SITU pressure
         !! builders (`&ocean_psurf_nml in_eos` →
         !! `multilayer_state_t%p_top`), never here.
         !!
         !! What raising it DOES buy: the thermobaric state at which the
         !! effective α/β are evaluated.  Near the freezing point at
         !! cavity pressures the sign and magnitude of thermal expansion
         !! move appreciably, so a cavity or deep-ocean study is better
         !! referenced to a representative depth (2e7 Pa ≈ 2000 dbar) than
         !! to the surface — the usual σ₂ choice.
         !!
         !! Distinct from `&vcoord_nml rho_ref_pressure`, which references
         !! the RHO / HYCOM target-density COORDINATE and the density-space
         !! diagnostic remap.  They are independent knobs; for a
         !! density-coordinate run they should normally be set to the SAME
         !! value, so the coordinate and the dynamics agree on what
         !! "density" means (they are deliberately not tied together —
         !! a diagnostic remap to σ₂ under a σ₀ dynamics is a legitimate,
         !! if unusual, request).
         !!
         !! Flat POD: read BY VALUE into `eos_compute_arrays`' `_impl`
         !! calls, so a host assignment at configure needs no
         !! `!$acc update device` under `mem:separate` (same contract as
         !! `rho0`).
      real(wp) :: tfr_s = TFR_S_COEFF
         !! Liquidus slope λ1 (degC per PSU) — the `S` coefficient of
         !! `eos_freezing_point`.  Selected as a NAMED SET by
         !! `&ocean_eos_nml tfreeze_set` (`eos_apply_tfreeze_set`), never
         !! knob-by-knob: the three numbers are a fitted triple and
         !! mixing λ1 from one source with λ2 from another is a silent
         !! physics error.  Default = the SIS2 sea-ice set ⇒ bit-identical
         !! to every run before the knob existed.
      real(wp) :: tfr_0 = TFR_0_COEFF
         !! Liquidus intercept λ2 (degC).  Exactly `0.0` for the default
         !! sea-ice set — see `eos_freezing_point` for the (signed-zero
         !! only) bit-identity argument this exactness underwrites.
      real(wp) :: tfr_p = TFR_P_COEFF
         !! Liquidus pressure coefficient λ3 (degC/Pa).
      integer :: ts_convention = TS_POT_PRAC
         !! Tracer T/S convention this EOS expects (TS_POT_PRAC /
         !! TS_CONS_ABS).  Identity for linear + Wright.  This type is
         !! a flat POD — NO allocatable component — so it copies into
         !! registers for free when passed by value into the device
         !! point routines (`!$acc routine seq`).
   contains
      procedure, non_overridable :: init => eos_init
      procedure, non_overridable :: destroy => eos_destroy
   end type eos_t