MOM_EOS_linear module reference

A simple linear equation of state for sea water with constant coefficients

Data Types

linear_EOS

The EOS_base implementation of a linear equation of state

Functions/Subroutines

density_elem_linear

Density computed as a linear function of T and S [kg m-3]

density_anomaly_elem_linear

Density anomaly computed as a linear function of T and S [kg m-3]

spec_vol_elem_linear

Specific volume using a linear equation of state for density [m3 kg-1]

spec_vol_anomaly_elem_linear

Specific volume anomaly using a linear equation of state for density [m3 kg-1]

calculate_density_derivs_elem_linear

This subroutine calculates the partial derivatives of density with potential temperature and salinity.

calculate_density_second_derivs_elem_linear

This subroutine calculates the five, partial second derivatives of density w.r.t. potential temperature and salinity and pressure which for a linear equation of state should all be 0.

calculate_specvol_derivs_elem_linear

Calculate the derivatives of specific volume with temperature and salinity

calculate_compress_elem_linear

This subroutine computes the in situ density of sea water (rho) and the compressibility (drho/dp == C_sound^-2) at the given salinity, potential temperature, and pressure.

avg_spec_vol_linear

Calculates the layer average specific volumes. The analytical solution is SpV_avg = 1 / (drho_dp*dp) * ln[(1+eps)/(1-eps)] and the expression here is the first five terms of its Taylor series with a trunction error of O(eps**10). |eps|<0.02 for real ocean parameters.

EoS_fit_range_linear

Return the range of temperatures, salinities and pressures permitted for linear equation of state. Care should be taken when applying this equation of state outside of its fit range.

set_params_linear

Set coefficients for the linear equation of state

int_density_dz_linear

This subroutine calculates analytical and nearly-analytical integrals of pressure anomalies across layers, which are required for calculating the finite-volume form pressure accelerations in a Boussinesq model.

int_spec_vol_dp_linear

Calculates analytical and nearly-analytical integrals in pressure across layers of geopotential anomalies, which are required for calculating the finite-volume form pressure accelerations in a non-Boussinesq model. Specific volume is assumed to vary linearly between adjacent points.

calculate_density_array_linear

Calculate the in-situ density for 1D arraya inputs and outputs.

calculate_spec_vol_array_linear

Calculate the in-situ specific volume for 1D array inputs and outputs.

Type Documentation

type, extends(EOS_base) :: linear_EOS

The EOS_base implementation of a linear equation of state

Parameters
  • Rho_T0_S0

    The density at T=0, S=0 and p=0 [kg m-3].

  • dRho_dT

    The derivative of density with temperature [kg m-3 degC-1].

  • dRho_dS

    The derivative of density with salinity [kg m-3 ppt-1].

  • dRho_dp

    The derivative of density with pressure [s2 m-2].

Functions/Subroutine Documentation

real elemental function density_elem_linear(this, T, S, pressure)

Density computed as a linear function of T and S [kg m-3]

This is an elemental function that can be applied to any combination of scalar and array inputs.

Parameters
  • this [in]

    This EOS

  • T [in]

    Potential temperature relative to the surface [degC]

  • S [in]

    Salinity [ppt]

  • pressure [in]

    Pressure [Pa]

Callers call graph
Callers of mom_eos_linear::density_elem_linear calls cluster_mom_eos_linear MOM_EOS_linear mom_eos_linear::calculate_density_array_linear calculate_density_array_linear [private/internal] mom_eos_linear::density_elem_linear density_elem_linear [private/internal] mom_eos_linear::calculate_density_array_linear->mom_eos_linear::density_elem_linear
Text view
real elemental function density_anomaly_elem_linear(this, T, S, pressure, rho_ref)

Density anomaly computed as a linear function of T and S [kg m-3]

This is an elemental function that can be applied to any combination of scalar and array inputs.

Parameters
  • this [in]

    This EOS

  • T [in]

    Potential temperature relative to the surface [degC]

  • S [in]

    Salinity [ppt]

  • pressure [in]

    Pressure [Pa]

  • rho_ref [in]

    A reference density [kg m-3]

Callers call graph
Callers of mom_eos_linear::density_anomaly_elem_linear calls cluster_mom_eos_linear MOM_EOS_linear mom_eos_linear::calculate_density_array_linear calculate_density_array_linear [private/internal] mom_eos_linear::density_anomaly_elem_linear density_anomaly_elem_linear [private/internal] mom_eos_linear::calculate_density_array_linear->mom_eos_linear::density_anomaly_elem_linear
Text view
real elemental function spec_vol_elem_linear(this, T, S, pressure)

Specific volume using a linear equation of state for density [m3 kg-1]

This is an elemental function that can be applied to any combination of scalar and array inputs.

Parameters
  • this [in]

    This EOS

  • T [in]

    Potential temperature relative to the surface [degC].

  • S [in]

    Salinity [ppt].

  • pressure [in]

    Pressure [Pa].

Callers call graph
Callers of mom_eos_linear::spec_vol_elem_linear calls cluster_mom_eos_linear MOM_EOS_linear mom_eos_linear::calculate_spec_vol_array_linear calculate_spec_vol_array_linear [private/internal] mom_eos_linear::spec_vol_elem_linear spec_vol_elem_linear [private/internal] mom_eos_linear::calculate_spec_vol_array_linear->mom_eos_linear::spec_vol_elem_linear
Text view
real elemental function spec_vol_anomaly_elem_linear(this, T, S, pressure, spv_ref)

Specific volume anomaly using a linear equation of state for density [m3 kg-1]

This is an elemental function that can be applied to any combination of scalar and array inputs.

Parameters
  • this [in]

    This EOS

  • T [in]

    Potential temperature relative to the surface [degC].

  • S [in]

    Salinity [ppt].

  • pressure [in]

    Pressure [Pa].

  • spv_ref [in]

    A reference specific volume [m3 kg-1].

Callers call graph
Callers of mom_eos_linear::spec_vol_anomaly_elem_linear calls cluster_mom_eos_linear MOM_EOS_linear mom_eos_linear::calculate_spec_vol_array_linear calculate_spec_vol_array_linear [private/internal] mom_eos_linear::spec_vol_anomaly_elem_linear spec_vol_anomaly_elem_linear [private/internal] mom_eos_linear::calculate_spec_vol_array_linear->mom_eos_linear::spec_vol_anomaly_elem_linear
Text view
elemental subroutine calculate_density_derivs_elem_linear(this, T, S, pressure, dRho_dT, dRho_dS)

This subroutine calculates the partial derivatives of density with potential temperature and salinity.

Parameters
  • this [in]

    This EOS

  • T [in]

    Potential temperature relative to the surface [degC].

  • S [in]

    Salinity [ppt].

  • pressure [in]

    Pressure [Pa].

  • drho_dT [out]

    The partial derivative of density with potential temperature [kg m-3 degC-1].

  • drho_dS [out]

    The partial derivative of density with salinity [kg m-3 ppt-1].

elemental subroutine calculate_density_second_derivs_elem_linear(this, T, S, pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT, drho_dS_dP, drho_dT_dP)

This subroutine calculates the five, partial second derivatives of density w.r.t. potential temperature and salinity and pressure which for a linear equation of state should all be 0.

Parameters
  • this [in]

    This EOS

  • T [in]

    Potential temperature relative to the surface [degC].

  • S [in]

    Salinity [ppt].

  • pressure [in]

    pressure [Pa].

  • drho_dS_dS [inout]

    The second derivative of density with salinity [kg m-3 ppt-2].

  • drho_dS_dT [inout]

    The second derivative of density with temperature and salinity [kg m-3 ppt-1 degC-1].

  • drho_dT_dT [inout]

    The second derivative of density with temperature [kg m-3 degC-2].

  • drho_dS_dP [inout]

    The second derivative of density with salinity and pressure [kg m-3 ppt-1 Pa-1].

  • drho_dT_dP [inout]

    The second derivative of density with temperature and pressure [kg m-3 degC-1 Pa-1].

elemental subroutine calculate_specvol_derivs_elem_linear(this, T, S, pressure, dSV_dT, dSV_dS)

Calculate the derivatives of specific volume with temperature and salinity

Parameters
  • this [in]

    This EOS

  • T [in]

    Potential temperature [degC]

  • S [in]

    Salinity [ppt]

  • pressure [in]

    pressure [Pa]

  • dSV_dS [inout]

    The partial derivative of specific volume with salinity [m3 kg-1 ppt-1]

  • dSV_dT [inout]

    The partial derivative of specific volume with potential temperature [m3 kg-1 degC-1]

elemental subroutine calculate_compress_elem_linear(this, T, S, pressure, rho, drho_dp)

This subroutine computes the in situ density of sea water (rho) and the compressibility (drho/dp == C_sound^-2) at the given salinity, potential temperature, and pressure.

Parameters
  • this [in]

    This EOS

  • T [in]

    Potential temperature relative to the surface [degC].

  • S [in]

    Salinity [ppt].

  • pressure [in]

    pressure [Pa].

  • rho [out]

    In situ density [kg m-3].

  • drho_dp [out]

    The partial derivative of density with pressure (also the inverse of the square of sound speed) [s2 m-2].

subroutine avg_spec_vol_linear(T, S, p_t, dp, SpV_avg, start, npts, Rho_T0_S0, dRho_dT, dRho_dS, dRho_dp)

Calculates the layer average specific volumes. The analytical solution is SpV_avg = 1 / (drho_dp*dp) * ln[(1+eps)/(1-eps)] and the expression here is the first five terms of its Taylor series with a trunction error of O(eps**10). |eps|<0.02 for real ocean parameters.

Parameters
  • T [in]

    Potential temperature [degC]

  • S [in]

    Salinity [ppt]

  • p_t [in]

    Pressure at the top of the layer [Pa]

  • dp [in]

    Pressure change in the layer [Pa]

  • SpV_avg [inout]

    The vertical average specific volume in the layer [m3 kg-1]

  • start [in]

    the starting point in the arrays.

  • npts [in]

    the number of values to calculate.

  • Rho_T0_S0 [in]

    The density at T=0, S=0 [kg m-3]

  • dRho_dT [in]

    The derivative of density with temperature [kg m-3 degC-1]

  • dRho_dS [in]

    The derivative of density with salinity [kg m-3 ppt-1]

  • dRho_dp [in]

    The derivative of density with pressure [s2 m-2]

Callers call graph
Callers of mom_eos_linear::avg_spec_vol_linear calls cluster_mom_eos MOM_EOS cluster_mom_eos_linear MOM_EOS_linear mom_eos::average_specific_vol average_specific_vol mom_eos_linear::avg_spec_vol_linear avg_spec_vol_linear mom_eos::average_specific_vol->mom_eos_linear::avg_spec_vol_linear
Text view
subroutine EoS_fit_range_linear(this, T_min, T_max, S_min, S_max, p_min, p_max)

Return the range of temperatures, salinities and pressures permitted for linear equation of state. Care should be taken when applying this equation of state outside of its fit range.

Parameters
  • this [in]

    This EOS

  • T_min [out]

    The minimum potential temperature over which this EoS is fitted [degC]

  • T_max [out]

    The maximum potential temperature over which this EoS is fitted [degC]

  • S_min [out]

    The minimum salinity over which this EoS is fitted [ppt]

  • S_max [out]

    The maximum salinity over which this EoS is fitted [ppt]

  • p_min [out]

    The minimum pressure over which this EoS is fitted [Pa]

  • p_max [out]

    The maximum pressure over which this EoS is fitted [Pa]

subroutine set_params_linear(this, Rho_T0_S0, dRho_dT, dRho_dS, dRho_dp)

Set coefficients for the linear equation of state

Parameters
  • this [inout]

    This EOS

  • Rho_T0_S0 [in]

    The density at T=0, S=0 [kg m-3]

  • dRho_dT [in]

    The derivative of density with temperature, [kg m-3 degC-1]

  • dRho_dS [in]

    The derivative of density with salinity, in [kg m-3 ppt-1]

  • dRho_dp [in]

    The derivative of density with pressure, in [s2 m-2]

subroutine int_density_dz_linear(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, Rho_T0_S0, dRho_dT, dRho_dS, dRho_dp, dpa, intz_dpa, intx_dpa, inty_dpa, bathyT, SSH, dz_neglect, MassWghtInterp, Z_0p)

This subroutine calculates analytical and nearly-analytical integrals of pressure anomalies across layers, which are required for calculating the finite-volume form pressure accelerations in a Boussinesq model.

Parameters
  • HI [in]

    The horizontal index type for the arrays.

  • T [in]

    Potential temperature relative to the surface [C ~> degC].

  • S [in]

    Salinity [S ~> ppt].

  • z_t [in]

    Height at the top of the layer in depth units [Z ~> m].

  • z_b [in]

    Height at the top of the layer [Z ~> m].

  • rho_ref [in]

    A mean density [R ~> kg m-3], that is subtracted out to reduce the magnitude of each of the integrals.

  • rho_0 [in]

    A density [R ~> kg m-3], used to calculate the pressure (as p~=-z*rho_0*G_e) used in the equation of state.

  • G_e [in]

    The Earth's gravitational acceleration [L2 Z-1 T-2 ~> m s-2]

  • Rho_T0_S0 [in]

    The density at T=0, S=0 [R ~> kg m-3]

  • dRho_dT [in]

    The derivative of density with temperature, [R C-1 ~> kg m-3 degC-1]

  • dRho_dS [in]

    The derivative of density with salinity, in [R S-1 ~> kg m-3 ppt-1]

  • dRho_dp [in]

    The derivative of density with pressure, in [L-2 T2 ~> m-2 s2]

  • dpa [out]

    The change in the pressure anomaly across the layer [R L2 T-2 ~> Pa]

  • intz_dpa [out]

    The integral through the thickness of the layer of the pressure anomaly relative to the anomaly at the top of the layer [R L2 Z T-2 ~> Pa m]

  • intx_dpa [out]

    The integral in x of the difference between the pressure anomaly at the top and bottom of the layer divided by the x grid spacing [R L2 T-2 ~> Pa]

  • inty_dpa [out]

    The integral in y of the difference between the pressure anomaly at the top and bottom of the layer divided by the y grid spacing [R L2 T-2 ~> Pa]

  • bathyT [in]

    The depth of the bathymetry [Z ~> m].

  • SSH [in]

    The sea surface height [Z ~> m]

  • dz_neglect [in]

    A miniscule thickness change [Z ~> m].

  • MassWghtInterp [in]

    A flag indicating whether and how to use mass weighting to interpolate T/S in integrals

  • Z_0p [in]

    The height at which the pressure is 0 [Z ~> m]

Callers call graph
Callers of mom_eos_linear::int_density_dz_linear calls cluster_mom_eos MOM_EOS cluster_mom_eos_linear MOM_EOS_linear mom_eos::analytic_int_density_dz analytic_int_density_dz mom_eos_linear::int_density_dz_linear int_density_dz_linear mom_eos::analytic_int_density_dz->mom_eos_linear::int_density_dz_linear
Text view
subroutine int_spec_vol_dp_linear(T, S, p_t, p_b, alpha_ref, HI, Rho_T0_S0, dRho_dT, dRho_dS, dRho_dp, dza, intp_dza, intx_dza, inty_dza, halo_size, bathyP, P_surf, dP_neglect, MassWghtInterp)

Calculates analytical and nearly-analytical integrals in pressure across layers of geopotential anomalies, which are required for calculating the finite-volume form pressure accelerations in a non-Boussinesq model. Specific volume is assumed to vary linearly between adjacent points.

Parameters
  • HI [in]

    The ocean's horizontal index type.

  • T [in]

    Potential temperature relative to the surface [C ~> degC].

  • S [in]

    Salinity [S ~> ppt].

  • p_t [in]

    Pressure at the top of the layer [R L2 T-2 ~> Pa]

  • p_b [in]

    Pressure at the top of the layer [R L2 T-2 ~> Pa]

  • alpha_ref [in]

    A mean specific volume that is subtracted out to reduce the magnitude of each of the integrals [R-1 ~> m3 kg-1]. The calculation is mathematically identical with different values of alpha_ref, but this reduces the effects of roundoff.

  • Rho_T0_S0 [in]

    The density at T=0, S=0 [R ~> kg m-3]

  • dRho_dT [in]

    The derivative of density with temperature [R C-1 ~> kg m-3 degC-1]

  • dRho_dS [in]

    The derivative of density with salinity, in [R S-1 ~> kg m-3 ppt-1]

  • dRho_dp [in]

    The derivative of density with pressure, in [L-2 T2 ~> m-2 s2]

  • dza [out]

    The change in the geopotential anomaly across the layer [L2 T-2 ~> m2 s-2]

  • intp_dza [out]

    The integral in pressure through the layer of the geopotential anomaly relative to the anomaly at the bottom of the layer [R L4 T-4 ~> Pa m2 s-2]

  • intx_dza [out]

    The integral in x of the difference between the geopotential anomaly at the top and bottom of the layer divided by the x grid spacing [L2 T-2 ~> m2 s-2]

  • inty_dza [out]

    The integral in y of the difference between the geopotential anomaly at the top and bottom of the layer divided by the y grid spacing [L2 T-2 ~> m2 s-2]

  • halo_size [in]

    The width of halo points on which to calculate dza.

  • bathyP [in]

    The pressure at the bathymetry [R L2 T-2 ~> Pa]

  • P_surf [in]

    The pressure at the ocean surface [R L2 T-2 ~> Pa]

  • dP_neglect [in]

    A miniscule pressure change with the same units as p_t [R L2 T-2 ~> Pa]

  • MassWghtInterp [in]

    A flag indicating whether and how to use mass weighting to interpolate T/S in integrals

Callers call graph
Callers of mom_eos_linear::int_spec_vol_dp_linear calls cluster_mom_eos MOM_EOS cluster_mom_eos_linear MOM_EOS_linear mom_eos::analytic_int_specific_vol_dp analytic_int_specific_vol_dp mom_eos_linear::int_spec_vol_dp_linear int_spec_vol_dp_linear mom_eos::analytic_int_specific_vol_dp->mom_eos_linear::int_spec_vol_dp_linear
Text view
subroutine calculate_density_array_linear(this, T, S, pressure, rho, start, npts, rho_ref)

Calculate the in-situ density for 1D arraya inputs and outputs.

Parameters
  • this [in]

    This EOS

  • T [in]

    Potential temperature relative to the surface [degC]

  • S [in]

    Salinity [ppt]

  • pressure [in]

    Pressure [Pa]

  • rho [out]

    In situ density [kg m-3]

  • start [in]

    The starting index for calculations

  • npts [in]

    The number of values to calculate

  • rho_ref [in]

    A reference density [kg m-3]

Callees call graph
Callees of mom_eos_linear::calculate_density_array_linear calls cluster_mom_eos_linear MOM_EOS_linear mom_eos_linear::calculate_density_array_linear calculate_density_array_linear [private/internal] mom_eos_linear::density_anomaly_elem_linear density_anomaly_elem_linear [private/internal] mom_eos_linear::calculate_density_array_linear->mom_eos_linear::density_anomaly_elem_linear mom_eos_linear::density_elem_linear density_elem_linear [private/internal] mom_eos_linear::calculate_density_array_linear->mom_eos_linear::density_elem_linear
Text view
subroutine calculate_spec_vol_array_linear(this, T, S, pressure, specvol, start, npts, spv_ref)

Calculate the in-situ specific volume for 1D array inputs and outputs.

Parameters
  • this [in]

    This EOS

  • T [in]

    Potential temperature relative to the surface [degC]

  • S [in]

    Salinity [ppt]

  • pressure [in]

    Pressure [Pa]

  • specvol [out]

    In situ specific volume [m3 kg-1]

  • start [in]

    The starting index for calculations

  • npts [in]

    The number of values to calculate

  • spv_ref [in]

    A reference specific volume [m3 kg-1]

Callees call graph
Callees of mom_eos_linear::calculate_spec_vol_array_linear calls cluster_mom_eos_linear MOM_EOS_linear mom_eos_linear::calculate_spec_vol_array_linear calculate_spec_vol_array_linear [private/internal] mom_eos_linear::spec_vol_anomaly_elem_linear spec_vol_anomaly_elem_linear [private/internal] mom_eos_linear::calculate_spec_vol_array_linear->mom_eos_linear::spec_vol_anomaly_elem_linear mom_eos_linear::spec_vol_elem_linear spec_vol_elem_linear [private/internal] mom_eos_linear::calculate_spec_vol_array_linear->mom_eos_linear::spec_vol_elem_linear
Text view
API generated with Flint · Rendered from reStructuredText