eos_density_derivs Subroutine

public pure elemental subroutine eos_density_derivs(eos, T, S, p, drho_dt, drho_ds)

Density sensitivities ∂ρ/∂T and ∂ρ/∂S of the ACTIVE equation of state at a point — the signed twin of eos_buoyancy_coeffs, which is where the per-variant closed forms live:

∂ρ/∂T = −alpha_T (kg/m³ per degC; < 0 in the usual regime) ∂ρ/∂S = +beta_S (kg/m³ per PSU; > 0)

Negation is exact in IEEE-754, so this is the same number with the opposite sign bit — never a second evaluation of the EOS. Prefer this spelling where the consumer wants a density GRADIENT (∇ρ = ∂ρ/∂T·∇T + ∂ρ/∂S·∇S) and eos_buoyancy_coeffs where it wants the (α, β) pair in the eos_t member convention.

eos_specvol_derivs remains the right entry point for a consumer that genuinely works in SPECIFIC VOLUME (EPBL’s PE weights, kappa-shear’s dbuoy = g·ρ₀·dSV/dX); this routine is the density form, not a duplicate of it.

Arguments

Type IntentOptional Attributes Name
type(eos_t), intent(in) :: eos
real(kind=wp), intent(in) :: T
real(kind=wp), intent(in) :: S
real(kind=wp), intent(in) :: p
real(kind=wp), intent(out) :: drho_dt

∂ρ/∂T (kg/m³ per degC).

real(kind=wp), intent(out) :: drho_ds

∂ρ/∂S (kg/m³ per PSU).


Calls

proc~~eos_density_derivs~~CallsGraph proc~eos_density_derivs eos_density_derivs proc~eos_buoyancy_coeffs eos_buoyancy_coeffs proc~eos_density_derivs->proc~eos_buoyancy_coeffs proc~roquet_spv_point roquet_spv_point proc~eos_buoyancy_coeffs->proc~roquet_spv_point

Called by

proc~~eos_density_derivs~~CalledByGraph proc~eos_density_derivs eos_density_derivs proc~bbl_faces_impl bbl_faces_impl proc~bbl_faces_impl->proc~eos_density_derivs proc~vdiff_set_viscous_bbl vdiff_set_viscous_bbl proc~vdiff_set_viscous_bbl->proc~bbl_faces_impl proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~vdiff_set_viscous_bbl proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~vdiff_set_viscous_bbl 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

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: alpha_T
real(kind=wp), private :: beta_S

Source Code

   pure elemental subroutine eos_density_derivs(eos, T, S, p, drho_dt, drho_ds)
      !! Density sensitivities `∂ρ/∂T` and `∂ρ/∂S` of the ACTIVE equation
      !! of state at a point — the signed twin of `eos_buoyancy_coeffs`,
      !! which is where the per-variant closed forms live:
      !!
      !!   ∂ρ/∂T = −alpha_T   (kg/m³ per degC; < 0 in the usual regime)
      !!   ∂ρ/∂S = +beta_S    (kg/m³ per PSU;  > 0)
      !!
      !! Negation is exact in IEEE-754, so this is the same number with
      !! the opposite sign bit — never a second evaluation of the EOS.
      !! Prefer this spelling where the consumer wants a density GRADIENT
      !! (`∇ρ = ∂ρ/∂T·∇T + ∂ρ/∂S·∇S`) and `eos_buoyancy_coeffs` where it
      !! wants the (α, β) pair in the `eos_t` member convention.
      !!
      !! `eos_specvol_derivs` remains the right entry point for a consumer
      !! that genuinely works in SPECIFIC VOLUME (EPBL's PE weights,
      !! kappa-shear's `dbuoy = g·ρ₀·dSV/dX`); this routine is the density
      !! form, not a duplicate of it.
      !$acc routine seq
      type(eos_t), intent(in) :: eos
      real(wp), intent(in) :: T, S
      real(wp), intent(in) :: p
      real(wp), intent(out) :: drho_dt
         !! ∂ρ/∂T (kg/m³ per degC).
      real(wp), intent(out) :: drho_ds
         !! ∂ρ/∂S (kg/m³ per PSU).

      real(wp) :: alpha_T, beta_S

      call eos_buoyancy_coeffs(eos, T, S, p, alpha_T, beta_S)
      drho_dt = -alpha_T
      drho_ds = beta_S
   end subroutine eos_density_derivs