29 implicit none ;
private 41 real,
parameter ::
r00 = 999.842594,
r10 = 6.793952e-2,
r20 = -9.095290e-3, &
42 r30 = 1.001685e-4,
r40 = -1.120083e-6,
r50 = 6.536332e-9,
r01 = 0.824493, &
43 r11 = -4.0899e-3,
r21 = 7.6438e-5,
r31 = -8.2467e-7,
r41 = 5.3875e-9, &
44 r032 = -5.72466e-3,
r132 = 1.0227e-4,
r232 = -1.6546e-6,
r02 = 4.8314e-4;
50 real,
parameter ::
s00 = 1.965933e4,
s10 = 1.444304e2,
s20 = -1.706103, &
51 s30 = 9.648704e-3,
s40 = -4.190253e-5,
s01 = 52.84855,
s11 = -3.101089e-1, &
52 s21 = 6.283263e-3,
s31 = -5.084188e-5,
s032 = 3.886640e-1,
s132 = 9.085835e-3, &
53 s232 = -4.619924e-4,
sp00 = 3.186519,
sp10 = 2.212276e-2,
sp20 = -2.984642e-4, &
54 sp30 = 1.956415e-6,
sp01 = 6.704388e-3,
sp11 = -1.847318e-4,
sp21 = 2.059331e-7, &
69 real,
intent(in) :: pressure
70 real,
intent(out) :: rho
87 real,
dimension(1) :: T0, S0, pressure0
88 real,
dimension(1) :: rho0
92 pressure0(1) = pressure
103 real,
intent(in),
dimension(:) :: T
105 real,
intent(in),
dimension(:) :: S
106 real,
intent(in),
dimension(:) :: pressure
107 real,
intent(out),
dimension(:) :: rho
108 integer,
intent(in) :: start
109 integer,
intent(in) :: npts
122 real :: t_local, t2, t3, t4, t5;
123 real :: s_local, s32, s2;
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);
148 rho(j) = rho0*ks / (ks - p1);
155 real,
intent(in),
dimension(:) :: T
157 real,
intent(in),
dimension(:) :: S
158 real,
intent(in),
dimension(:) :: pressure
159 real,
intent(out),
dimension(:) :: drho_dT
161 real,
intent(out),
dimension(:) :: drho_dS
163 integer,
intent(in) :: start
164 integer,
intent(in) :: npts
178 real :: t_local, t2, t3, t4, t5;
179 real :: s12, s_local, s32, s2;
190 do j=start,start+npts-1
191 p1 = pressure(j)*1.0e-5; p2 = p1*p1;
192 t_local = t(j); t2 = t_local*t_local; t3 = t_local*t2; t4 = t2*t2; t5 = t3*t2;
193 s_local = s(j); s2 = s_local*s_local; s12 = sqrt(s_local); s32 = s_local*s12;
200 drho0_dt =
r10 + 2.0*
r20*t_local + 3.0*
r30*t2 + 4.0*
r40*t3 + 5.0*
r50*t4 + &
201 s_local*(
r11 + 2.0*
r21*t_local + 3.0*
r31*t2 + 4.0*
r41*t3) + &
213 dks_dt =
s10 + 2.0*
s20*t_local + 3.0*
s30*t2 + 4.0*
s40*t3 + &
221 denom = 1.0 / (ks - p1);
222 drho_dt(j) = denom*(ks*drho0_dt - rho0*p1*denom*dks_dt);
223 drho_ds(j) = denom*(ks*drho0_ds - rho0*p1*denom*dks_ds);
232 real,
intent(in),
dimension(:) :: T
234 real,
intent(in),
dimension(:) :: S
235 real,
intent(in),
dimension(:) :: pressure
236 real,
intent(out),
dimension(:) :: rho
237 real,
intent(out),
dimension(:) :: drho_dp
240 integer,
intent(in) :: start
241 integer,
intent(in) :: npts
257 real :: t_local, t2, t3, t4, t5;
258 real :: s_local, s32, s2;
262 real :: ks_0, ks_1, ks_2;
267 do j=start,start+npts-1
268 p1 = pressure(j)*1.0e-5; p2 = p1*p1;
269 t_local = t(j); t2 = t_local*t_local; t3 = t_local*t2; t4 = t2*t2; t5 = t3*t2;
270 s_local = s(j); s2 = s_local*s_local; s32 = s_local*sqrt(s_local);
285 ks = ks_0 + p1*ks_1 + p2*ks_2;
286 dks_dp = ks_1 + 2.0*p1*ks_2;
288 rho(j) = rho0*ks / (ks - p1);
290 drho_dp(j) = 1.0e-5 * (rho(j) / (ks - p1)) * (1.0 - dks_dp*p1/ks);
subroutine, public calculate_compress_unesco(T, S, pressure, rho, drho_dp, start, npts)
This subroutine computes the in situ density of sea water (rho) and the compressibility (drho/dp == C...
subroutine, public 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 i...
subroutine, public 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 i...
subroutine, public calculate_density_derivs_unesco(T, S, pressure, drho_dT, drho_dS, start, npts)
This subroutine calculates the partial derivatives of density with potential temperature and salinity...