MOM6
mom_eos::calculate_density Interface Reference

Detailed Description

Calculates density of sea water from T, S and P.

Definition at line 60 of file MOM_EOS.F90.

Private functions

subroutine calculate_density_scalar (T, S, pressure, rho, EOS, rho_ref, scale)
 Calls the appropriate subroutine to calculate density of sea water for scalar inputs. If rho_ref is present, the anomaly with respect to rho_ref is returned. More...
 
subroutine calculate_density_array (T, S, pressure, rho, start, npts, EOS, rho_ref, scale)
 Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs. If rho_ref is present, the anomaly with respect to rho_ref is returned. More...
 

Functions and subroutines

◆ calculate_density_array()

subroutine mom_eos::calculate_density::calculate_density_array ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  rho,
integer, intent(in)  start,
integer, intent(in)  npts,
type(eos_type), pointer  EOS,
real, intent(in), optional  rho_ref,
real, intent(in), optional  scale 
)
private

Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs. If rho_ref is present, the anomaly with respect to rho_ref is returned.

Parameters
[in]tPotential temperature referenced to the surface [degC]
[in]sSalinity [ppt]
[in]pressurePressure [Pa]
[out]rhoDensity (in-situ if pressure is local) [kg m-3] or [R ~> kg m-3]
[in]startStart index for computation
[in]nptsNumber of point to compute
eosEquation of state structure
[in]rho_refA reference density [kg m-3].
[in]scaleA multiplicative factor by which to scale density from kg m-3 to the desired units [R m3 kg-1]

Definition at line 177 of file MOM_EOS.F90.

177  real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface [degC]
178  real, dimension(:), intent(in) :: S !< Salinity [ppt]
179  real, dimension(:), intent(in) :: pressure !< Pressure [Pa]
180  real, dimension(:), intent(out) :: rho !< Density (in-situ if pressure is local) [kg m-3] or [R ~> kg m-3]
181  integer, intent(in) :: start !< Start index for computation
182  integer, intent(in) :: npts !< Number of point to compute
183  type(EOS_type), pointer :: EOS !< Equation of state structure
184  real, optional, intent(in) :: rho_ref !< A reference density [kg m-3].
185  real, optional, intent(in) :: scale !< A multiplicative factor by which to scale density
186  !! from kg m-3 to the desired units [R m3 kg-1]
187  integer :: j
188 
189  if (.not.associated(eos)) call mom_error(fatal, &
190  "calculate_density_array called with an unassociated EOS_type EOS.")
191 
192  select case (eos%form_of_EOS)
193  case (eos_linear)
194  call calculate_density_linear(t, s, pressure, rho, start, npts, &
195  eos%Rho_T0_S0, eos%dRho_dT, eos%dRho_dS, rho_ref)
196  case (eos_unesco)
197  call calculate_density_unesco(t, s, pressure, rho, start, npts, rho_ref)
198  case (eos_wright)
199  call calculate_density_wright(t, s, pressure, rho, start, npts, rho_ref)
200  case (eos_teos10)
201  call calculate_density_teos10(t, s, pressure, rho, start, npts, rho_ref)
202  case (eos_nemo)
203  call calculate_density_nemo (t, s, pressure, rho, start, npts, rho_ref)
204  case default
205  call mom_error(fatal, &
206  "calculate_density_array: EOS%form_of_EOS is not valid.")
207  end select
208 
209  if (present(scale)) then ; if (scale /= 1.0) then
210  do j=start,start+npts-1 ; rho(j) = scale * rho(j) ; enddo
211  endif ; endif
212 

◆ calculate_density_scalar()

subroutine mom_eos::calculate_density::calculate_density_scalar ( real, intent(in)  T,
real, intent(in)  S,
real, intent(in)  pressure,
real, intent(out)  rho,
type(eos_type), pointer  EOS,
real, intent(in), optional  rho_ref,
real, intent(in), optional  scale 
)
private

Calls the appropriate subroutine to calculate density of sea water for scalar inputs. If rho_ref is present, the anomaly with respect to rho_ref is returned.

Parameters
[in]tPotential temperature referenced to the surface [degC]
[in]sSalinity [ppt]
[in]pressurePressure [Pa]
[out]rhoDensity (in-situ if pressure is local) [kg m-3] or [R ~> kg m-3]
eosEquation of state structure
[in]rho_refA reference density [kg m-3].
[in]scaleA multiplicative factor by which to scale density from kg m-3 to the desired units [R m3 kg-1]

Definition at line 139 of file MOM_EOS.F90.

139  real, intent(in) :: T !< Potential temperature referenced to the surface [degC]
140  real, intent(in) :: S !< Salinity [ppt]
141  real, intent(in) :: pressure !< Pressure [Pa]
142  real, intent(out) :: rho !< Density (in-situ if pressure is local) [kg m-3] or [R ~> kg m-3]
143  type(EOS_type), pointer :: EOS !< Equation of state structure
144  real, optional, intent(in) :: rho_ref !< A reference density [kg m-3].
145  real, optional, intent(in) :: scale !< A multiplicative factor by which to scale density
146  !! from kg m-3 to the desired units [R m3 kg-1]
147 
148  if (.not.associated(eos)) call mom_error(fatal, &
149  "calculate_density_scalar called with an unassociated EOS_type EOS.")
150 
151  select case (eos%form_of_EOS)
152  case (eos_linear)
153  call calculate_density_linear(t, s, pressure, rho, &
154  eos%Rho_T0_S0, eos%dRho_dT, eos%dRho_dS, rho_ref)
155  case (eos_unesco)
156  call calculate_density_unesco(t, s, pressure, rho, rho_ref)
157  case (eos_wright)
158  call calculate_density_wright(t, s, pressure, rho, rho_ref)
159  case (eos_teos10)
160  call calculate_density_teos10(t, s, pressure, rho, rho_ref)
161  case (eos_nemo)
162  call calculate_density_nemo(t, s, pressure, rho, rho_ref)
163  case default
164  call mom_error(fatal, &
165  "calculate_density_scalar: EOS is not valid.")
166  end select
167 
168  if (present(scale)) then ; if (scale /= 1.0) then
169  rho = scale * rho
170  endif ; endif
171 

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