MOM6
mom_eos_nemo::calculate_density_nemo Interface Reference

Detailed Description

Definition at line 41 of file MOM_EOS_NEMO.F90.

Private functions

subroutine calculate_density_scalar_nemo (T, S, pressure, rho)
 
subroutine calculate_density_array_nemo (T, S, pressure, rho, start, npts)
 This subroutine computes the in situ density of sea water (rho in units of kg/m^3) from absolute salinity (S in g/Kg), conservative temperature (T in deg C), and pressure in Pa. More...
 

Functions and subroutines

◆ calculate_density_array_nemo()

subroutine mom_eos_nemo::calculate_density_nemo::calculate_density_array_nemo ( 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 
)
private

This subroutine computes the in situ density of sea water (rho in units of kg/m^3) from absolute salinity (S in g/Kg), conservative temperature (T in deg C), and pressure in Pa.

Parameters
[in]tConservative temperature in C.
[in]sAbsoulte salinity in g/Kg.
[in]pressurePressure in Pa.
[out]rhoIn situ density in kg m-3.
[in]startThe starting point in the arrays.
[in]nptsThe number of values to calculate.

Definition at line 213 of file MOM_EOS_NEMO.F90.

213  real, intent(in), dimension(:) :: t !< Conservative temperature in C.
214  real, intent(in), dimension(:) :: s !< Absoulte salinity in g/Kg.
215  real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
216  real, intent(out), dimension(:) :: rho !< In situ density in kg m-3.
217  integer, intent(in) :: start !< The starting point in the arrays.
218  integer, intent(in) :: npts !< The number of values to calculate.
219 
220 ! * Arguments: T - conservative temperature in C. *
221 ! * (in) S - absoulte salinity in g/Kg. *
222 ! * (in) pressure - pressure in Pa. *
223 ! * (out) rho - in situ density in kg m-3. *
224 ! * (in) start - the starting point in the arrays. *
225 ! * (in) npts - the number of values to calculate. *
226 
227 ! *====================================================================*
228 ! * This subroutine computes the in situ density of sea water (rho in *
229 ! * units of kg/m^3) from absolute salinity (S in g/Kg), *
230 ! * conservative temperature (T in deg C), and pressure in Pa. *
231 ! *====================================================================*
232  real :: zp,zt , zh , zs , zr0, zn , zn0, zn1, zn2, zn3
233  integer :: j
234 
235  do j=start,start+npts-1
236  !Conversions
237  zs = s(j) !gsw_sr_from_sp(S(j)) !Convert practical salinity to absolute salinity
238  zt = t(j) !gsw_ct_from_pt(S(j),T(j)) !Convert potantial temp to conservative temp
239  zp = pressure(j)* pa2db !Convert pressure from Pascal to decibar
240 
241  !The following algorithm was provided by Roquet in a private communication.
242  !It is not necessarily the algorithm used in NEMO ocean!
243  zp = zp * r1_p0 !pressure
244  zt = zt * r1_t0 !temperature
245  zs = sqrt( abs( zs + rdeltas ) * r1_s0 ) ! square root salinity
246  !
247  zn3 = eos013*zt &
248  & + eos103*zs+eos003
249  !
250  zn2 = (eos022*zt &
251  & + eos112*zs+eos012)*zt &
252  & + (eos202*zs+eos102)*zs+eos002
253  !
254  zn1 = (((eos041*zt &
255  & + eos131*zs+eos031)*zt &
256  & + (eos221*zs+eos121)*zs+eos021)*zt &
257  & + ((eos311*zs+eos211)*zs+eos111)*zs+eos011)*zt &
258  & + (((eos401*zs+eos301)*zs+eos201)*zs+eos101)*zs+eos001
259  !
260  zn0 = (((((eos060*zt &
261  & + eos150*zs+eos050)*zt &
262  & + (eos240*zs+eos140)*zs+eos040)*zt &
263  & + ((eos330*zs+eos230)*zs+eos130)*zs+eos030)*zt &
264  & + (((eos420*zs+eos320)*zs+eos220)*zs+eos120)*zs+eos020)*zt &
265  & + ((((eos510*zs+eos410)*zs+eos310)*zs+eos210)*zs+eos110)*zs+eos010)*zt &
266  & + (((((eos600*zs+eos500)*zs+eos400)*zs+eos300)*zs+eos200)*zs+eos100)*zs+eos000
267  !
268  zn = ( ( zn3 * zp + zn2 ) * zp + zn1 ) * zp + zn0
269  !
270  zr0 = (((((r05 * zp+r04) * zp+r03 ) * zp+r02 ) * zp+r01) * zp+r00) * zp
271  !
272  rho(j) = ( zn + zr0 ) ! density
273 
274  enddo

◆ calculate_density_scalar_nemo()

subroutine mom_eos_nemo::calculate_density_nemo::calculate_density_scalar_nemo ( real, intent(in)  T,
real, intent(in)  S,
real, intent(in)  pressure,
real, intent(out)  rho 
)
private

Definition at line 184 of file MOM_EOS_NEMO.F90.

184 real, intent(in) :: t, s, pressure
185 real, intent(out) :: rho
186 ! * Arguments: T - conservative temperature in C. *
187 ! * (in) S - absoulte salinity in g/Kg. *
188 ! * (in) pressure - pressure in Pa. *
189 ! * (out) rho - in situ density in kg m-3. *
190 
191 ! *====================================================================*
192 ! * This subroutine computes the in situ density of sea water (rho in *
193 ! * units of kg/m^3) from absolute salinity (S in g/Kg), conservative *
194 ! * temperature (T in deg C), and pressure in Pa. *
195 ! *====================================================================*
196 
197  real :: al0, p0, lambda
198  integer :: j
199  real, dimension(1) :: t0, s0, pressure0
200  real, dimension(1) :: rho0
201 
202  t0(1) = t
203  s0(1) = s
204  pressure0(1) = pressure
205 
206  call calculate_density_array_nemo(t0, s0, pressure0, rho0, 1, 1)
207  rho = rho0(1)

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