mom_eos_wright_full module reference

The equation of state using the Wright 1997 expressions.

More…

Functions/Subroutines

calculate_density_scalar_wright()

Computes the in situ density of sea water for scalar inputs and outputs.

calculate_density_array_wright()

Computes the in situ density of sea water for 1-d array inputs and outputs.

calculate_spec_vol_scalar_wright()

Computes the Wright in situ specific volume of sea water for scalar inputs and outputs.

calculate_spec_vol_array_wright()

Computes the Wright in situ specific volume of sea water for 1-d array inputs and outputs.

calculate_density_derivs_array_wright()

Return the thermal/haline expansion coefficients for 1-d array inputs and outputs.

calculate_density_derivs_scalar_wright()

Return the thermal/haline expansion coefficients for scalar inputs and outputs.

calculate_density_second_derivs_array_wright()

Second derivatives of density with respect to temperature, salinity, and pressure for 1-d array inputs and outputs.

calculate_density_second_derivs_scalar_wright()

Second derivatives of density with respect to temperature, salinity, and pressure for scalar inputs.

calculate_specvol_derivs_wright_full()

Return the partial derivatives of specific volume with temperature and salinity for 1-d array inputs and outputs.

calculate_compress_wright_full()

Computes the compressibility of seawater for 1-d array inputs and outputs.

avg_spec_vol_wright_full()

Calculates analytical and nearly-analytical integrals, in pressure across layers, to determine the layer-average specific volumes.

eos_fit_range_wright_full()

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

int_density_dz_wright_full()

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

int_spec_vol_dp_wright_full()

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

Wright equation of state

Wright, 1997, provide an approximation for the in situ density as a function of potential temperature, salinity, and pressure. The formula follow the Tumlirz equation of state which are easier to evaluate and make efficient.

Two ranges are provided by Wright: a “full” range and “reduced” range. The version in this module uses the full range.

Originally coded in 2000 by R. Hallberg. Anomaly form coded in 3/18.

References

Wright, D., 1997: An Equation of State for Use in Ocean Models: Eckart’s Formula Revisited. J. Ocean. Atmosph. Tech., 14 (3), 735-740. https://journals.ametsoc.org/doi/abs/10.1175/1520-0426%281997%29014%3C0735%3AAEOSFU%3E2.0.CO%3B2

Function/Subroutine Documentation

subroutine mom_eos_wright_full/calculate_density_scalar_wright(T, S, pressure, rho, rho_ref)

Computes the in situ density of sea water for scalar inputs and outputs.

Returns the in situ density of sea water (rho in [kg m-3]) from salinity (S [PSU]), potential temperature (T [degC]), and pressure [Pa]. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740 with the full range fit coefficients.

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_ref :: [in] A reference density [kg m-3].

subroutine mom_eos_wright_full/calculate_density_array_wright(T, S, pressure, rho, start, npts, rho_ref)

Computes the in situ density of sea water for 1-d array inputs and outputs.

Returns the in situ density of sea water (rho in [kg m-3]) from salinity (S [PSU]), potential temperature (T [degC]), and pressure [Pa]. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740 with the full range fit coefficients.

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

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

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

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

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

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

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

Called from:

mom_eos_wright_full::calculate_density_wright_full::calculate_density_scalar_wright

subroutine mom_eos_wright_full/calculate_spec_vol_scalar_wright(T, S, pressure, specvol, spv_ref)

Computes the Wright in situ specific volume of sea water for scalar inputs and outputs.

Returns the in situ specific volume of sea water (specvol in [m3 kg-1]) from salinity (S [PSU]), potential temperature (T [degC]) and pressure [Pa]. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740 with the full range fit coefficients. 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].

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

subroutine mom_eos_wright_full/calculate_spec_vol_array_wright(T, S, pressure, specvol, start, npts, spv_ref)

Computes the Wright in situ specific volume of sea water for 1-d array inputs and outputs.

Returns the in situ specific volume of sea water (specvol in [m3 kg-1]) from salinity (S [PSU]), potential temperature (T [degC]) and pressure [Pa]. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740 with the full range fit coefficients. 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 :: [inout] in situ specific volume [m3 kg-1].

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

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

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

Called from:

mom_eos_wright_full::calculate_spec_vol_wright_full::calculate_spec_vol_scalar_wright

subroutine mom_eos_wright_full/calculate_density_derivs_array_wright(T, S, pressure, drho_dT, drho_dS, start, npts)

Return the thermal/haline expansion coefficients for 1-d array inputs and outputs.

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

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

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

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

  • drho_ds :: [inout] The partial derivative of density with salinity, in [kg m-3 PSU-1].

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

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

Called from:

mom_eos_wright_full::calculate_density_derivs_wright_full::calculate_density_derivs_scalar_wright

subroutine mom_eos_wright_full/calculate_density_derivs_scalar_wright(T, S, pressure, drho_dT, drho_dS)

Return the thermal/haline expansion coefficients for scalar inputs and outputs.

The scalar version of calculate_density_derivs promotes scalar inputs to 1-element array and then demotes the output back to a scalar

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

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

  • 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, in [kg m-3 PSU-1].

subroutine mom_eos_wright_full/calculate_density_second_derivs_array_wright(T, S, P, drho_ds_ds, drho_ds_dt, drho_dt_dt, drho_ds_dp, drho_dt_dp, start, npts)

Second derivatives of density with respect to temperature, salinity, and pressure for 1-d array inputs and outputs.

Parameters:
  • t :: [in] Potential temperature referenced to 0 dbar [degC]

  • s :: [in] Salinity [PSU]

  • p :: [in] Pressure [Pa]

  • drho_ds_ds :: [inout] Partial derivative of beta with respect to S [kg m-3 PSU-2]

  • drho_ds_dt :: [inout] Partial derivative of beta with respect to T [kg m-3 PSU-1 degC-1]

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

  • drho_ds_dp :: [inout] Partial derivative of beta with respect to pressure [kg m-3 PSU-1 Pa-1] = [s2 m-2 PSU-1]

  • drho_dt_dp :: [inout] Partial derivative of alpha with respect to pressure [kg m-3 degC-1 Pa-1] = [s2 m-2 degC-1]

  • start :: [in] Starting index in T,S,P

  • npts :: [in] Number of points to loop over

Called from:

mom_eos_wright_full::calculate_density_second_derivs_wright_full::calculate_density_second_derivs_scalar_wright

subroutine mom_eos_wright_full/calculate_density_second_derivs_scalar_wright(T, S, P, drho_ds_ds, drho_ds_dt, drho_dt_dt, drho_ds_dp, drho_dt_dp)

Second derivatives of density with respect to temperature, salinity, and pressure for scalar inputs.

The scalar version of calculate_density_second_derivs promotes scalar inputs to 1-element array and then demotes the output back to a scalar

Parameters:
  • t :: [in] Potential temperature referenced to 0 dbar

  • s :: [in] Salinity [PSU]

  • p :: [in] pressure [Pa]

  • drho_ds_ds :: [out] Partial derivative of beta with respect to S [kg m-3 PSU-2]

  • drho_ds_dt :: [out] Partial derivative of beta with respect to T [kg m-3 PSU-1 degC-1]

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

  • drho_ds_dp :: [out] Partial derivative of beta with respect to pressure [kg m-3 PSU-1 Pa-1] = [s2 m-2 PSU-1]

  • drho_dt_dp :: [out] Partial derivative of alpha with respect to pressure [kg m-3 degC-1 Pa-1] = [s2 m-2 degC-1]

subroutine mom_eos_wright_full/calculate_specvol_derivs_wright_full(T, S, pressure, dSV_dT, dSV_dS, start, npts)

Return the partial derivatives of specific volume with temperature and salinity for 1-d array inputs and outputs.

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

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

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

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

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

Call to:

a1 a2 b0 b1 b2 b3 b4 b5 c0 c1 c2 c3 c4 c5

subroutine mom_eos_wright_full/calculate_compress_wright_full(T, S, pressure, rho, drho_dp, start, npts)

Computes the compressibility of seawater for 1-d array inputs and outputs.

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

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

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

  • rho :: [inout] In situ density [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].

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

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

Call to:

a0 a1 a2 b0 b1 b2 b3 b4 b5 c0 c1 c2 c3 c4 c5

subroutine mom_eos_wright_full/avg_spec_vol_wright_full(T, S, p_t, dp, SpV_avg, start, npts)

Calculates analytical and nearly-analytical integrals, in pressure across layers, to determine the layer-average specific volumes. There are essentially no free assumptions, apart from a truncation in the series for log(1-eps/1+eps) that assumes that |eps| < 0.34.

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

Call to:

a0 a1 a2 b0 b1 b2 b3 b4 b5 c0 c1 c2 c3 c4 c5

Called from:

mom_eos::average_specific_vol

subroutine mom_eos_wright_full/eos_fit_range_wright_full(T_min, T_max, S_min, S_max, p_min, p_max)

Return the range of temperatures, salinities and pressures for which full-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 practical salinity over which this EoS is fitted [PSU]

  • s_max :: [out] The maximum practical salinity over which this EoS is fitted [PSU]

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

Called from:

mom_eos::eos_fit_range

subroutine mom_eos_wright_full/int_density_dz_wright_full(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, dpa, intz_dpa, intx_dpa, inty_dpa, bathyT, dz_neglect, useMassWghtInterp, rho_scale, pres_scale, temp_scale, saln_scale, Z_0p)

Calculates analytical and nearly-analytical integrals, in geopotential across layers, of pressure anomalies, which are required for calculating the finite-volume form pressure accelerations in a Boussinesq model. There are essentially no free assumptions, apart from the use of Boole’s rule 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 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. (The pressure is calculated as p~=-z*rho_0*G_e.)

  • rho_0 :: [in] Density [R ~> 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].

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

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

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

  • inty_dpa :: [inout] 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.

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

  • pres_scale :: [in] A multiplicative factor to convert pressure into Pa [Pa T2 R-1 L-2 ~> 1].

  • temp_scale :: [in] A multiplicative factor by which to scale temperature into degC [degC C-1 ~> 1]

  • saln_scale :: [in] A multiplicative factor to convert pressure into PSU [PSU S-1 ~> 1].

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

Call to:

a0 a1 a2 b0 b1 b2 b3 b4 b5 c0 c1 c2 c3 c4 c5

subroutine mom_eos_wright_full/int_spec_vol_dp_wright_full(T, S, p_t, p_b, spv_ref, HI, dza, intp_dza, intx_dza, inty_dza, halo_size, bathyP, dP_neglect, useMassWghtInterp, SV_scale, pres_scale, temp_scale, saln_scale)

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

  • spv_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 spv_ref, but this reduces the effects of roundoff.

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

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

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

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

  • sv_scale :: [in] A multiplicative factor by which to scale specific volume from m3 kg-1 to the desired units [kg m-3 R-1 ~> 1]

  • pres_scale :: [in] A multiplicative factor to convert pressure into Pa [Pa T2 R-1 L-2 ~> 1].

  • temp_scale :: [in] A multiplicative factor by which to scale temperature into degC [degC C-1 ~> 1]

  • saln_scale :: [in] A multiplicative factor to convert pressure into PSU [PSU S-1 ~> 1].

Call to:

a0 a1 a2 b0 b1 b2 b3 b4 b5 c0 c1 c2 c3 c4 c5