mom_eos_wright module reference

The equation of state using the Wright 1997 expressions.

More…

Functions/Subroutines

calculate_density_scalar_wright()

This subroutine computes the in situ density of sea water (rho in [kg m-3]) from salinity (S [PSU]), potential temperature (T [degC]), and pressure [Pa].

calculate_density_array_wright()

This subroutine computes the in situ density of sea water (rho in [kg m-3]) from salinity (S [PSU]), potential temperature (T [degC]), and pressure [Pa].

calculate_spec_vol_scalar_wright()

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

calculate_spec_vol_array_wright()

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

calculate_density_derivs_array_wright()

For a given thermodynamic state, return the thermal/haline expansion coefficients.

calculate_density_derivs_scalar_wright()

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

calculate_density_second_derivs_array_wright()

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

calculate_density_second_derivs_scalar_wright()

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

calculate_specvol_derivs_wright()

For a given thermodynamic state, return the partial derivatives of specific volume with temperature and salinity.

calculate_compress_wright()

This subroutine computes the in situ density of sea water (rho in [kg m-3]) and the compressibility (drho/dp = C_sound^-2) (drho_dp [s2 m-2]) from salinity (sal in psu), potential temperature (T [degC]), and pressure [Pa].

int_density_dz_wright()

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_wright()

This subroutine 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

The equation of state using the Wright 1997 expressions.

Function/Subroutine Documentation

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

This subroutine computes 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.

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

Call to

calculate_density_array_wright

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

This subroutine computes 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.

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

Call to

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

Called from

calculate_density_scalar_wright

subroutine mom_eos_wright/calculate_spec_vol_scalar_wright(T, S, pressure, specvol, 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]. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. 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].

Call to

calculate_spec_vol_array_wright

subroutine mom_eos_wright/calculate_spec_vol_array_wright(T, S, pressure, specvol, start, npts, 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]. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. 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].

Call to

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

Called from

calculate_spec_vol_scalar_wright

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

For a given thermodynamic state, return the thermal/haline expansion coefficients.

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.

Call to

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

Called from

calculate_density_derivs_scalar_wright

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

The scalar version of calculate_density_derivs which promotes scalar inputs to a 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].

Call to

calculate_density_derivs_array_wright

subroutine mom_eos_wright/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.

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

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

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

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

Call to

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

Called from

calculate_density_second_derivs_scalar_wright

subroutine mom_eos_wright/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. Inputs promoted to 1-element array and output demoted to 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 respcct 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]

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

Call to

calculate_density_second_derivs_array_wright

subroutine mom_eos_wright/calculate_specvol_derivs_wright(T, S, pressure, dSV_dT, dSV_dS, start, npts)

For a given thermodynamic state, return the partial 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_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 / Pa].

  • 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/calculate_compress_wright(T, S, pressure, rho, drho_dp, start, npts)

This subroutine computes the in situ density of sea water (rho in [kg m-3]) and the compressibility (drho/dp = C_sound^-2) (drho_dp [s2 m-2]) from salinity (sal in psu), potential temperature (T [degC]), and pressure [Pa]. It uses the expressions from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. Coded by R. Hallberg, 1/01.

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/int_density_dz_wright(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, 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

  • s :: [in] Salinity [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] or [kg m-3], that is subtracted out to reduce the magnitude of each of the integrals. (The pressure is calucated as p~=-z*rho_0*G_e.)

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

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

  • 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/int_spec_vol_dp_wright(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)

This subroutine 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 [PSU].

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

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

  • dp_neglect :: [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.

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

Call to

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