MOM6
mom_eos_unesco::calculate_density_unesco Interface Reference

Detailed Description

Definition at line 35 of file MOM_EOS_UNESCO.F90.

Private functions

subroutine calculate_density_scalar_unesco (T, S, pressure, rho)
 This subroutine computes the in situ density of sea water (rho in units of kg/m^3) from salinity (S in psu), potential temperature (T in deg C), and pressure in Pa. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. Coded by R. Hallberg, 7/00. More...
 
subroutine calculate_density_array_unesco (T, S, pressure, rho, start, npts)
 This subroutine computes the in situ density of sea water (rho in units of kg/m^3) from salinity (S in psu), potential temperature (T in deg C), and pressure in Pa. 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 
)
private

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

Parameters
[in]tPotential temperature relative to the surface in C.
[in]sSalinity in PSU.
[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 103 of file MOM_EOS_UNESCO.F90.

103  real, intent(in), dimension(:) :: t !< Potential temperature relative to the surface
104  !! in C.
105  real, intent(in), dimension(:) :: s !< Salinity in PSU.
106  real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
107  real, intent(out), dimension(:) :: rho !< In situ density in kg m-3.
108  integer, intent(in) :: start !< The starting point in the arrays.
109  integer, intent(in) :: npts !< The number of values to calculate.
110 
111 ! * This subroutine computes the in situ density of sea water (rho in *
112 ! * units of kg/m^3) from salinity (S in psu), potential temperature *
113 ! * (T in deg C), and pressure in Pa. *
114 
115 ! * Arguments: T - potential temperature relative to the surface in C. *
116 ! * (in) S - salinity in PSU. *
117 ! * (in) pressure - pressure in Pa. *
118 ! * (out) rho - in situ density in kg m-3. *
119 ! * (in) start - the starting point in the arrays. *
120 ! * (in) npts - the number of values to calculate. *
121 
122  real :: t_local, t2, t3, t4, t5; ! Temperature to the 1st - 5th power.
123  real :: s_local, s32, s2; ! Salinity to the 1st, 3/2, & 2nd power.
124  real :: p1, p2; ! Pressure (in bars) to the 1st and 2nd power.
125  real :: rho0; ! Density at 1 bar pressure, in kg m-3.
126  real :: ks; ! The secant bulk modulus in bar.
127  integer :: j
128 
129  do j=start,start+npts-1
130  p1 = pressure(j)*1.0e-5; p2 = p1*p1;
131  t_local = t(j); t2 = t_local*t_local; t3 = t_local*t2; t4 = t2*t2; t5 = t3*t2;
132  s_local = s(j); s2 = s_local*s_local; s32 = s_local*sqrt(s_local);
133 
134 ! Compute rho(s,theta,p=0) - (same as rho(s,t_insitu,p=0) ).
135 
136  rho0 = r00 + r10*t_local + r20*t2 + r30*t3 + r40*t4 + r50*t5 + &
137  s_local*(r01 + r11*t_local + r21*t2 + r31*t3 + r41*t4) + &
138  s32*(r032 + r132*t_local + r232*t2) + r02*s2;
139 
140 ! Compute rho(s,theta,p), first calculating the secant bulk modulus.
141 
142  ks = s00 + s10*t_local + s20*t2 + s30*t3 + s40*t4 + s_local*(s01 + s11*t_local + s21*t2 + s31*t3) + &
143  s32*(s032 + s132*t_local + s232*t2) + &
144  p1*(sp00 + sp10*t_local + sp20*t2 + sp30*t3 + &
145  s_local*(sp01 + sp11*t_local + sp21*t2) + sp032*s32) + &
146  p2*(sp000 + sp010*t_local + sp020*t2 + s_local*(sp001 + sp011*t_local + sp021*t2));
147 
148  rho(j) = rho0*ks / (ks - p1);
149  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 
)
private

This subroutine computes the in situ density of sea water (rho in units of kg/m^3) from salinity (S in psu), potential temperature (T in deg C), and pressure in Pa. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. Coded by R. Hallberg, 7/00.

Parameters
[in]tPotential temperature relative to the surface in C.
[in]sSalinity in PSU.
[in]pressurePressure in Pa.
[out]rhoIn situ density in kg m-3.

Definition at line 67 of file MOM_EOS_UNESCO.F90.

67 real, intent(in) :: t !< Potential temperature relative to the surface in C.
68 real, intent(in) :: s !< Salinity in PSU.
69 real, intent(in) :: pressure !< Pressure in Pa.
70 real, intent(out) :: rho !< In situ density in kg m-3.
71 
72 ! * Arguments: T - potential temperature relative to the surface in C. *
73 ! * (in) S - salinity in PSU. *
74 ! * (in) pressure - pressure in Pa. *
75 ! * (out) rho - in situ density in kg m-3. *
76 ! * (in) start - the starting point in the arrays. *
77 ! * (in) npts - the number of values to calculate. *
78 
79 ! *====================================================================*
80 ! * This subroutine computes the in situ density of sea water (rho in *
81 ! * units of kg/m^3) from salinity (S in psu), potential temperature *
82 ! * (T in deg C), and pressure in Pa. It uses the expression from *
83 ! * Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. *
84 ! * Coded by R. Hallberg, 7/00 *
85 ! *====================================================================*
86 
87  real, dimension(1) :: t0, s0, pressure0
88  real, dimension(1) :: rho0
89 
90  t0(1) = t
91  s0(1) = s
92  pressure0(1) = pressure
93 
94  call calculate_density_array_unesco(t0, s0, pressure0, rho0, 1, 1)
95  rho = rho0(1)
96 

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