Calculates the compressibility of water from T, S, and P.
Definition at line 103 of file MOM_EOS.F90.
|
| 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. If US is present, the units of the inputs and outputs are rescaled. More...
|
| |
| subroutine | calculate_compress_array (T, S, press, rho, drho_dp, start, npts, EOS) |
| | Calls the appropriate subroutine to calculate the density and compressibility for 1-D array inputs. If US is present, the units of the inputs and outputs are rescaled. More...
|
| |
Calculates the compressibility of water from T, S, and P.
Definition at line 103 of file MOM_EOS.F90.
◆ 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) |
press, |
|
|
real, dimension(:), intent(inout) |
rho, |
|
|
real, dimension(:), intent(inout) |
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. If US is present, the units of the inputs and outputs are rescaled.
- Parameters
-
| [in] | t | Potential temperature referenced to the surface [degC] |
| [in] | s | Salinity [PSU] |
| [in] | press | Pressure [Pa] or [R L2 T-2 ~> Pa] |
| [in,out] | rho | In situ density [kg m-3] or [R ~> kg m-3] |
| [in,out] | drho_dp | The partial derivative of density with pressure (also the inverse of the square of sound speed) [s2 m-2] or [T2 L-2] |
| [in] | start | Starting index within the array |
| [in] | npts | The number of values to calculate |
| eos | Equation of state structure |
Definition at line 1089 of file MOM_EOS.F90.
1089 real,
dimension(:),
intent(in) :: T
1090 real,
dimension(:),
intent(in) :: S
1091 real,
dimension(:),
intent(in) :: press
1092 real,
dimension(:),
intent(inout) :: rho
1093 real,
dimension(:),
intent(inout) :: drho_dp
1096 integer,
intent(in) :: start
1097 integer,
intent(in) :: npts
1098 type(EOS_type),
pointer :: EOS
1101 real,
dimension(size(press)) :: pressure
1102 integer :: i, is, ie
1104 if (.not.
associated(eos))
call mom_error(fatal, &
1105 "calculate_compress called with an unassociated EOS_type EOS.")
1107 is = start ; ie = is + npts - 1
1108 do i=is,ie ; pressure(i) = eos%RL2_T2_to_Pa * press(i) ;
enddo
1110 select case (eos%form_of_EOS)
1112 call calculate_compress_linear(t, s, pressure, rho, drho_dp, start, npts, &
1113 eos%Rho_T0_S0, eos%dRho_dT, eos%dRho_dS)
1115 call calculate_compress_unesco(t, s, pressure, rho, drho_dp, start, npts)
1117 call calculate_compress_wright(t, s, pressure, rho, drho_dp, start, npts)
1119 call calculate_compress_teos10(t, s, pressure, rho, drho_dp, start, npts)
1121 call calculate_compress_nemo(t, s, pressure, rho, drho_dp, start, npts)
1123 call mom_error(fatal,
"calculate_compress: EOS%form_of_EOS is not valid.")
1126 if (eos%kg_m3_to_R /= 1.0)
then ;
do i=is,ie
1127 rho(i) = eos%kg_m3_to_R * rho(i)
1129 if (eos%L_T_to_m_s /= 1.0)
then ;
do i=is,ie
1130 drho_dp(i) = eos%L_T_to_m_s**2 * drho_dp(i)
◆ 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. If US is present, the units of the inputs and outputs are rescaled.
- Parameters
-
| [in] | t | Potential temperature referenced to the surface [degC] |
| [in] | s | Salinity [ppt] |
| [in] | pressure | Pressure [Pa] or [R L2 T-2 ~> Pa] |
| [out] | rho | In situ density [kg m-3] or [R ~> kg m-3] |
| [out] | drho_dp | The partial derivative of density with pressure (also the inverse of the square of sound speed) [s2 m-2] or [T2 L-2] |
| eos | Equation of state structure |
Definition at line 1139 of file MOM_EOS.F90.
1139 real,
intent(in) :: T
1140 real,
intent(in) :: S
1141 real,
intent(in) :: pressure
1142 real,
intent(out) :: rho
1143 real,
intent(out) :: drho_dp
1145 type(EOS_type),
pointer :: EOS
1148 real,
dimension(1) :: Ta, Sa, pa, rhoa, drho_dpa
1150 if (.not.
associated(eos))
call mom_error(fatal, &
1151 "calculate_compress called with an unassociated EOS_type EOS.")
1152 ta(1) = t ; sa(1) = s; pa(1) = pressure
1154 call calculate_compress_array(ta, sa, pa, rhoa, drho_dpa, 1, 1, eos)
1155 rho = rhoa(1) ; drho_dp = drho_dpa(1)
The documentation for this interface was generated from the following file:
- /home/cermak/src/MOM6.devrob/src/equation_of_state/MOM_EOS.F90