MOM6
mom_eos::calculate_compress Interface Reference

Detailed Description

Calculates the compressibility of water from T, S, and P.

Definition at line 86 of file MOM_EOS.F90.

Private functions

subroutine calculate_compress_scalar (T, S, pressure, rho, drho_dp, EOS)
 Calculate density and compressibility for a scalar. This just promotes the scalar to an array with a singleton dimension and calls calculate_compress_array. More...
 
subroutine calculate_compress_array (T, S, pressure, rho, drho_dp, start, npts, EOS)
 Calls the appropriate subroutine to calculate the density and compressibility for 1-D array inputs. More...
 

Functions and subroutines

◆ calculate_compress_array()

subroutine mom_eos::calculate_compress::calculate_compress_array ( 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,
type(eos_type), pointer  EOS 
)
private

Calls the appropriate subroutine to calculate the density and compressibility for 1-D array inputs.

Parameters
[in]tPotential temperature referenced to the surface [degC]
[in]sSalinity [PSU]
[in]pressurePressure [Pa]
[out]rhoIn situ density [kg m-3].
[out]drho_dpThe partial derivative of density with pressure (also the inverse of the square of sound speed) [s2 m-2].
[in]startStarting index within the array
[in]nptsThe number of values to calculate
eosEquation of state structure

Definition at line 603 of file MOM_EOS.F90.

603  real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface [degC]
604  real, dimension(:), intent(in) :: S !< Salinity [PSU]
605  real, dimension(:), intent(in) :: pressure !< Pressure [Pa]
606  real, dimension(:), intent(out) :: rho !< In situ density [kg m-3].
607  real, dimension(:), intent(out) :: drho_dp !< The partial derivative of density with pressure
608  !! (also the inverse of the square of sound speed) [s2 m-2].
609  integer, intent(in) :: start !< Starting index within the array
610  integer, intent(in) :: npts !< The number of values to calculate
611  type(EOS_type), pointer :: EOS !< Equation of state structure
612 
613  if (.not.associated(eos)) call mom_error(fatal, &
614  "calculate_compress called with an unassociated EOS_type EOS.")
615 
616  select case (eos%form_of_EOS)
617  case (eos_linear)
618  call calculate_compress_linear(t, s, pressure, rho, drho_dp, start, npts, &
619  eos%Rho_T0_S0, eos%dRho_dT, eos%dRho_dS)
620  case (eos_unesco)
621  call calculate_compress_unesco(t, s, pressure, rho, drho_dp, start, npts)
622  case (eos_wright)
623  call calculate_compress_wright(t, s, pressure, rho, drho_dp, start, npts)
624  case (eos_teos10)
625  call calculate_compress_teos10(t, s, pressure, rho, drho_dp, start, npts)
626  case (eos_nemo)
627  call calculate_compress_nemo(t, s, pressure, rho, drho_dp, start, npts)
628  case default
629  call mom_error(fatal, &
630  "calculate_compress: EOS%form_of_EOS is not valid.")
631  end select
632 

◆ calculate_compress_scalar()

subroutine mom_eos::calculate_compress::calculate_compress_scalar ( real, intent(in)  T,
real, intent(in)  S,
real, intent(in)  pressure,
real, intent(out)  rho,
real, intent(out)  drho_dp,
type(eos_type), pointer  EOS 
)
private

Calculate density and compressibility for a scalar. This just promotes the scalar to an array with a singleton dimension and calls calculate_compress_array.

Parameters
[in]tPotential temperature referenced to the surface (degC)
[in]sSalinity (PSU)
[in]pressurePressure (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.
eosEquation of state structure

Definition at line 638 of file MOM_EOS.F90.

638  real, intent(in) :: T !< Potential temperature referenced to the surface (degC)
639  real, intent(in) :: S !< Salinity (PSU)
640  real, intent(in) :: pressure !< Pressure (Pa)
641  real, intent(out) :: rho !< In situ density in kg m-3.
642  real, intent(out) :: drho_dp !< The partial derivative of density with pressure
643  !! (also the inverse of the square of sound speed) in s2 m-2.
644  type(EOS_type), pointer :: EOS !< Equation of state structure
645 
646  real, dimension(1) :: Ta, Sa, pa, rhoa, drho_dpa
647 
648  if (.not.associated(eos)) call mom_error(fatal, &
649  "calculate_compress called with an unassociated EOS_type EOS.")
650  ta(1) = t ; sa(1) = s; pa(1) = pressure
651 
652  call calculate_compress_array(ta, sa, pa, rhoa, drho_dpa, 1, 1, eos)
653  rho = rhoa(1) ; drho_dp = drho_dpa(1)
654 

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