MOM6
mom_eos::calculate_spec_vol Interface Reference

Detailed Description

Calculates specific volume of sea water from T, S and P.

Definition at line 65 of file MOM_EOS.F90.

Private functions

subroutine calculate_spec_vol_scalar (T, S, pressure, specvol, EOS, spv_ref, scale)
 Calls the appropriate subroutine to calculate specific volume of sea water for scalar inputs. More...
 
subroutine calculate_spec_vol_array (T, S, pressure, specvol, start, npts, EOS, spv_ref, scale)
 Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs. More...
 

Functions and subroutines

◆ calculate_spec_vol_array()

subroutine mom_eos::calculate_spec_vol::calculate_spec_vol_array ( 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,
type(eos_type), pointer  EOS,
real, intent(in), optional  spv_ref,
real, intent(in), optional  scale 
)
private

Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs.

Parameters
[in]tpotential temperature relative to the surface [degC].
[in]ssalinity [ppt].
[in]pressurepressure [Pa].
[out]specvolin situ specific volume [kg m-3] or [R-1 ~> m3 kg-1].
[in]startthe starting point in the arrays.
[in]nptsthe number of values to calculate.
eosEquation of state structure
[in]spv_refA reference specific volume [m3 kg-1].
[in]scaleA multiplicative factor by which to scale specific volume from m3 kg-1 to the desired units [kg m-3 R-1]

Definition at line 264 of file MOM_EOS.F90.

264  real, dimension(:), intent(in) :: T !< potential temperature relative to the surface
265  !! [degC].
266  real, dimension(:), intent(in) :: S !< salinity [ppt].
267  real, dimension(:), intent(in) :: pressure !< pressure [Pa].
268  real, dimension(:), intent(out) :: specvol !< in situ specific volume [kg m-3] or [R-1 ~> m3 kg-1].
269  integer, intent(in) :: start !< the starting point in the arrays.
270  integer, intent(in) :: npts !< the number of values to calculate.
271  type(EOS_type), pointer :: EOS !< Equation of state structure
272  real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1].
273  real, optional, intent(in) :: scale !< A multiplicative factor by which to scale specific volume
274  !! from m3 kg-1 to the desired units [kg m-3 R-1]
275 
276  real, dimension(size(specvol)) :: rho
277  integer :: j
278 
279  if (.not.associated(eos)) call mom_error(fatal, &
280  "calculate_spec_vol_array called with an unassociated EOS_type EOS.")
281 
282  select case (eos%form_of_EOS)
283  case (eos_linear)
284  call calculate_spec_vol_linear(t, s, pressure, specvol, start, npts, &
285  eos%rho_T0_S0, eos%drho_dT, eos%drho_dS, spv_ref)
286  case (eos_unesco)
287  call calculate_spec_vol_unesco(t, s, pressure, specvol, start, npts, spv_ref)
288  case (eos_wright)
289  call calculate_spec_vol_wright(t, s, pressure, specvol, start, npts, spv_ref)
290  case (eos_teos10)
291  call calculate_spec_vol_teos10(t, s, pressure, specvol, start, npts, spv_ref)
292  case (eos_nemo)
293  call calculate_density_nemo (t, s, pressure, rho, start, npts)
294  if (present(spv_ref)) then
295  specvol(:) = 1.0 / rho(:) - spv_ref
296  else
297  specvol(:) = 1.0 / rho(:)
298  endif
299  case default
300  call mom_error(fatal, &
301  "calculate_spec_vol_array: EOS%form_of_EOS is not valid.")
302  end select
303 
304  if (present(scale)) then ; if (scale /= 1.0) then ; do j=start,start+npts-1
305  specvol(j) = scale * specvol(j)
306  enddo ; endif ; endif
307 

◆ calculate_spec_vol_scalar()

subroutine mom_eos::calculate_spec_vol::calculate_spec_vol_scalar ( real, intent(in)  T,
real, intent(in)  S,
real, intent(in)  pressure,
real, intent(out)  specvol,
type(eos_type), pointer  EOS,
real, intent(in), optional  spv_ref,
real, intent(in), optional  scale 
)
private

Calls the appropriate subroutine to calculate specific volume of sea water for scalar inputs.

Parameters
[in]tPotential temperature referenced to the surface [degC]
[in]sSalinity [ppt]
[in]pressurePressure [Pa]
[out]specvolIn situ? specific volume [m3 kg-1] or [R-1 ~> m3 kg-1]
eosEquation of state structure
[in]spv_refA reference specific volume [m3 kg-1].
[in]scaleA multiplicative factor by which to scale specific volume from m3 kg-1 to the desired units [kg m-3 R-1]

Definition at line 218 of file MOM_EOS.F90.

218  real, intent(in) :: T !< Potential temperature referenced to the surface [degC]
219  real, intent(in) :: S !< Salinity [ppt]
220  real, intent(in) :: pressure !< Pressure [Pa]
221  real, intent(out) :: specvol !< In situ? specific volume [m3 kg-1] or [R-1 ~> m3 kg-1]
222  type(EOS_type), pointer :: EOS !< Equation of state structure
223  real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1].
224  real, optional, intent(in) :: scale !< A multiplicative factor by which to scale specific volume
225  !! from m3 kg-1 to the desired units [kg m-3 R-1]
226 
227  real :: rho
228 
229  if (.not.associated(eos)) call mom_error(fatal, &
230  "calculate_spec_vol_scalar called with an unassociated EOS_type EOS.")
231 
232  select case (eos%form_of_EOS)
233  case (eos_linear)
234  call calculate_spec_vol_linear(t, s, pressure, specvol, &
235  eos%rho_T0_S0, eos%drho_dT, eos%drho_dS, spv_ref)
236  case (eos_unesco)
237  call calculate_spec_vol_unesco(t, s, pressure, specvol, spv_ref)
238  case (eos_wright)
239  call calculate_spec_vol_wright(t, s, pressure, specvol, spv_ref)
240  case (eos_teos10)
241  call calculate_spec_vol_teos10(t, s, pressure, specvol, spv_ref)
242  case (eos_nemo)
243  call calculate_density_nemo(t, s, pressure, rho)
244  if (present(spv_ref)) then
245  specvol = 1.0 / rho - spv_ref
246  else
247  specvol = 1.0 / rho
248  endif
249  case default
250  call mom_error(fatal, &
251  "calculate_spec_vol_scalar: EOS is not valid.")
252  end select
253 
254  if (present(scale)) then ; if (scale /= 1.0) then
255  specvol = scale * specvol
256  endif ; endif
257 

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