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

Definition at line 240 of file MOM_EOS.F90.

240  real, dimension(:), intent(in) :: T !< potential temperature relative to the surface
241  !! [degC].
242  real, dimension(:), intent(in) :: S !< salinity [ppt].
243  real, dimension(:), intent(in) :: pressure !< pressure [Pa].
244  real, dimension(:), intent(out) :: specvol !< in situ specific volume [kg m-3].
245  integer, intent(in) :: start !< the starting point in the arrays.
246  integer, intent(in) :: npts !< the number of values to calculate.
247  type(EOS_type), pointer :: EOS !< Equation of state structure
248  real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1].
249 
250  real, dimension(size(specvol)) :: rho
251 
252 
253  if (.not.associated(eos)) call mom_error(fatal, &
254  "calculate_spec_vol_array called with an unassociated EOS_type EOS.")
255 
256  select case (eos%form_of_EOS)
257  case (eos_linear)
258  call calculate_spec_vol_linear(t, s, pressure, specvol, start, npts, &
259  eos%rho_T0_S0, eos%drho_dT, eos%drho_dS, spv_ref)
260  case (eos_unesco)
261  call calculate_spec_vol_unesco(t, s, pressure, specvol, start, npts, spv_ref)
262  case (eos_wright)
263  call calculate_spec_vol_wright(t, s, pressure, specvol, start, npts, spv_ref)
264  case (eos_teos10)
265  call calculate_spec_vol_teos10(t, s, pressure, specvol, start, npts, spv_ref)
266  case (eos_nemo)
267  call calculate_density_nemo (t, s, pressure, rho, start, npts)
268  if (present(spv_ref)) then
269  specvol(:) = 1.0 / rho(:) - spv_ref
270  else
271  specvol(:) = 1.0 / rho(:)
272  endif
273  case default
274  call mom_error(fatal, &
275  "calculate_spec_vol_array: EOS%form_of_EOS is not valid.")
276  end select
277 

◆ 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 
)
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]specvolspecific volume (in-situ if pressure is local) [m3 kg-1]
eosEquation of state structure
[in]spv_refA reference specific volume [m3 kg-1].

Definition at line 200 of file MOM_EOS.F90.

200  real, intent(in) :: T !< Potential temperature referenced to the surface [degC]
201  real, intent(in) :: S !< Salinity [ppt]
202  real, intent(in) :: pressure !< Pressure [Pa]
203  real, intent(out) :: specvol !< specific volume (in-situ if pressure is local) [m3 kg-1]
204  type(EOS_type), pointer :: EOS !< Equation of state structure
205  real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1].
206 
207  real :: rho
208 
209  if (.not.associated(eos)) call mom_error(fatal, &
210  "calculate_spec_vol_scalar called with an unassociated EOS_type EOS.")
211 
212  select case (eos%form_of_EOS)
213  case (eos_linear)
214  call calculate_spec_vol_linear(t, s, pressure, specvol, &
215  eos%rho_T0_S0, eos%drho_dT, eos%drho_dS, spv_ref)
216  case (eos_unesco)
217  call calculate_spec_vol_unesco(t, s, pressure, specvol, spv_ref)
218  case (eos_wright)
219  call calculate_spec_vol_wright(t, s, pressure, specvol, spv_ref)
220  case (eos_teos10)
221  call calculate_spec_vol_teos10(t, s, pressure, specvol, spv_ref)
222  case (eos_nemo)
223  call calculate_density_nemo(t, s, pressure, rho)
224  if (present(spv_ref)) then
225  specvol = 1.0 / rho - spv_ref
226  else
227  specvol = 1.0 / rho
228  endif
229  case default
230  call mom_error(fatal, &
231  "calculate_spec_vol_scalar: EOS is not valid.")
232  end select
233 

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