MOM6
mom_eos::calculate_density_second_derivs Interface Reference

Detailed Description

Calculates the second derivatives of density with various combinations of temperature, salinity, and pressure from T, S and P.

Definition at line 76 of file MOM_EOS.F90.

Private functions

subroutine calculate_density_second_derivs_scalar (T, S, pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT, drho_dS_dP, drho_dT_dP, EOS, scale)
 Calls the appropriate subroutine to calculate density second derivatives for scalar nputs. More...
 
subroutine calculate_density_second_derivs_array (T, S, pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT, drho_dS_dP, drho_dT_dP, start, npts, EOS, scale)
 Calls the appropriate subroutine to calculate density second derivatives for 1-D array inputs. More...
 

Functions and subroutines

◆ calculate_density_second_derivs_array()

subroutine mom_eos::calculate_density_second_derivs::calculate_density_second_derivs_array ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  drho_dS_dS,
real, dimension(:), intent(out)  drho_dS_dT,
real, dimension(:), intent(out)  drho_dT_dT,
real, dimension(:), intent(out)  drho_dS_dP,
real, dimension(:), intent(out)  drho_dT_dP,
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 second derivatives for 1-D array inputs.

Parameters
[in]tPotential temperature referenced to the surface [degC]
[in]sSalinity [ppt]
[in]pressurePressure [Pa]
[out]drho_ds_dsPartial derivative of beta with respect to S [kg m-3 ppt-2] or [R ppt-2 ~> kg m-3 ppt-2]
[out]drho_ds_dtPartial derivative of beta with respect to T [kg m-3 ppt-1 degC-1] or [R ppt-1 degC-1 ~> kg m-3 ppt-1 degC-1]
[out]drho_dt_dtPartial derivative of alpha with respect to T [kg m-3 degC-2] or [R degC-2 ~> kg m-3 degC-2]
[out]drho_ds_dpPartial derivative of beta with respect to pressure [kg m-3 ppt-1 Pa-1] or [R ppt-1 Pa-1 ~> kg m-3 ppt-1 Pa-1]
[out]drho_dt_dpPartial derivative of alpha with respect to pressure [kg m-3 degC-1 Pa-1] or [R degC-1 Pa-1 ~> kg m-3 degC-1 Pa-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 448 of file MOM_EOS.F90.

448  real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface [degC]
449  real, dimension(:), intent(in) :: S !< Salinity [ppt]
450  real, dimension(:), intent(in) :: pressure !< Pressure [Pa]
451  real, dimension(:), intent(out) :: drho_dS_dS !< Partial derivative of beta with respect to S
452  !! [kg m-3 ppt-2] or [R ppt-2 ~> kg m-3 ppt-2]
453  real, dimension(:), intent(out) :: drho_dS_dT !< Partial derivative of beta with respect to T
454  !! [kg m-3 ppt-1 degC-1] or [R ppt-1 degC-1 ~> kg m-3 ppt-1 degC-1]
455  real, dimension(:), intent(out) :: drho_dT_dT !< Partial derivative of alpha with respect to T
456  !! [kg m-3 degC-2] or [R degC-2 ~> kg m-3 degC-2]
457  real, dimension(:), intent(out) :: drho_dS_dP !< Partial derivative of beta with respect to pressure
458  !! [kg m-3 ppt-1 Pa-1] or [R ppt-1 Pa-1 ~> kg m-3 ppt-1 Pa-1]
459  real, dimension(:), intent(out) :: drho_dT_dP !< Partial derivative of alpha with respect to pressure
460  !! [kg m-3 degC-1 Pa-1] or [R degC-1 Pa-1 ~> kg m-3 degC-1 Pa-1]
461  integer, intent(in) :: start !< Starting index within the array
462  integer, intent(in) :: npts !< The number of values to calculate
463  type(EOS_type), pointer :: EOS !< Equation of state structure
464  real, optional, intent(in) :: scale !< A multiplicative factor by which to scale density
465  !! from kg m-3 to the desired units [R m3 kg-1]
466  integer :: j
467 
468  if (.not.associated(eos)) call mom_error(fatal, &
469  "calculate_density_derivs called with an unassociated EOS_type EOS.")
470 
471  select case (eos%form_of_EOS)
472  case (eos_linear)
473  call calculate_density_second_derivs_linear(t, s, pressure, drho_ds_ds, drho_ds_dt, &
474  drho_dt_dt, drho_ds_dp, drho_dt_dp, start, npts)
475  case (eos_wright)
476  call calculate_density_second_derivs_wright(t, s, pressure, drho_ds_ds, drho_ds_dt, &
477  drho_dt_dt, drho_ds_dp, drho_dt_dp, start, npts)
478  case (eos_teos10)
479  call calculate_density_second_derivs_teos10(t, s, pressure, drho_ds_ds, drho_ds_dt, &
480  drho_dt_dt, drho_ds_dp, drho_dt_dp, start, npts)
481  case default
482  call mom_error(fatal, &
483  "calculate_density_derivs: EOS%form_of_EOS is not valid.")
484  end select
485 
486  if (present(scale)) then ; if (scale /= 1.0) then ; do j=start,start+npts-1
487  drho_ds_ds(j) = scale * drho_ds_ds(j)
488  drho_ds_dt(j) = scale * drho_ds_dt(j)
489  drho_dt_dt(j) = scale * drho_dt_dt(j)
490  drho_ds_dp(j) = scale * drho_ds_dp(j)
491  drho_dt_dp(j) = scale * drho_dt_dp(j)
492  enddo ; endif ; endif
493 

◆ calculate_density_second_derivs_scalar()

subroutine mom_eos::calculate_density_second_derivs::calculate_density_second_derivs_scalar ( real, intent(in)  T,
real, intent(in)  S,
real, intent(in)  pressure,
real, intent(out)  drho_dS_dS,
real, intent(out)  drho_dS_dT,
real, intent(out)  drho_dT_dT,
real, intent(out)  drho_dS_dP,
real, intent(out)  drho_dT_dP,
type(eos_type), pointer  EOS,
real, intent(in), optional  scale 
)
private

Calls the appropriate subroutine to calculate density second derivatives for scalar nputs.

Parameters
[in]tPotential temperature referenced to the surface [degC]
[in]sSalinity [ppt]
[in]pressurePressure [Pa]
[out]drho_ds_dsPartial derivative of beta with respect to S [kg m-3 ppt-2] or [R ppt-2 ~> kg m-3 ppt-2]
[out]drho_ds_dtPartial derivative of beta with respect to T [kg m-3 ppt-1 degC-1] or [R ppt-1 degC-1 ~> kg m-3 ppt-1 degC-1]
[out]drho_dt_dtPartial derivative of alpha with respect to T [kg m-3 degC-2] or [R degC-2 ~> kg m-3 degC-2]
[out]drho_ds_dpPartial derivative of beta with respect to pressure [kg m-3 ppt-1 Pa-1] or [R ppt-1 Pa-1 ~> kg m-3 ppt-1 Pa-1]
[out]drho_dt_dpPartial derivative of alpha with respect to pressure [kg m-3 degC-1 Pa-1] or [R degC-1 Pa-1 ~> kg m-3 degC-1 Pa-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 499 of file MOM_EOS.F90.

499  real, intent(in) :: T !< Potential temperature referenced to the surface [degC]
500  real, intent(in) :: S !< Salinity [ppt]
501  real, intent(in) :: pressure !< Pressure [Pa]
502  real, intent(out) :: drho_dS_dS !< Partial derivative of beta with respect to S
503  !! [kg m-3 ppt-2] or [R ppt-2 ~> kg m-3 ppt-2]
504  real, intent(out) :: drho_dS_dT !< Partial derivative of beta with respect to T
505  !! [kg m-3 ppt-1 degC-1] or [R ppt-1 degC-1 ~> kg m-3 ppt-1 degC-1]
506  real, intent(out) :: drho_dT_dT !< Partial derivative of alpha with respect to T
507  !! [kg m-3 degC-2] or [R degC-2 ~> kg m-3 degC-2]
508  real, intent(out) :: drho_dS_dP !< Partial derivative of beta with respect to pressure
509  !! [kg m-3 ppt-1 Pa-1] or [R ppt-1 Pa-1 ~> kg m-3 ppt-1 Pa-1]
510  real, intent(out) :: drho_dT_dP !< Partial derivative of alpha with respect to pressure
511  !! [kg m-3 degC-1 Pa-1] or [R degC-1 Pa-1 ~> kg m-3 degC-1 Pa-1]
512  type(EOS_type), pointer :: EOS !< Equation of state structure
513  real, optional, intent(in) :: scale !< A multiplicative factor by which to scale density
514  !! from kg m-3 to the desired units [R m3 kg-1]
515 
516  if (.not.associated(eos)) call mom_error(fatal, &
517  "calculate_density_derivs called with an unassociated EOS_type EOS.")
518 
519  select case (eos%form_of_EOS)
520  case (eos_linear)
521  call calculate_density_second_derivs_linear(t, s, pressure, drho_ds_ds, drho_ds_dt, &
522  drho_dt_dt, drho_ds_dp, drho_dt_dp)
523  case (eos_wright)
524  call calculate_density_second_derivs_wright(t, s, pressure, drho_ds_ds, drho_ds_dt, &
525  drho_dt_dt, drho_ds_dp, drho_dt_dp)
526  case (eos_teos10)
527  call calculate_density_second_derivs_teos10(t, s, pressure, drho_ds_ds, drho_ds_dt, &
528  drho_dt_dt, drho_ds_dp, drho_dt_dp)
529  case default
530  call mom_error(fatal, &
531  "calculate_density_derivs: EOS%form_of_EOS is not valid.")
532  end select
533 
534  if (present(scale)) then ; if (scale /= 1.0) then
535  drho_ds_ds = scale * drho_ds_ds
536  drho_ds_dt = scale * drho_ds_dt
537  drho_dt_dt = scale * drho_dt_dt
538  drho_ds_dp = scale * drho_ds_dp
539  drho_dt_dp = scale * drho_dt_dp
540  endif ; endif
541 

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