MOM6
mom_eos_unesco::calculate_spec_vol_unesco Interface Reference

Detailed Description

Compute the in situ specific volume of sea water (in [m3 kg-1]), or an anomaly with respect to a reference specific volume, from salinity [PSU], potential temperature [degC], and pressure [Pa], using the UNESCO (1981) equation of state.

Definition at line 29 of file MOM_EOS_UNESCO.F90.

Private functions

subroutine calculate_spec_vol_scalar_unesco (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], using the UNESCO (1981) equation of state. If spv_ref is present, specvol is an anomaly from spv_ref. More...
 
subroutine calculate_spec_vol_array_unesco (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], using the UNESCO (1981) equation of state. If spv_ref is present, specvol is an anomaly from spv_ref. More...
 

Functions and subroutines

◆ calculate_spec_vol_array_unesco()

subroutine mom_eos_unesco::calculate_spec_vol_unesco::calculate_spec_vol_array_unesco ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  specvol,
integer, intent(in)  start,
integer, intent(in)  npts,
real, intent(in), optional  spv_ref 
)
private

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 the UNESCO (1981) equation of state. If spv_ref is present, specvol is an anomaly from spv_ref.

Parameters
[in]tpotential temperature relative to the surface [degC].
[in]ssalinity [PSU].
[in]pressurepressure [Pa].
[out]specvolin situ specific volume [m3 kg-1].
[in]startthe starting point in the arrays.
[in]nptsthe number of values to calculate.
[in]spv_refA reference specific volume [m3 kg-1].

Definition at line 159 of file MOM_EOS_UNESCO.F90.

159  real, dimension(:), intent(in) :: T !< potential temperature relative to the surface
160  !! [degC].
161  real, dimension(:), intent(in) :: S !< salinity [PSU].
162  real, dimension(:), intent(in) :: pressure !< pressure [Pa].
163  real, dimension(:), intent(out) :: specvol !< in situ specific volume [m3 kg-1].
164  integer, intent(in) :: start !< the starting point in the arrays.
165  integer, intent(in) :: npts !< the number of values to calculate.
166  real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1].
167 
168  ! Local variables
169  real :: t_local, t2, t3, t4, t5 ! Temperature to the 1st - 5th power [degC^n].
170  real :: s_local, s32, s2 ! Salinity to the 1st, 3/2, & 2nd power [PSU^n].
171  real :: p1, p2 ! Pressure (in bars) to the 1st and 2nd power [bar] and [bar2].
172  real :: rho0 ! Density at 1 bar pressure [kg m-3].
173  real :: ks ! The secant bulk modulus [bar].
174  integer :: j
175 
176  do j=start,start+npts-1
177  if (s(j) < -1.0e-10) then !Can we assume safely that this is a missing value?
178  specvol(j) = 0.001
179  if (present(spv_ref)) specvol(j) = 0.001 - spv_ref
180  cycle
181  endif
182 
183  p1 = pressure(j)*1.0e-5; p2 = p1*p1
184  t_local = t(j); t2 = t_local*t_local; t3 = t_local*t2; t4 = t2*t2; t5 = t3*t2
185  s_local = s(j); s2 = s_local*s_local; s32 = s_local*sqrt(s_local)
186 
187 ! Compute rho(s,theta,p=0) - (same as rho(s,t_insitu,p=0) ).
188 
189  rho0 = r00 + r10*t_local + r20*t2 + r30*t3 + r40*t4 + r50*t5 + &
190  s_local*(r01 + r11*t_local + r21*t2 + r31*t3 + r41*t4) + &
191  s32*(r032 + r132*t_local + r232*t2) + r02*s2
192 
193 ! Compute rho(s,theta,p), first calculating the secant bulk modulus.
194 
195  ks = s00 + s10*t_local + s20*t2 + s30*t3 + s40*t4 + s_local*(s01 + s11*t_local + s21*t2 + s31*t3) + &
196  s32*(s032 + s132*t_local + s232*t2) + &
197  p1*(sp00 + sp10*t_local + sp20*t2 + sp30*t3 + &
198  s_local*(sp01 + sp11*t_local + sp21*t2) + sp032*s32) + &
199  p2*(sp000 + sp010*t_local + sp020*t2 + s_local*(sp001 + sp011*t_local + sp021*t2))
200 
201  if (present(spv_ref)) then
202  specvol(j) = (ks*(1.0 - (rho0*spv_ref)) - p1) / (rho0*ks)
203  else
204  specvol(j) = (ks - p1) / (rho0*ks)
205  endif
206  enddo

◆ calculate_spec_vol_scalar_unesco()

subroutine mom_eos_unesco::calculate_spec_vol_unesco::calculate_spec_vol_scalar_unesco ( real, intent(in)  T,
real, intent(in)  S,
real, intent(in)  pressure,
real, intent(out)  specvol,
real, intent(in), optional  spv_ref 
)
private

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 the UNESCO (1981) equation of state. If spv_ref is present, specvol is an anomaly from spv_ref.

Parameters
[in]tpotential temperature relative to the surface [degC].
[in]ssalinity [PSU].
[in]pressurepressure [Pa].
[out]specvolin situ specific volume [m3 kg-1].
[in]spv_refA reference specific volume [m3 kg-1].

Definition at line 138 of file MOM_EOS_UNESCO.F90.

138  real, intent(in) :: T !< potential temperature relative to the surface
139  !! [degC].
140  real, intent(in) :: S !< salinity [PSU].
141  real, intent(in) :: pressure !< pressure [Pa].
142  real, intent(out) :: specvol !< in situ specific volume [m3 kg-1].
143  real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1].
144 
145  ! Local variables
146  real, dimension(1) :: T0, S0, pressure0, spv0
147 
148  t0(1) = t ; s0(1) = s ; pressure0(1) = pressure
149 
150  call calculate_spec_vol_array_unesco(t0, s0, pressure0, spv0, 1, 1, spv_ref)
151  specvol = spv0(1)

The documentation for this interface was generated from the following file: