MOM6
Private Member Functions | List of all members
mom_eos::calculate_specific_vol_derivs Interface Reference

Calculate the derivatives of specific volume with temperature and salinity from T, S, and P. More...

Private Member Functions

subroutine calculate_spec_vol_derivs_array (T, S, pressure, dSV_dT, dSV_dS, start, npts, EOS)
 Calls the appropriate subroutine to calculate specific volume derivatives for an array. More...
 
subroutine calc_spec_vol_derivs_1d (T, S, pressure, dSV_dT, dSV_dS, EOS, dom, scale)
 Calls the appropriate subroutine to calculate specific volume derivatives for 1-d array inputs, potentially limiting the domain of indices that are worked on. More...
 

Detailed Description

Calculate the derivatives of specific volume with temperature and salinity from T, S, and P.

Definition at line 87 of file MOM_EOS.F90.

Member Function/Subroutine Documentation

◆ calc_spec_vol_derivs_1d()

subroutine mom_eos::calculate_specific_vol_derivs::calc_spec_vol_derivs_1d ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(inout)  dSV_dT,
real, dimension(:), intent(inout)  dSV_dS,
type(eos_type), pointer  EOS,
integer, dimension(2), intent(in), optional  dom,
real, intent(in), optional  scale 
)
private

Calls the appropriate subroutine to calculate specific volume derivatives for 1-d array inputs, potentially limiting the domain of indices that are worked on.

Parameters
[in]tPotential temperature referenced to the surface [degC]
[in]sSalinity [ppt]
[in]pressurePressure [R L2 T-2 ~> Pa]
[in,out]dsv_dtThe partial derivative of specific volume with potential temperature [R-1 degC-1 ~> m3 kg-1 degC-1]
[in,out]dsv_dsThe partial derivative of specific volume with salinity [R-1 ppt-1 ~> m3 kg-1 ppt-1]
eosEquation of state structure
[in]domThe domain of indices to work on, taking into account that arrays start at 1.
[in]scaleA multiplicative factor by which to scale specific volume in combination with scaling given by US [various]

Definition at line 1040 of file MOM_EOS.F90.

1040  real, dimension(:), intent(in) :: t !< Potential temperature referenced to the surface [degC]
1041  real, dimension(:), intent(in) :: s !< Salinity [ppt]
1042  real, dimension(:), intent(in) :: pressure !< Pressure [R L2 T-2 ~> Pa]
1043  real, dimension(:), intent(inout) :: dsv_dt !< The partial derivative of specific volume with potential
1044  !! temperature [R-1 degC-1 ~> m3 kg-1 degC-1]
1045  real, dimension(:), intent(inout) :: dsv_ds !< The partial derivative of specific volume with salinity
1046  !! [R-1 ppt-1 ~> m3 kg-1 ppt-1]
1047  type(eos_type), pointer :: eos !< Equation of state structure
1048  integer, dimension(2), optional, intent(in) :: dom !< The domain of indices to work on, taking
1049  !! into account that arrays start at 1.
1050  real, optional, intent(in) :: scale !< A multiplicative factor by which to scale specific
1051  !! volume in combination with scaling given by US [various]
1052 
1053  ! Local variables
1054  real, dimension(size(dSV_dT)) :: press ! Pressure converted to [Pa]
1055  real :: spv_scale ! A factor to convert specific volume from m3 kg-1 to the desired units [kg R-1 m-3 ~> 1]
1056  real :: p_scale ! A factor to convert pressure to units of Pa [Pa T2 R-1 L-2 ~> 1]
1057  integer :: i, is, ie, npts
1058 
1059  if (.not.associated(eos)) call mom_error(fatal, &
1060  "calculate_spec_vol_derivs_1d called with an unassociated EOS_type EOS.")
1061 
1062  if (present(dom)) then
1063  is = dom(1) ; ie = dom(2) ; npts = 1 + ie - is
1064  else
1065  is = 1 ; ie = size(dsv_dt) ; npts = 1 + ie - is
1066  endif
1067  p_scale = eos%RL2_T2_to_Pa
1068 
1069  if (p_scale == 1.0) then
1070  call calculate_spec_vol_derivs_array(t, s, pressure, dsv_dt, dsv_ds, is, npts, eos)
1071  else
1072  do i=is,ie ; press(i) = p_scale * pressure(i) ; enddo
1073  call calculate_spec_vol_derivs_array(t, s, press, dsv_dt, dsv_ds, is, npts, eos)
1074  endif
1075 
1076  spv_scale = eos%R_to_kg_m3
1077  if (present(scale)) spv_scale = spv_scale * scale
1078  if (spv_scale /= 1.0) then ; do i=is,ie
1079  dsv_dt(i) = spv_scale * dsv_dt(i)
1080  dsv_ds(i) = spv_scale * dsv_ds(i)
1081  enddo ; endif
1082 

◆ calculate_spec_vol_derivs_array()

subroutine mom_eos::calculate_specific_vol_derivs::calculate_spec_vol_derivs_array ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(inout)  dSV_dT,
real, dimension(:), intent(inout)  dSV_dS,
integer, intent(in)  start,
integer, intent(in)  npts,
type(eos_type), pointer  EOS 
)
private

Calls the appropriate subroutine to calculate specific volume derivatives for an array.

Parameters
[in]tPotential temperature referenced to the surface [degC]
[in]sSalinity [ppt]
[in]pressurePressure [Pa]
[in,out]dsv_dtThe partial derivative of specific volume with potential temperature [m3 kg-1 degC-1]
[in,out]dsv_dsThe partial derivative of specific volume with salinity [m3 kg-1 ppt-1]
[in]startStarting index within the array
[in]nptsThe number of values to calculate
eosEquation of state structure

Definition at line 988 of file MOM_EOS.F90.

988  real, dimension(:), intent(in) :: t !< Potential temperature referenced to the surface [degC]
989  real, dimension(:), intent(in) :: s !< Salinity [ppt]
990  real, dimension(:), intent(in) :: pressure !< Pressure [Pa]
991  real, dimension(:), intent(inout) :: dsv_dt !< The partial derivative of specific volume with potential
992  !! temperature [m3 kg-1 degC-1]
993  real, dimension(:), intent(inout) :: dsv_ds !< The partial derivative of specific volume with salinity
994  !! [m3 kg-1 ppt-1]
995  integer, intent(in) :: start !< Starting index within the array
996  integer, intent(in) :: npts !< The number of values to calculate
997  type(eos_type), pointer :: eos !< Equation of state structure
998 
999  ! Local variables
1000  real, dimension(size(T)) :: press ! Pressure converted to [Pa]
1001  real, dimension(size(T)) :: rho ! In situ density [kg m-3]
1002  real, dimension(size(T)) :: drho_dt ! Derivative of density with temperature [kg m-3 degC-1]
1003  real, dimension(size(T)) :: drho_ds ! Derivative of density with salinity [kg m-3 ppt-1]
1004  integer :: j
1005 
1006  if (.not.associated(eos)) call mom_error(fatal, &
1007  "calculate_spec_vol_derivs_array called with an unassociated EOS_type EOS.")
1008 
1009  select case (eos%form_of_EOS)
1010  case (eos_linear)
1011  call calculate_specvol_derivs_linear(t, s, pressure, dsv_dt, dsv_ds, start, &
1012  npts, eos%Rho_T0_S0, eos%dRho_dT, eos%dRho_dS)
1013  case (eos_unesco)
1014  call calculate_density_unesco(t, s, pressure, rho, start, npts)
1015  call calculate_density_derivs_unesco(t, s, pressure, drho_dt, drho_ds, start, npts)
1016  do j=start,start+npts-1
1017  dsv_dt(j) = -drho_dt(j)/(rho(j)**2)
1018  dsv_ds(j) = -drho_ds(j)/(rho(j)**2)
1019  enddo
1020  case (eos_wright)
1021  call calculate_specvol_derivs_wright(t, s, pressure, dsv_dt, dsv_ds, start, npts)
1022  case (eos_teos10)
1023  call calculate_specvol_derivs_teos10(t, s, pressure, dsv_dt, dsv_ds, start, npts)
1024  case (eos_nemo)
1025  call calculate_density_nemo(t, s, pressure, rho, start, npts)
1026  call calculate_density_derivs_nemo(t, s, pressure, drho_dt, drho_ds, start, npts)
1027  do j=start,start+npts-1
1028  dsv_dt(j) = -drho_dt(j)/(rho(j)**2)
1029  dsv_ds(j) = -drho_ds(j)/(rho(j)**2)
1030  enddo
1031  case default
1032  call mom_error(fatal, "calculate_spec_vol_derivs_array: EOS%form_of_EOS is not valid.")
1033  end select
1034 

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