MOM6
mom_eos::calculate_density_derivs Interface Reference

Detailed Description

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

Definition at line 70 of file MOM_EOS.F90.

Private functions

subroutine calculate_density_derivs_scalar (T, S, pressure, drho_dT, drho_dS, EOS, scale)
 Calls the appropriate subroutines to calculate density derivatives by promoting a scalar to a one-element array. More...
 
subroutine calculate_density_derivs_array (T, S, pressure, drho_dT, drho_dS, start, npts, EOS, scale)
 Calls the appropriate subroutine to calculate density derivatives for 1-D array inputs. More...
 

Functions and subroutines

◆ calculate_density_derivs_array()

subroutine mom_eos::calculate_density_derivs::calculate_density_derivs_array ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  drho_dT,
real, dimension(:), intent(out)  drho_dS,
integer, intent(in)  start,
integer, intent(in)  npts,
type(eos_type), pointer  EOS,
real, intent(in), optional  scale 
)
private

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

Parameters
[in]tPotential temperature referenced to the surface [degC]
[in]sSalinity [ppt]
[in]pressurePressure [Pa]
[out]drho_dtThe partial derivative of density with potential temperature [kg m-3 degC-1] or [R degC-1 ~> kg m-3 degC-1].
[out]drho_dsThe partial derivative of density with salinity, in [kg m-3 ppt-1] or [R degC-1 ~> kg m-3 ppt-1].
[in]startStarting index within the array
[in]nptsThe number of values to calculate
eosEquation of state structure
[in]scaleA multiplicative factor by which to scale density from kg m-3 to the desired units [R m3 kg-1]

Definition at line 367 of file MOM_EOS.F90.

367  real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface [degC]
368  real, dimension(:), intent(in) :: S !< Salinity [ppt]
369  real, dimension(:), intent(in) :: pressure !< Pressure [Pa]
370  real, dimension(:), intent(out) :: drho_dT !< The partial derivative of density with potential
371  !! temperature [kg m-3 degC-1] or [R degC-1 ~> kg m-3 degC-1].
372  real, dimension(:), intent(out) :: drho_dS !< The partial derivative of density with salinity,
373  !! in [kg m-3 ppt-1] or [R degC-1 ~> kg m-3 ppt-1].
374  integer, intent(in) :: start !< Starting index within the array
375  integer, intent(in) :: npts !< The number of values to calculate
376  type(EOS_type), pointer :: EOS !< Equation of state structure
377  real, optional, intent(in) :: scale !< A multiplicative factor by which to scale density
378  !! from kg m-3 to the desired units [R m3 kg-1]
379  integer :: j
380 
381  if (.not.associated(eos)) call mom_error(fatal, &
382  "calculate_density_derivs called with an unassociated EOS_type EOS.")
383 
384  select case (eos%form_of_EOS)
385  case (eos_linear)
386  call calculate_density_derivs_linear(t, s, pressure, drho_dt, drho_ds, eos%Rho_T0_S0, &
387  eos%dRho_dT, eos%dRho_dS, start, npts)
388  case (eos_unesco)
389  call calculate_density_derivs_unesco(t, s, pressure, drho_dt, drho_ds, start, npts)
390  case (eos_wright)
391  call calculate_density_derivs_wright(t, s, pressure, drho_dt, drho_ds, start, npts)
392  case (eos_teos10)
393  call calculate_density_derivs_teos10(t, s, pressure, drho_dt, drho_ds, start, npts)
394  case (eos_nemo)
395  call calculate_density_derivs_nemo(t, s, pressure, drho_dt, drho_ds, start, npts)
396  case default
397  call mom_error(fatal, &
398  "calculate_density_derivs_array: EOS%form_of_EOS is not valid.")
399  end select
400 
401  if (present(scale)) then ; if (scale /= 1.0) then ; do j=start,start+npts-1
402  drho_dt(j) = scale * drho_dt(j)
403  drho_ds(j) = scale * drho_ds(j)
404  enddo ; endif ; endif
405 

◆ calculate_density_derivs_scalar()

subroutine mom_eos::calculate_density_derivs::calculate_density_derivs_scalar ( real, intent(in)  T,
real, intent(in)  S,
real, intent(in)  pressure,
real, intent(out)  drho_dT,
real, intent(out)  drho_dS,
type(eos_type), pointer  EOS,
real, intent(in), optional  scale 
)
private

Calls the appropriate subroutines to calculate density derivatives by promoting a scalar to a one-element array.

Parameters
[in]tPotential temperature referenced to the surface [degC]
[in]sSalinity [ppt]
[in]pressurePressure [Pa]
[out]drho_dtThe partial derivative of density with potential temperature [kg m-3 degC-1] or [R degC-1 ~> kg m-3 degC-1]
[out]drho_dsThe partial derivative of density with salinity, in [kg m-3 ppt-1] or [R ppt-1 ~> kg m-3 ppt-1].
eosEquation of state structure
[in]scaleA multiplicative factor by which to scale density from kg m-3 to the desired units [R m3 kg-1]

Definition at line 411 of file MOM_EOS.F90.

411  real, intent(in) :: T !< Potential temperature referenced to the surface [degC]
412  real, intent(in) :: S !< Salinity [ppt]
413  real, intent(in) :: pressure !< Pressure [Pa]
414  real, intent(out) :: drho_dT !< The partial derivative of density with potential
415  !! temperature [kg m-3 degC-1] or [R degC-1 ~> kg m-3 degC-1]
416  real, intent(out) :: drho_dS !< The partial derivative of density with salinity,
417  !! in [kg m-3 ppt-1] or [R ppt-1 ~> kg m-3 ppt-1].
418  type(EOS_type), pointer :: EOS !< Equation of state structure
419  real, optional, intent(in) :: scale !< A multiplicative factor by which to scale density
420  !! from kg m-3 to the desired units [R m3 kg-1]
421 
422  if (.not.associated(eos)) call mom_error(fatal, &
423  "calculate_density_derivs called with an unassociated EOS_type EOS.")
424 
425  select case (eos%form_of_EOS)
426  case (eos_linear)
427  call calculate_density_derivs_linear(t, s, pressure, drho_dt, drho_ds, &
428  eos%Rho_T0_S0, eos%dRho_dT, eos%dRho_dS)
429  case (eos_wright)
430  call calculate_density_derivs_wright(t, s, pressure, drho_dt, drho_ds)
431  case (eos_teos10)
432  call calculate_density_derivs_teos10(t, s, pressure, drho_dt, drho_ds)
433  case default
434  call mom_error(fatal, &
435  "calculate_density_derivs_scalar: EOS%form_of_EOS is not valid.")
436  end select
437 
438  if (present(scale)) then ; if (scale /= 1.0) then
439  drho_dt = scale * drho_dt
440  drho_ds = scale * drho_ds
441  endif ; endif
442 

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