MOM6
mom_eos_unesco::calculate_density_unesco Interface Reference

Detailed Description

Compute the in situ density of sea water (in [kg m-3]), or its anomaly with respect to a reference density, from salinity [PSU], potential temperature [degC], and pressure [Pa], using the UNESCO (1981) equation of state.

Definition at line 22 of file MOM_EOS_UNESCO.F90.

Private functions

subroutine calculate_density_scalar_unesco (T, S, pressure, rho, rho_ref)
 This subroutine computes the in situ density of sea water (rho in [kg m-3]) from salinity (S [PSU]), potential temperature (T [degC]), and pressure [Pa], using the UNESCO (1981) equation of state. More...
 
subroutine calculate_density_array_unesco (T, S, pressure, rho, start, npts, rho_ref)
 This subroutine computes the in situ density of sea water (rho in [kg m-3]) from salinity (S [PSU]), potential temperature (T [degC]), and pressure [Pa], using the UNESCO (1981) equation of state. More...
 

Functions and subroutines

◆ calculate_density_array_unesco()

subroutine mom_eos_unesco::calculate_density_unesco::calculate_density_array_unesco ( 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,
real, intent(in), optional  rho_ref 
)
private

This subroutine computes the in situ density of sea water (rho in [kg m-3]) from salinity (S [PSU]), potential temperature (T [degC]), and pressure [Pa], using the UNESCO (1981) equation of state.

Parameters
[in]tpotential temperature relative to the surface [degC].
[in]ssalinity [PSU].
[in]pressurepressure [Pa].
[out]rhoin situ density [kg m-3].
[in]startthe starting point in the arrays.
[in]nptsthe number of values to calculate.
[in]rho_refA reference density [kg m-3].

Definition at line 83 of file MOM_EOS_UNESCO.F90.

83  real, dimension(:), intent(in) :: T !< potential temperature relative to the surface [degC].
84  real, dimension(:), intent(in) :: S !< salinity [PSU].
85  real, dimension(:), intent(in) :: pressure !< pressure [Pa].
86  real, dimension(:), intent(out) :: rho !< in situ density [kg m-3].
87  integer, intent(in) :: start !< the starting point in the arrays.
88  integer, intent(in) :: npts !< the number of values to calculate.
89  real, optional, intent(in) :: rho_ref !< A reference density [kg m-3].
90 
91  ! Local variables
92  real :: t_local, t2, t3, t4, t5 ! Temperature to the 1st - 5th power [degC^n].
93  real :: s_local, s32, s2 ! Salinity to the 1st, 3/2, & 2nd power [PSU^n].
94  real :: p1, p2 ! Pressure (in bars) to the 1st and 2nd power [bar] and [bar2].
95  real :: rho0 ! Density at 1 bar pressure [kg m-3].
96  real :: sig0 ! The anomaly of rho0 from R00 [kg m-3].
97  real :: ks ! The secant bulk modulus [bar].
98  integer :: j
99 
100  do j=start,start+npts-1
101  if (s(j) < -1.0e-10) then !Can we assume safely that this is a missing value?
102  rho(j) = 1000.0
103  cycle
104  endif
105 
106  p1 = pressure(j)*1.0e-5; p2 = p1*p1
107  t_local = t(j); t2 = t_local*t_local; t3 = t_local*t2; t4 = t2*t2; t5 = t3*t2
108  s_local = s(j); s2 = s_local*s_local; s32 = s_local*sqrt(s_local)
109 
110 ! Compute rho(s,theta,p=0) - (same as rho(s,t_insitu,p=0) ).
111 
112  sig0 = r10*t_local + r20*t2 + r30*t3 + r40*t4 + r50*t5 + &
113  s_local*(r01 + r11*t_local + r21*t2 + r31*t3 + r41*t4) + &
114  s32*(r032 + r132*t_local + r232*t2) + r02*s2
115  rho0 = r00 + sig0
116 
117 ! Compute rho(s,theta,p), first calculating the secant bulk modulus.
118 
119  ks = s00 + s10*t_local + s20*t2 + s30*t3 + s40*t4 + s_local*(s01 + s11*t_local + s21*t2 + s31*t3) + &
120  s32*(s032 + s132*t_local + s232*t2) + &
121  p1*(sp00 + sp10*t_local + sp20*t2 + sp30*t3 + &
122  s_local*(sp01 + sp11*t_local + sp21*t2) + sp032*s32) + &
123  p2*(sp000 + sp010*t_local + sp020*t2 + s_local*(sp001 + sp011*t_local + sp021*t2))
124 
125  if (present(rho_ref)) then
126  rho(j) = ((r00 - rho_ref)*ks + (sig0*ks + p1*rho_ref)) / (ks - p1)
127  else
128  rho(j) = rho0*ks / (ks - p1)
129  endif
130  enddo

◆ calculate_density_scalar_unesco()

subroutine mom_eos_unesco::calculate_density_unesco::calculate_density_scalar_unesco ( real, intent(in)  T,
real, intent(in)  S,
real, intent(in)  pressure,
real, intent(out)  rho,
real, intent(in), optional  rho_ref 
)
private

This subroutine computes the in situ density of sea water (rho in [kg m-3]) from salinity (S [PSU]), potential temperature (T [degC]), and pressure [Pa], using the UNESCO (1981) equation of state.

Parameters
[in]tPotential temperature relative to the surface [degC].
[in]sSalinity [PSU].
[in]pressurepressure [Pa].
[out]rhoIn situ density [kg m-3].
[in]rho_refA reference density [kg m-3].

Definition at line 60 of file MOM_EOS_UNESCO.F90.

60  real, intent(in) :: T !< Potential temperature relative to the surface [degC].
61  real, intent(in) :: S !< Salinity [PSU].
62  real, intent(in) :: pressure !< pressure [Pa].
63  real, intent(out) :: rho !< In situ density [kg m-3].
64  real, optional, intent(in) :: rho_ref !< A reference density [kg m-3].
65 
66  ! Local variables
67  real, dimension(1) :: T0, S0, pressure0
68  real, dimension(1) :: rho0
69 
70  t0(1) = t
71  s0(1) = s
72  pressure0(1) = pressure
73 
74  call calculate_density_array_unesco(t0, s0, pressure0, rho0, 1, 1, rho_ref)
75  rho = rho0(1)
76 

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