mom_eos_linear module reference

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

More…

Functions/Subroutines

calculate_density_scalar_linear()

This subroutine computes the density of sea water with a trivial linear equation of state (in [kg m-3]) from salinity (sal [PSU]), potential temperature (T [degC]), and pressure [Pa].

calculate_density_array_linear()

This subroutine computes the density of sea water with a trivial linear equation of state (in [kg m-3]) from salinity (sal [PSU]), potential temperature (T [degC]), and pressure [Pa].

calculate_spec_vol_scalar_linear()

This subroutine computes the in situ specific volume of sea water (specvol in [m3 kg-1]) from salinity (S [PSU]), potential temperature (T [degC]) and pressure [Pa], using a trivial linear equation of state for density.

calculate_spec_vol_array_linear()

This subroutine computes the in situ specific volume of sea water (specvol in [m3 kg-1]) from salinity (S [PSU]), potential temperature (T [degC]) and pressure [Pa], using a trivial linear equation of state for density.

calculate_density_derivs_array_linear()

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

calculate_density_derivs_scalar_linear()

This subroutine calculates the partial derivatives of density * with potential temperature and salinity for a single point.

calculate_density_second_derivs_scalar_linear()

This subroutine calculates the five, partial second derivatives of density w.r.t.

calculate_density_second_derivs_array_linear()

This subroutine calculates the five, partial second derivatives of density w.r.t.

calculate_specvol_derivs_linear()

Calculate the derivatives of specific volume with temperature and salinity.

calculate_compress_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.

eos_fit_range_linear()

Return the range of temperatures, salinities and pressures for which the reduced-range equation of state from Wright (1997) has been fitted to observations.

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.

Detailed Description

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

Function/Subroutine Documentation

subroutine mom_eos_linear/calculate_density_scalar_linear(T, S, pressure, rho, Rho_T0_S0, dRho_dT, dRho_dS, rho_ref)

This subroutine computes the density of sea water with a trivial linear equation of state (in [kg m-3]) from salinity (sal [PSU]), potential temperature (T [degC]), and pressure [Pa].

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

  • s :: [in] Salinity [PSU].

  • pressure :: [in] pressure [Pa].

  • rho :: [out] In situ density [kg m-3].

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

  • drho_dt :: [in] The derivatives of density with temperature [kg m-3 degC-1].

  • drho_ds :: [in] The derivatives of density with salinity in [kg m-3 ppt-1].

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

subroutine mom_eos_linear/calculate_density_array_linear(T, S, pressure, rho, start, npts, Rho_T0_S0, dRho_dT, dRho_dS, rho_ref)

This subroutine computes the density of sea water with a trivial linear equation of state (in [kg m-3]) from salinity (sal [PSU]), potential temperature (T [degC]), and pressure [Pa].

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

  • s :: [in] salinity [PSU].

  • pressure :: [in] pressure [Pa].

  • rho :: [out] in situ density [kg m-3].

  • 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 derivatives of density with temperature [kg m-3 degC-1].

  • drho_ds :: [in] The derivatives of density with salinity in [kg m-3 ppt-1].

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

subroutine mom_eos_linear/calculate_spec_vol_scalar_linear(T, S, pressure, specvol, Rho_T0_S0, dRho_dT, dRho_dS, spv_ref)

This subroutine computes the in situ specific volume of sea water (specvol in [m3 kg-1]) from salinity (S [PSU]), potential temperature (T [degC]) and pressure [Pa], using a trivial linear equation of state for density. If spv_ref is present, specvol is an anomaly from spv_ref.

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

  • s :: [in] Salinity [PSU].

  • pressure :: [in] Pressure [Pa].

  • specvol :: [out] In situ specific volume [m3 kg-1].

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

  • drho_dt :: [in] The derivatives of density with temperature [kg m-3 degC-1].

  • drho_ds :: [in] The derivatives of density with salinity [kg m-3 ppt-1].

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

subroutine mom_eos_linear/calculate_spec_vol_array_linear(T, S, pressure, specvol, start, npts, Rho_T0_S0, dRho_dT, dRho_dS, spv_ref)

This subroutine computes the in situ specific volume of sea water (specvol in [m3 kg-1]) from salinity (S [PSU]), potential temperature (T [degC]) and pressure [Pa], using a trivial linear equation of state for density. If spv_ref is present, specvol is an anomaly from spv_ref.

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

  • s :: [in] Salinity [PSU].

  • pressure :: [in] Pressure [Pa].

  • specvol :: [out] in situ specific volume [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 derivatives of density with temperature [kg m-3 degC-1].

  • drho_ds :: [in] The derivatives of density with salinity [kg m-3 ppt-1].

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

subroutine mom_eos_linear/calculate_density_derivs_array_linear(T, S, pressure, drho_dT_out, drho_dS_out, Rho_T0_S0, dRho_dT, dRho_dS, start, npts)

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

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

  • s :: [in] Salinity [PSU].

  • pressure :: [in] Pressure [Pa].

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

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

  • 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].

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

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

subroutine mom_eos_linear/calculate_density_derivs_scalar_linear(T, S, pressure, drho_dT_out, drho_dS_out, Rho_T0_S0, dRho_dT, dRho_dS)

This subroutine calculates the partial derivatives of density * with potential temperature and salinity for a single point.

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

  • s :: [in] Salinity [PSU].

  • pressure :: [in] pressure [Pa].

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

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

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

  • drho_dt :: [in] The derivatives of density with temperature [kg m-3 degC-1].

  • drho_ds :: [in] The derivatives of density with salinity [kg m-3 ppt-1].

subroutine mom_eos_linear/calculate_density_second_derivs_scalar_linear(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:
  • t :: [in] Potential temperature relative to the surface [degC].

  • s :: [in] Salinity [PSU].

  • pressure :: [in] pressure [Pa].

  • drho_ds_ds :: [out] The second derivative of density with salinity [kg m-3 PSU-2].

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

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

  • drho_ds_dp :: [out] The second derivative of density with salinity and pressure [kg m-3 PSU-1 Pa-1].

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

subroutine mom_eos_linear/calculate_density_second_derivs_array_linear(T, S, pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT, drho_dS_dP, drho_dT_dP, start, npts)

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:
  • t :: [in] Potential temperature relative to the surface [degC].

  • s :: [in] Salinity [PSU].

  • pressure :: [in] pressure [Pa].

  • drho_ds_ds :: [out] The second derivative of density with salinity [kg m-3 PSU-2].

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

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

  • drho_ds_dp :: [out] The second derivative of density with salinity and pressure [kg m-3 PSU-1 Pa-1].

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

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

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

subroutine mom_eos_linear/calculate_specvol_derivs_linear(T, S, pressure, dSV_dT, dSV_dS, start, npts, Rho_T0_S0, dRho_dT, dRho_dS)

Calculate the derivatives of specific volume with temperature and salinity.

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

  • s :: [in] Salinity [PSU].

  • pressure :: [in] pressure [Pa].

  • dsv_ds :: [out] The partial derivative of specific volume with salinity [m3 kg-1 PSU-1].

  • dsv_dt :: [out] The partial derivative of specific volume with potential temperature [m3 kg-1 degC-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].

subroutine mom_eos_linear/calculate_compress_linear(T, S, pressure, rho, drho_dp, start, npts, Rho_T0_S0, dRho_dT, dRho_dS)

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:
  • t :: [in] Potential temperature relative to the surface [degC].

  • s :: [in] Salinity [PSU].

  • 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].

  • 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].

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

Calculates the layer average specific volumes.

Parameters:
  • t :: [in] Potential temperature [degC]

  • s :: [in] Salinity [PSU]

  • 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]

Called from:

mom_eos::average_specific_vol

subroutine mom_eos_linear/eos_fit_range_linear(T_min, T_max, S_min, S_max, p_min, p_max)

Return the range of temperatures, salinities and pressures for which the reduced-range equation of state from Wright (1997) has been fitted to observations. Care should be taken when applying this equation of state outside of its fit range.

Parameters:
  • 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 mom_eos_linear/int_density_dz_linear(T, S, z_t, z_b, rho_ref, rho_0_pres, G_e, HI, Rho_T0_S0, dRho_dT, dRho_dS, dpa, intz_dpa, intx_dpa, inty_dpa, bathyT, dz_neglect, useMassWghtInterp)

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

  • s :: [in] Salinity [S ~> PSU].

  • 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_pres :: [in] A density [R ~> kg m-3], used to calculate the pressure (as p~=-z*rho_0_pres*G_e) used in the equation of state. rho_0_pres is not used.

  • 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]

  • dpa :: [out] The change in the pressure anomaly across the

  • intz_dpa :: [out] The integral through the thickness of the layer

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

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

  • 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.

subroutine mom_eos_linear/int_spec_vol_dp_linear(T, S, p_t, p_b, alpha_ref, HI, Rho_T0_S0, dRho_dT, dRho_dS, dza, intp_dza, intx_dza, inty_dza, halo_size, bathyP, dP_neglect, useMassWghtInterp)

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

  • s :: [in] Salinity [S ~> PSU].

  • 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]

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

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

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

  • inty_dza :: [out] 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]

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

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