MOM6
mom_eos_teos10 Module Reference

Data Types

interface  calculate_density_teos10
 

Functions/Subroutines

subroutine, public calculate_density_scalar_teos10 (T, S, pressure, rho)
 This subroutine computes the in situ density of sea water (rho in units of kg/m^3) from salinity (S in psu), potential temperature (T in deg C), and pressure in Pa. It uses the expression from TEOS10 website. More...
 
subroutine, public calculate_density_array_teos10 (T, S, pressure, rho, start, npts)
 
subroutine, public calculate_density_derivs_teos10 (T, S, pressure, drho_dT, drho_dS, start, npts)
 
subroutine, public calculate_specvol_derivs_teos10 (T, S, pressure, dSV_dT, dSV_dS, start, npts)
 
subroutine, public calculate_compress_teos10 (T, S, pressure, rho, drho_dp, start, npts)
 This subroutine computes the in situ density of sea water (rho in * units of kg/m^3) and the compressibility (drho/dp = C_sound^-2) * (drho_dp in units of s2 m-2) from salinity (sal in psu), potential* temperature (T in deg C), and pressure in Pa. It uses the * subroutines from TEOS10 website. More...
 

Variables

real, parameter pa2db = 1.e-4
 

Function/Subroutine Documentation

◆ calculate_compress_teos10()

subroutine, public mom_eos_teos10::calculate_compress_teos10 ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  rho,
real, dimension(:), intent(out)  drho_dp,
integer, intent(in)  start,
integer, intent(in)  npts 
)

This subroutine computes the in situ density of sea water (rho in * units of kg/m^3) and the compressibility (drho/dp = C_sound^-2) * (drho_dp in units of s2 m-2) from salinity (sal in psu), potential* temperature (T in deg C), and pressure in Pa. It uses the * subroutines from TEOS10 website.

Parameters
[in]tConservative temperature in C.
[in]sAbsolute salinity in g/kg.
[in]pressurePressure in Pa.
[out]rhoIn situ density in kg m-3.
[out]drho_dpThe partial derivative of density with pressure (also the inverse of the square of sound speed) in s2 m-2.
[in]startThe starting point in the arrays.
[in]nptsThe number of values to calculate.

Definition at line 185 of file MOM_EOS_TEOS10.F90.

References pa2db.

185  real, intent(in), dimension(:) :: t !< Conservative temperature in C.
186  real, intent(in), dimension(:) :: s !< Absolute salinity in g/kg.
187  real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
188  real, intent(out), dimension(:) :: rho !< In situ density in kg m-3.
189  real, intent(out), dimension(:) :: drho_dp !< The partial derivative of density with pressure
190  !! (also the inverse of the square of sound speed)
191  !! in s2 m-2.
192  integer, intent(in) :: start !< The starting point in the arrays.
193  integer, intent(in) :: npts !< The number of values to calculate.
194 ! * Arguments: T - conservative temperature in C. *
195 ! * (in) S - absolute salinity in g/kg. *
196 ! * (in) pressure - pressure in Pa. *
197 ! * (out) rho - in situ density in kg m-3. *
198 ! * (out) drho_dp - the partial derivative of density with *
199 ! * pressure (also the inverse of the square of *
200 ! * sound speed) in s2 m-2. *
201 ! * (in) start - the starting point in the arrays. *
202 ! * (in) npts - the number of values to calculate. *
203 ! *====================================================================*
204 ! * This subroutine computes the in situ density of sea water (rho in *
205 ! * units of kg/m^3) and the compressibility (drho/dp = C_sound^-2) *
206 ! * (drho_dp in units of s2 m-2) from salinity (sal in psu), potential*
207 ! * temperature (T in deg C), and pressure in Pa. It uses the *
208 ! * subroutines from TEOS10 website *
209 ! *====================================================================*
210  real :: zs,zt,zp
211  integer :: j
212 
213  do j=start,start+npts-1
214  !Conversions
215  zs = s(j) !gsw_sr_from_sp(S(j)) !Convert practical salinity to absolute salinity
216  zt = t(j) !gsw_ct_from_pt(S(j),T(j)) !Convert potantial temp to conservative temp
217  zp = pressure(j)* pa2db !Convert pressure from Pascal to decibar
218  if(s(j).lt.-1.0e-10) cycle !Can we assume safely that this is a missing value?
219  rho(j) = gsw_rho(zs,zt,zp)
220  call gsw_rho_first_derivatives(zs,zt,zp, drho_dp=drho_dp(j))
221  enddo

◆ calculate_density_array_teos10()

subroutine, public mom_eos_teos10::calculate_density_array_teos10 ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  rho,
integer, intent(in)  start,
integer, intent(in)  npts 
)

Definition at line 83 of file MOM_EOS_TEOS10.F90.

References pa2db.

Referenced by calculate_density_scalar_teos10().

83  real, intent(in), dimension(:) :: t, s, pressure
84  real, intent(out), dimension(:) :: rho
85  integer, intent(in) :: start, npts
86 ! * Arguments: T - conservative temperature in C. *
87 ! * (in) S - absolute salinity in g/kg. *
88 ! * (in) pressure - pressure in Pa. *
89 ! * (out) rho - in situ density in kg m-3. *
90 ! * (in) start - the starting point in the arrays. *
91 ! * (in) npts - the number of values to calculate. *
92 
93 ! *====================================================================*
94 ! * This subroutine computes the in situ density of sea water (rho in *
95 ! * units of kg/m^3) from absolute salinity (S in g/Kg), *
96 ! * conservative temperature (T in deg C), and pressure in Pa. *
97 ! * It uses the functions from TEOS10 website *
98 ! *====================================================================*
99  real :: zs,zt,zp
100  integer :: j
101 
102  do j=start,start+npts-1
103  !Conversions
104  zs = s(j) !gsw_sr_from_sp(S(j)) !Convert practical salinity to absolute salinity
105  zt = t(j) !gsw_ct_from_pt(S(j),T(j)) !Convert potantial temp to conservative temp
106  zp = pressure(j)* pa2db !Convert pressure from Pascal to decibar
107 
108  if(s(j).lt.-1.0e-10) cycle !Can we assume safely that this is a missing value?
109  rho(j) = gsw_rho(zs,zt,zp)
110  enddo
Here is the caller graph for this function:

◆ calculate_density_derivs_teos10()

subroutine, public mom_eos_teos10::calculate_density_derivs_teos10 ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  drho_dT,
real, dimension(:), intent(out)  drho_dS,
integer, intent(in)  start,
integer, intent(in)  npts 
)
Parameters
[in]tConservative temperature in C.
[in]sAbsolute salinity in g/kg.
[in]pressurePressure in Pa.
[out]drho_dtThe partial derivative of density with potential temperature, in kg m-3 K-1.
[out]drho_dsThe partial derivative of density with salinity, in kg m-3 psu-1.
[in]startThe starting point in the arrays.
[in]nptsThe number of values to calculate.

Definition at line 114 of file MOM_EOS_TEOS10.F90.

References pa2db.

114  real, intent(in), dimension(:) :: t !< Conservative temperature in C.
115  real, intent(in), dimension(:) :: s !< Absolute salinity in g/kg.
116  real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
117  real, intent(out), dimension(:) :: drho_dt !< The partial derivative of density with potential
118  !! temperature, in kg m-3 K-1.
119  real, intent(out), dimension(:) :: drho_ds !< The partial derivative of density with salinity,
120  !! in kg m-3 psu-1.
121  integer, intent(in) :: start !< The starting point in the arrays.
122  integer, intent(in) :: npts !< The number of values to calculate.
123 ! * Arguments: T - conservative temperature in C. *
124 ! * (in) S - absolute salinity in g/kg. *
125 ! * (in) pressure - pressure in Pa. *
126 ! * (out) drho_dT - the partial derivative of density with *
127 ! * potential temperature, in kg m-3 K-1. *
128 ! * (out) drho_dS - the partial derivative of density with *
129 ! * salinity, in kg m-3 psu-1. *
130 ! * (in) start - the starting point in the arrays. *
131 ! * (in) npts - the number of values to calculate. *
132  real :: zs,zt,zp
133  integer :: j
134 
135  do j=start,start+npts-1
136  !Conversions
137  zs = s(j) !gsw_sr_from_sp(S(j)) !Convert practical salinity to absolute salinity
138  zt = t(j) !gsw_ct_from_pt(S(j),T(j)) !Convert potantial temp to conservative temp
139  zp = pressure(j)* pa2db !Convert pressure from Pascal to decibar
140  if(s(j).lt.-1.0e-10) cycle !Can we assume safely that this is a missing value?
141  call gsw_rho_first_derivatives(zs, zt, zp, drho_dsa=drho_ds(j), drho_dct=drho_dt(j))
142  enddo
143 

◆ calculate_density_scalar_teos10()

subroutine, public mom_eos_teos10::calculate_density_scalar_teos10 ( real, intent(in)  T,
real, intent(in)  S,
real, intent(in)  pressure,
real, intent(out)  rho 
)

This subroutine computes the in situ density of sea water (rho in units of kg/m^3) from salinity (S in psu), potential temperature (T in deg C), and pressure in Pa. It uses the expression from TEOS10 website.

Parameters
[in]tConservative temperature in C.
[in]sAbsolute salinity in g/kg.
[in]pressurePressure in Pa.
[out]rhoIn situ density in kg m-3.

Definition at line 52 of file MOM_EOS_TEOS10.F90.

References calculate_density_array_teos10().

52 real, intent(in) :: t !< Conservative temperature in C.
53 real, intent(in) :: s !< Absolute salinity in g/kg.
54 real, intent(in) :: pressure !< Pressure in Pa.
55 real, intent(out) :: rho !< In situ density in kg m-3.
56 ! * Arguments: T - conservative temperature in C. *
57 ! * (in) S - absolute salinity in g/kg. *
58 ! * (in) pressure - pressure in Pa. *
59 ! * (out) rho - in situ density in kg m-3. *
60 ! * (in) start - the starting point in the arrays. *
61 ! * (in) npts - the number of values to calculate. *
62 
63 ! *====================================================================*
64 ! * This subroutine computes the in situ density of sea water (rho in *
65 ! * units of kg/m^3) from salinity (S in psu), potential temperature *
66 ! * (T in deg C), and pressure in Pa. It uses the expression from *
67 ! * TEOS10 website. *
68 ! *====================================================================*
69 
70  real, dimension(1) :: t0, s0, pressure0
71  real, dimension(1) :: rho0
72 
73  t0(1) = t
74  s0(1) = s
75  pressure0(1) = pressure
76 
77  call calculate_density_array_teos10(t0, s0, pressure0, rho0, 1, 1)
78  rho = rho0(1)
79 
Here is the call graph for this function:

◆ calculate_specvol_derivs_teos10()

subroutine, public mom_eos_teos10::calculate_specvol_derivs_teos10 ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  dSV_dT,
real, dimension(:), intent(out)  dSV_dS,
integer, intent(in)  start,
integer, intent(in)  npts 
)
Parameters
[in]tConservative temperature in C.
[in]sAbsolute salinity in g/kg.
[in]pressurePressure in Pa.
[out]dsv_dtThe partial derivative of specific volume with potential temperature, in m3 kg-1 K-1.
[out]dsv_dsThe partial derivative of specific volume with salinity, in m3 kg-1 / (g/kg).
[in]startThe starting point in the arrays.
[in]nptsThe number of values to calculate.

Definition at line 147 of file MOM_EOS_TEOS10.F90.

References pa2db.

147  real, intent(in), dimension(:) :: t !< Conservative temperature in C.
148  real, intent(in), dimension(:) :: s !< Absolute salinity in g/kg.
149  real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
150  real, intent(out), dimension(:) :: dsv_dt !< The partial derivative of specific volume with
151  !! potential temperature, in m3 kg-1 K-1.
152  real, intent(out), dimension(:) :: dsv_ds !< The partial derivative of specific volume with
153  !! salinity, in m3 kg-1 / (g/kg).
154  integer, intent(in) :: start !< The starting point in the arrays.
155  integer, intent(in) :: npts !< The number of values to calculate.
156 ! * Arguments: T - conservative temperature in C. *
157 ! * (in) S - absolute salinity in g/kg. *
158 ! * (in) pressure - pressure in Pa. *
159 ! * (out) dSV_dT - the partial derivative of specific volume with *
160 ! * potential temperature, in m3 kg-1 K-1. *
161 ! * (out) dSV_dS - the partial derivative of specific volume with *
162 ! * salinity, in m3 kg-1 / (g/kg). *
163 ! * (in) start - the starting point in the arrays. *
164 ! * (in) npts - the number of values to calculate. *
165  real :: zs, zt, zp
166  integer :: j
167 
168  do j=start,start+npts-1
169  !Conversions
170  zs = s(j) !gsw_sr_from_sp(S(j)) !Convert practical salinity to absolute salinity
171  zt = t(j) !gsw_ct_from_pt(S(j),T(j)) !Convert potantial temp to conservative temp
172  zp = pressure(j)* pa2db !Convert pressure from Pascal to decibar
173  if(s(j).lt.-1.0e-10) cycle !Can we assume safely that this is a missing value?
174  call gsw_specvol_first_derivatives(zs,zt,zp, v_sa=dsv_ds(j), v_ct=dsv_dt(j))
175  enddo
176 

Variable Documentation

◆ pa2db

real, parameter mom_eos_teos10::pa2db = 1.e-4
private

Definition at line 43 of file MOM_EOS_TEOS10.F90.

Referenced by calculate_compress_teos10(), calculate_density_array_teos10(), calculate_density_derivs_teos10(), and calculate_specvol_derivs_teos10().

43 real, parameter :: pa2db = 1.e-4 ! The conversion factor from Pa to dbar.