mom_eos module reference

Provides subroutines for quantities specific to the equation of state.

More…

Data Types

eos_type

A control structure for the equation of state.

Functions/Subroutines

calculate_density_scalar()

Calls the appropriate subroutine to calculate density of sea water for scalar inputs.

calculate_stanley_density_scalar()

Calls the appropriate subroutine to calculate density of sea water for scalar inputs including the variance of T, S and covariance of T-S.

calculate_density_array()

Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs.

calculate_stanley_density_array()

Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs including the variance of T, S and covariance of T-S.

calculate_density_1d()

Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs, potentially limiting the domain of indices that are worked on.

calculate_stanley_density_1d()

Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs including the variance of T, S and covariance of T-S, potentially limiting the domain of indices that are worked on.

calculate_spec_vol_array()

Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs.

calc_spec_vol_scalar()

Calls the appropriate subroutine to calculate specific volume of sea water for scalar inputs.

calc_spec_vol_1d()

Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs, potentially limiting the domain of indices that are worked on.

calculate_tfreeze_scalar()

Calls the appropriate subroutine to calculate the freezing point for scalar inputs.

calculate_tfreeze_array()

Calls the appropriate subroutine to calculate the freezing point for a 1-D array.

calculate_density_derivs_array()

Calls the appropriate subroutine to calculate density derivatives for 1-D array inputs.

calculate_density_derivs_1d()

Calls the appropriate subroutine to calculate density derivatives for 1-D array inputs.

calculate_density_derivs_scalar()

Calls the appropriate subroutines to calculate density derivatives by promoting a scalar to a one-element array.

calculate_density_second_derivs_array()

Calls the appropriate subroutine to calculate density second derivatives for 1-D array inputs.

calculate_density_second_derivs_scalar()

Calls the appropriate subroutine to calculate density second derivatives for scalar nputs.

calculate_spec_vol_derivs_array()

Calls the appropriate subroutine to calculate specific volume derivatives for an array.

calc_spec_vol_derivs_1d()

Calls the appropriate subroutine to calculate specific volume derivatives for 1-d array inputs, potentially limiting the domain of indices that are worked on.

calculate_compress_array()

Calls the appropriate subroutine to calculate the density and compressibility for 1-D array inputs.

calculate_compress_scalar()

Calculate density and compressibility for a scalar.

eos_domain()

This subroutine returns a two point integer array indicating the domain of i-indices to work on in EOS calls based on information from a hor_index type.

analytic_int_specific_vol_dp()

Calls the appropriate subroutine to calculate 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.

analytic_int_density_dz()

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.

query_compressible()

Returns true if the equation of state is compressible (i.e.

eos_init()

Initializes EOS_type by allocating and reading parameters.

eos_manual_init()

Manually initialized an EOS type (intended for unit testing of routines which need a specific EOS)

eos_allocate()

Allocates EOS_type.

eos_end()

Deallocates EOS_type.

eos_use_linear()

Set equation of state structure (EOS) to linear with given coefficients.

convert_temp_salt_for_teos10()

Convert T&S to Absolute Salinity and Conservative Temperature if using TEOS10.

eos_quadrature()

Return value of EOS_quadrature.

extract_member_eos()

Extractor routine for the EOS type if the members need to be accessed outside this module.

Detailed Description

The MOM_EOS module is a wrapper for various equations of state (e.g. Linear, Wright, UNESCO) and provides a uniform interface to the rest of the model independent of which equation of state is being used.

Type Documentation

type mom_eos/eos_type

A control structure for the equation of state.

Type fields
  • % form_of_eos [integer] :: The equation of state to use.

  • % form_of_tfreeze [integer] :: The expression for the potential temperature of the freezing point.

  • % eos_quadrature [logical] :: If true, always use the generic (quadrature) code for the integrals of density.

  • % compressible [logical] :: If true, in situ density is a function of pressure.

  • % rho_t0_s0 [real] :: The density at T=0, S=0 [kg m-3].

  • % drho_dt [real] :: The partial derivative of density with temperature [kg m-3 degC-1].

  • % drho_ds [real] :: The partial derivative of density with salinity [kg m-3 ppt-1].

  • % tfr_s0_p0 [real] :: The freezing potential temperature at S=0, P=0 [degC].

  • % dtfr_ds [real] :: The derivative of freezing point with salinity [degC ppt-1].

  • % dtfr_dp [real] :: The derivative of freezing point with pressure [degC Pa-1].

  • % m_to_z [real] :: A constant that translates distances in meters to the units of depth.

  • % kg_m3_to_r [real] :: A constant that translates kilograms per meter cubed to the units of density.

  • % r_to_kg_m3 [real] :: A constant that translates the units of density to kilograms per meter cubed.

  • % rl2_t2_to_pa [real] :: Convert pressures from R L2 T-2 to Pa.

  • % l_t_to_m_s [real] :: Convert lateral velocities from L T-1 to m s-1.

Function/Subroutine Documentation

subroutine mom_eos/calculate_density_scalar(T, S, pressure, rho, EOS, rho_ref, scale)

Calls the appropriate subroutine to calculate density of sea water for scalar inputs. If rho_ref is present, the anomaly with respect to rho_ref is returned. The pressure and density can be rescaled with the US. If both the US and scale arguments are present the density scaling uses the product of the two scaling factors.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa] or [R L2 T-2 ~> Pa]

  • rho :: [out] Density (in-situ if pressure is local) [kg m-3] or [R ~> kg m-3]

  • eos :: Equation of state structure

  • rho_ref :: [in] A reference density [kg m-3]

  • scale :: [in] A multiplicative factor by which to scale density in combination with scaling given by US [various]

Call to

eos_linear eos_nemo eos_teos10 eos_unesco eos_wright mom_error_handler::mom_error

subroutine mom_eos/calculate_stanley_density_scalar(T, S, pressure, Tvar, TScov, Svar, rho, EOS, rho_ref, scale)

Calls the appropriate subroutine to calculate density of sea water for scalar inputs including the variance of T, S and covariance of T-S. The calculation uses only the second order correction in a series as discussed in Stanley et al., 2020. If rho_ref is present, the anomaly with respect to rho_ref is returned. The density can be rescaled using rho_ref.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • tvar :: [in] Variance of potential temperature referenced to the surface [degC2]

  • tscov :: [in] Covariance of potential temperature and salinity [degC ppt]

  • svar :: [in] Variance of salinity [ppt2]

  • pressure :: [in] Pressure [Pa]

  • rho :: [out] Density (in-situ if pressure is local) [kg m-3] or [R ~> kg m-3]

  • eos :: Equation of state structure

  • rho_ref :: [in] A reference density [kg m-3].

  • scale :: [in] A multiplicative factor by which to scale density from kg m-3 to the desired units [R m3 kg-1]

Call to

eos_linear eos_teos10 eos_wright mom_error_handler::mom_error

subroutine mom_eos/calculate_density_array(T, S, pressure, rho, start, npts, EOS, rho_ref, scale)

Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs. If rho_ref is present, the anomaly with respect to rho_ref is returned.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa] or [R L2 T-2 ~> Pa]

  • rho :: [inout] Density (in-situ if pressure is local) [kg m-3] or [R ~> kg m-3]

  • start :: [in] Start index for computation

  • npts :: [in] Number of point to compute

  • eos :: Equation of state structure

  • rho_ref :: [in] A reference density [kg m-3]

  • scale :: [in] A multiplicative factor by which to scale density in combination with scaling given by US [various]

Call to

eos_linear eos_nemo eos_teos10 eos_unesco eos_wright mom_error_handler::mom_error

Called from

calculate_density_1d

subroutine mom_eos/calculate_stanley_density_array(T, S, pressure, Tvar, TScov, Svar, rho, start, npts, EOS, rho_ref, scale)

Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs including the variance of T, S and covariance of T-S. The calculation uses only the second order correction in a series as discussed in Stanley et al., 2020. If rho_ref is present, the anomaly with respect to rho_ref is returned.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa]

  • tvar :: [in] Variance of potential temperature referenced to the surface [degC2]

  • tscov :: [in] Covariance of potential temperature and salinity [degC ppt]

  • svar :: [in] Variance of salinity [ppt2]

  • rho :: [inout] Density (in-situ if pressure is local) [kg m-3]

  • start :: [in] Start index for computation

  • npts :: [in] Number of point to compute

  • eos :: Equation of state structure

  • rho_ref :: [in] A reference density [kg m-3].

  • scale :: [in] A multiplicative factor by which to scale density from kg m-3 to the desired units [R m3 kg-1]

Call to

eos_linear eos_teos10 eos_wright mom_error_handler::mom_error

subroutine mom_eos/calculate_density_1d(T, S, pressure, rho, EOS, dom, rho_ref, scale)

Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs, potentially limiting the domain of indices that are worked on. If rho_ref is present, the anomaly with respect to rho_ref is returned.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [R L2 T-2 ~> Pa]

  • rho :: [inout] Density (in-situ if pressure is local) [R ~> kg m-3]

  • eos :: Equation of state structure

  • dom :: [in] The domain of indices to work on, taking into account that arrays start at 1.

  • rho_ref :: [in] A reference density [kg m-3]

  • scale :: [in] A multiplicative factor by which to scale density in combination with scaling given by US [various]

Call to

calculate_density_array mom_error_handler::mom_error

subroutine mom_eos/calculate_stanley_density_1d(T, S, pressure, Tvar, TScov, Svar, rho, EOS, dom, rho_ref, scale)

Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs including the variance of T, S and covariance of T-S, potentially limiting the domain of indices that are worked on. The calculation uses only the second order correction in a series as discussed in Stanley et al., 2020. If rho_ref is present, the anomaly with respect to rho_ref is returned.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [R L2 T-2 ~> Pa]

  • tvar :: [in] Variance of potential temperature [degC2]

  • tscov :: [in] Covariance of potential temperature and salinity [degC ppt]

  • svar :: [in] Variance of salinity [ppt2]

  • rho :: [inout] Density (in-situ if pressure is local) [R ~> kg m-3]

  • eos :: Equation of state structure

  • dom :: [in] The domain of indices to work on, taking into account that arrays start at 1.

  • rho_ref :: [in] A reference density [kg m-3]

  • scale :: [in] A multiplicative factor by which to scale density in combination with scaling given by US [various]

Call to

eos_linear eos_teos10 eos_wright mom_error_handler::mom_error

subroutine mom_eos/calculate_spec_vol_array(T, S, pressure, specvol, start, npts, EOS, spv_ref, scale)

Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs.

Parameters
  • t :: [in] potential temperature relative to the surface [degC]

  • s :: [in] salinity [ppt]

  • pressure :: [in] pressure [Pa]

  • specvol :: [inout] in situ specific volume [kg m-3]

  • start :: [in] the starting point in the arrays.

  • npts :: [in] the number of values to calculate.

  • eos :: Equation of state structure

  • spv_ref :: [in] A reference specific volume [m3 kg-1]

  • scale :: [in] A multiplicative factor by which to scale specific volume in combination with scaling given by US [various]

Call to

eos_linear eos_nemo eos_teos10 eos_unesco eos_wright mom_error_handler::mom_error

Called from

calc_spec_vol_1d calc_spec_vol_scalar

subroutine mom_eos/calc_spec_vol_scalar(T, S, pressure, specvol, EOS, spv_ref, scale)

Calls the appropriate subroutine to calculate specific volume of sea water for scalar inputs.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa] or [R L2 T-2 ~> Pa]

  • specvol :: [out] In situ? specific volume [m3 kg-1] or [R-1 ~> m3 kg-1]

  • eos :: Equation of state structure

  • spv_ref :: [in] A reference specific volume [m3 kg-1] or [R-1 m3 kg-1]

  • scale :: [in] A multiplicative factor by which to scale specific volume in combination with scaling given by US [various]

Call to

calculate_spec_vol_array mom_error_handler::mom_error

subroutine mom_eos/calc_spec_vol_1d(T, S, pressure, specvol, EOS, dom, spv_ref, scale)

Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs, potentially limiting the domain of indices that are worked on.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [R L2 T-2 ~> Pa]

  • specvol :: [inout] In situ specific volume [R-1 ~> m3 kg-1]

  • eos :: Equation of state structure

  • dom :: [in] The domain of indices to work on, taking into account that arrays start at 1.

  • spv_ref :: [in] A reference specific volume [R-1 ~> m3 kg-1]

  • scale :: [in] A multiplicative factor by which to scale output specific volume in combination with scaling given by US [various]

Call to

calculate_spec_vol_array mom_error_handler::mom_error

subroutine mom_eos/calculate_tfreeze_scalar(S, pressure, T_fr, EOS, pres_scale)

Calls the appropriate subroutine to calculate the freezing point for scalar inputs.

Parameters
  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa] or [other]

  • t_fr :: [out] Freezing point potential temperature referenced to the surface [degC]

  • eos :: Equation of state structure

  • pres_scale :: [in] A multiplicative factor to convert pressure into Pa

Call to

mom_error_handler::mom_error tfreeze_linear tfreeze_millero tfreeze_teos10

subroutine mom_eos/calculate_tfreeze_array(S, pressure, T_fr, start, npts, EOS, pres_scale)

Calls the appropriate subroutine to calculate the freezing point for a 1-D array.

Parameters
  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa] or [other]

  • t_fr :: [inout] Freezing point potential temperature referenced to the surface [degC]

  • start :: [in] Starting index within the array

  • npts :: [in] The number of values to calculate

  • eos :: Equation of state structure

  • pres_scale :: [in] A multiplicative factor to convert pressure into Pa.

Call to

mom_error_handler::mom_error tfreeze_linear tfreeze_millero tfreeze_teos10

subroutine mom_eos/calculate_density_derivs_array(T, S, pressure, drho_dT, drho_dS, start, npts, EOS, scale)

Calls the appropriate subroutine to calculate density derivatives for 1-D array inputs.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa] or [R L2 T-2 ~> Pa]

  • drho_dt :: [inout] The partial derivative of density with potential temperature [kg m-3 degC-1] or [R degC-1 ~> kg m-3 degC-1]

  • drho_ds :: [inout] The partial derivative of density with salinity, in [kg m-3 ppt-1] or [R degC-1 ~> kg m-3 ppt-1]

  • start :: [in] Starting index within the array

  • npts :: [in] The number of values to calculate

  • eos :: Equation of state structure

  • scale :: [in] A multiplicative factor by which to scale density in combination with scaling given by US [various]

Call to

eos_linear eos_nemo eos_teos10 eos_unesco eos_wright mom_error_handler::mom_error

Called from

calculate_density_derivs_1d

subroutine mom_eos/calculate_density_derivs_1d(T, S, pressure, drho_dT, drho_dS, EOS, dom, scale)

Calls the appropriate subroutine to calculate density derivatives for 1-D array inputs.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [R L2 T-2 ~> Pa]

  • drho_dt :: [inout] The partial derivative of density with potential temperature [R degC-1 ~> kg m-3 degC-1]

  • drho_ds :: [inout] The partial derivative of density with salinity [R degC-1 ~> kg m-3 ppt-1]

  • eos :: Equation of state structure

  • dom :: [in] The domain of indices to work on, taking into account that arrays start at 1.

  • scale :: [in] A multiplicative factor by which to scale density in combination with scaling given by US [various]

Call to

calculate_density_derivs_array mom_error_handler::mom_error

subroutine mom_eos/calculate_density_derivs_scalar(T, S, pressure, drho_dT, drho_dS, EOS, scale)

Calls the appropriate subroutines to calculate density derivatives by promoting a scalar to a one-element array.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa] or [R L2 T-2 ~> Pa]

  • drho_dt :: [out] The partial derivative of density with potential temperature [kg m-3 degC-1] or [R degC-1 ~> kg m-3 degC-1]

  • drho_ds :: [out] The partial derivative of density with salinity, in [kg m-3 ppt-1] or [R ppt-1 ~> kg m-3 ppt-1]

  • eos :: Equation of state structure

  • scale :: [in] A multiplicative factor by which to scale density in combination with scaling given by US [various]

Call to

eos_linear eos_teos10 eos_wright mom_error_handler::mom_error

subroutine mom_eos/calculate_density_second_derivs_array(T, S, pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT, drho_dS_dP, drho_dT_dP, start, npts, EOS, scale)

Calls the appropriate subroutine to calculate density second derivatives for 1-D array inputs.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa] or [R L2 T-2 ~> Pa]

  • drho_ds_ds :: [inout] Partial derivative of beta with respect to S [kg m-3 ppt-2] or [R ppt-2 ~> kg m-3 ppt-2]

  • drho_ds_dt :: [inout] Partial derivative of beta with respect to T [kg m-3 ppt-1 degC-1] or [R ppt-1 degC-1 ~> kg m-3 ppt-1 degC-1]

  • drho_dt_dt :: [inout] Partial derivative of alpha with respect to T [kg m-3 degC-2] or [R degC-2 ~> kg m-3 degC-2]

  • drho_ds_dp :: [inout] Partial derivative of beta with respect to pressure [kg m-3 ppt-1 Pa-1] or [R ppt-1 Pa-1 ~> kg m-3 ppt-1 Pa-1]

  • drho_dt_dp :: [inout] Partial derivative of alpha with respect to pressure [kg m-3 degC-1 Pa-1] or [R degC-1 Pa-1 ~> kg m-3 degC-1 Pa-1]

  • start :: [in] Starting index within the array

  • npts :: [in] The number of values to calculate

  • eos :: Equation of state structure

  • scale :: [in] A multiplicative factor by which to scale density in combination with scaling given by US [various]

Call to

eos_linear eos_teos10 eos_wright mom_error_handler::mom_error

subroutine mom_eos/calculate_density_second_derivs_scalar(T, S, pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT, drho_dS_dP, drho_dT_dP, EOS, scale)

Calls the appropriate subroutine to calculate density second derivatives for scalar nputs.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa] or [R L2 T-2 ~> Pa]

  • drho_ds_ds :: [out] Partial derivative of beta with respect to S [kg m-3 ppt-2] or [R ppt-2 ~> kg m-3 ppt-2]

  • drho_ds_dt :: [out] Partial derivative of beta with respect to T [kg m-3 ppt-1 degC-1] or [R ppt-1 degC-1 ~> kg m-3 ppt-1 degC-1]

  • drho_dt_dt :: [out] Partial derivative of alpha with respect to T [kg m-3 degC-2] or [R degC-2 ~> kg m-3 degC-2]

  • drho_ds_dp :: [out] Partial derivative of beta with respect to pressure [kg m-3 ppt-1 Pa-1] or [R ppt-1 Pa-1 ~> kg m-3 ppt-1 Pa-1]

  • drho_dt_dp :: [out] Partial derivative of alpha with respect to pressure [kg m-3 degC-1 Pa-1] or [R degC-1 Pa-1 ~> kg m-3 degC-1 Pa-1]

  • eos :: Equation of state structure

  • scale :: [in] A multiplicative factor by which to scale density in combination with scaling given by US [various]

Call to

eos_linear eos_teos10 eos_wright mom_error_handler::mom_error

subroutine mom_eos/calculate_spec_vol_derivs_array(T, S, pressure, dSV_dT, dSV_dS, start, npts, EOS)

Calls the appropriate subroutine to calculate specific volume derivatives for an array.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa]

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

  • dsv_ds :: [inout] The partial derivative of specific volume with salinity [m3 kg-1 ppt-1]

  • start :: [in] Starting index within the array

  • npts :: [in] The number of values to calculate

  • eos :: Equation of state structure

Call to

eos_linear eos_nemo eos_teos10 eos_unesco eos_wright mom_error_handler::mom_error

Called from

calc_spec_vol_derivs_1d

subroutine mom_eos/calc_spec_vol_derivs_1d(T, S, pressure, dSV_dT, dSV_dS, EOS, dom, scale)

Calls the appropriate subroutine to calculate specific volume derivatives for 1-d array inputs, potentially limiting the domain of indices that are worked on.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [R L2 T-2 ~> Pa]

  • dsv_dt :: [inout] The partial derivative of specific volume with potential temperature [R-1 degC-1 ~> m3 kg-1 degC-1]

  • dsv_ds :: [inout] The partial derivative of specific volume with salinity [R-1 ppt-1 ~> m3 kg-1 ppt-1]

  • eos :: Equation of state structure

  • dom :: [in] The domain of indices to work on, taking into account that arrays start at 1.

  • scale :: [in] A multiplicative factor by which to scale specific volume in combination with scaling given by US [various]

Call to

calculate_spec_vol_derivs_array mom_error_handler::mom_error

subroutine mom_eos/calculate_compress_array(T, S, press, rho, drho_dp, start, npts, EOS)

Calls the appropriate subroutine to calculate the density and compressibility for 1-D array inputs. If US is present, the units of the inputs and outputs are rescaled.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [PSU]

  • press :: [in] Pressure [Pa] or [R L2 T-2 ~> Pa]

  • rho :: [inout] In situ density [kg m-3] or [R ~> kg m-3]

  • drho_dp :: [inout] The partial derivative of density with pressure (also the inverse of the square of sound speed) [s2 m-2] or [T2 L-2]

  • start :: [in] Starting index within the array

  • npts :: [in] The number of values to calculate

  • eos :: Equation of state structure

Call to

mom_eos_linear::calculate_compress_linear mom_eos_nemo::calculate_compress_nemo mom_eos_unesco::calculate_compress_unesco eos_linear eos_nemo eos_teos10 eos_unesco eos_wright mom_error_handler::mom_error

Called from

calculate_compress_scalar

subroutine mom_eos/calculate_compress_scalar(T, S, pressure, rho, drho_dp, EOS)

Calculate density and compressibility for a scalar. This just promotes the scalar to an array with a singleton dimension and calls calculate_compress_array. If US is present, the units of the inputs and outputs are rescaled.

Parameters
  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • pressure :: [in] Pressure [Pa] or [R L2 T-2 ~> Pa]

  • rho :: [out] In situ density [kg m-3] or [R ~> 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] or [T2 L-2]

  • eos :: Equation of state structure

Call to

calculate_compress_array mom_error_handler::mom_error

function mom_eos/eos_domain(HI, halo) [integer]

This subroutine returns a two point integer array indicating the domain of i-indices to work on in EOS calls based on information from a hor_index type.

Parameters
  • hi :: [in] The horizontal index structure

  • halo :: [in] The halo size to work on; missing is equivalent to 0.

Return

undefined :: The index domain that the EOS will work on, taking into account that the arrays inside the EOS routines will start at 1.

Called from

mom_bulk_mixed_layer::bulkmixedlayer mom_forcing_type::calculatebuoyancyflux1d mom_tracer_z_init::determine_temperature mom_set_diffusivity::double_diffusion mom_entrain_diffusive::entrainment_diffusive mom_set_diffusivity::find_n2 mom_int_tide_input::find_n2_bottom mom_set_diffusivity::find_tke_to_kd mom_diabatic_driver::layered_diabatic mom_mixed_layer_restrat::mixedlayer_restrat_bml mom_mixed_layer_restrat::mixedlayer_restrat_general mom_regularize_layers::regularize_surface rgc_initialization::rgc_initialize_sponges mom_set_diffusivity::set_density_ratios mom_entrain_diffusive::set_ent_bl mom_full_convection::smoothed_drdt_drds mom_tracer_hor_diff::tracer_epipycnal_ml_diff user_change_diffusivity::user_change_diff

subroutine mom_eos/analytic_int_specific_vol_dp(T, S, p_t, p_b, alpha_ref, HI, EOS, dza, intp_dza, intx_dza, inty_dza, halo_size, bathyP, dP_tiny, useMassWghtInterp)

Calls the appropriate subroutine to calculate 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. There are essentially no free assumptions, apart from the use of Boole’s rule to do the horizontal integrals, and from a truncation in the series for log(1-eps/1+eps) that assumes that |eps| < 0.34.

Parameters
  • hi :: [in] The horizontal index structure

  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • p_t :: [in] Pressure at the top of the layer [R L2 T-2 ~> Pa] or [Pa]

  • p_b :: [in] Pressure at the bottom of the layer [R L2 T-2 ~> Pa] or [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.

  • eos :: Equation of state structure

  • dza :: [inout] The change in the geopotential anomaly across

  • intp_dza :: [inout] The integral in pressure through the layer of the

  • intx_dza :: [inout] The integral in x of the difference between the

  • inty_dza :: [inout] The integral in y of the difference between the

  • 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] or [Pa]

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

  • usemasswghtinterp :: [in] If true, uses mass weighting to interpolate T/S for top and bottom integrals.

Call to

eos_linear eos_wright mom_eos_linear::int_spec_vol_dp_linear mom_error_handler::mom_error

subroutine mom_eos/analytic_int_density_dz(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, EOS, dpa, intz_dpa, intx_dpa, inty_dpa, bathyT, dz_neglect, useMassWghtInterp, 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] Ocean horizontal index structure

  • t :: [in] Potential temperature referenced to the surface [degC]

  • s :: [in] Salinity [ppt]

  • z_t :: [in] Height at the top of the layer in depth units [Z ~> m]

  • z_b :: [in] Height at the bottom of the layer [Z ~> m]

  • rho_ref :: [in] A mean density [R ~> kg m-3] or [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] or [kg m-3], that is 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] or [m2 Z-1 s-2 ~> m s-2]

  • eos :: Equation of state structure

  • dpa :: [inout] The change in the pressure anomaly

  • intz_dpa :: [inout] The integral through the thickness of the

  • intx_dpa :: [inout] The integral in x of the difference between

  • inty_dpa :: [inout] The integral in y of the difference between

  • bathyt :: [in] The depth of the bathymetry [Z ~> m]

  • dz_neglect :: [in] A miniscule thickness change [Z ~> m]

  • usemasswghtinterp :: [in] If true, uses mass weighting to interpolate T/S for top and bottom integrals.

  • z_0p :: [in] The height at which the pressure is 0 [Z ~> m]

Call to

eos_linear eos_wright mom_error_handler::mom_error

function mom_eos/query_compressible(EOS) [logical]

Returns true if the equation of state is compressible (i.e. has pressure dependence)

Parameters

eos :: Equation of state structure

Call to

mom_error_handler::mom_error

Called from

mom_pressureforce_mont::pressureforce_mont_bouss mom_pressureforce_mont::pressureforce_mont_nonbouss

subroutine mom_eos/eos_init(param_file, EOS, US)

Initializes EOS_type by allocating and reading parameters.

Parameters
  • param_file :: [in] Parameter file structure

  • eos :: Equation of state structure

  • us :: [in] A dimensional unit scaling type

Call to

eos_allocate eos_default eos_linear eos_linear_string eos_nemo eos_nemo_string eos_teos10 eos_teos10_string eos_unesco eos_unesco_string eos_wright eos_wright_string mom_error_handler::mom_error mom_error_handler::mom_mesg tfreeze_default tfreeze_linear tfreeze_linear_string tfreeze_millero tfreeze_millero_string tfreeze_teos10 tfreeze_teos10_string mom_string_functions::uppercase

Called from

mom_ice_shelf::initialize_ice_shelf

subroutine mom_eos/eos_manual_init(EOS, form_of_EOS, form_of_TFreeze, EOS_quadrature, Compressible, Rho_T0_S0, drho_dT, dRho_dS, TFr_S0_P0, dTFr_dS, dTFr_dp)

Manually initialized an EOS type (intended for unit testing of routines which need a specific EOS)

Parameters
  • eos :: Equation of state structure

  • form_of_eos :: [in] A coded integer indicating the equation of state to use.

  • form_of_tfreeze :: [in] A coded integer indicating the expression for the potential temperature of the freezing point.

  • eos_quadrature :: [in] If true, always use the generic (quadrature) code for the integrals of density.

  • compressible :: [in] If true, in situ density is a function of pressure.

  • rho_t0_s0 :: [in] Density at T=0 degC and S=0 ppt [kg m-3]

  • drho_dt :: [in] Partial derivative of density with temperature in [kg m-3 degC-1]

  • drho_ds :: [in] Partial derivative of density with salinity in [kg m-3 ppt-1]

  • tfr_s0_p0 :: [in] The freezing potential temperature at S=0, P=0 [degC]

  • dtfr_ds :: [in] The derivative of freezing point with salinity in [degC ppt-1]

  • dtfr_dp :: [in] The derivative of freezing point with pressure in [degC Pa-1]

subroutine mom_eos/eos_allocate(EOS)

Allocates EOS_type.

Parameters

eos :: Equation of state structure

Called from

eos_init

subroutine mom_eos/eos_end(EOS)

Deallocates EOS_type.

Parameters

eos :: Equation of state structure

subroutine mom_eos/eos_use_linear(Rho_T0_S0, dRho_dT, dRho_dS, EOS, use_quadrature)

Set equation of state structure (EOS) to linear with given coefficients.

Parameters
  • rho_t0_s0 :: [in] Density at T=0 degC and S=0 ppt [kg m-3]

  • drho_dt :: [in] Partial derivative of density with temperature [kg m-3 degC-1]

  • drho_ds :: [in] Partial derivative of density with salinity [kg m-3 ppt-1]

  • use_quadrature :: [in] If true, always use the generic (quadrature) code for the integrals of density.

  • eos :: Equation of state structure

Call to

eos_linear mom_error_handler::mom_error

subroutine mom_eos/convert_temp_salt_for_teos10(T, S, HI, kd, mask_z, EOS)

Convert T&S to Absolute Salinity and Conservative Temperature if using TEOS10.

Parameters
  • kd :: [in] The number of layers to work on

  • hi :: [in] The horizontal index structure

  • t :: [inout] Potential temperature referenced to the surface [degC]

  • s :: [inout] Salinity [ppt]

  • mask_z :: [in] 3d mask regulating which points to convert.

  • eos :: Equation of state structure

Call to

eos_nemo eos_teos10 mom_error_handler::mom_error

function mom_eos/eos_quadrature(EOS) [logical]

Return value of EOS_quadrature.

Parameters

eos :: Equation of state structure

subroutine mom_eos/extract_member_eos(EOS, form_of_EOS, form_of_TFreeze, EOS_quadrature, Compressible, Rho_T0_S0, drho_dT, dRho_dS, TFr_S0_P0, dTFr_dS, dTFr_dp)

Extractor routine for the EOS type if the members need to be accessed outside this module.

Parameters
  • eos :: Equation of state structure

  • form_of_eos :: [out] A coded integer indicating the equation of state to use.

  • form_of_tfreeze :: [out] A coded integer indicating the expression for the potential temperature of the freezing point.

  • eos_quadrature :: [out] If true, always use the generic (quadrature) code for the integrals of density.

  • compressible :: [out] If true, in situ density is a function of pressure.

  • rho_t0_s0 :: [out] Density at T=0 degC and S=0 ppt [kg m-3]

  • drho_dt :: [out] Partial derivative of density with temperature in [kg m-3 degC-1]

  • drho_ds :: [out] Partial derivative of density with salinity in [kg m-3 ppt-1]

  • tfr_s0_p0 :: [out] The freezing potential temperature at S=0, P=0 [degC]

  • dtfr_ds :: [out] The derivative of freezing point with salinity [degC PSU-1]

  • dtfr_dp :: [out] The derivative of freezing point with pressure [degC Pa-1]