/[MITgcm]/MITgcm/pkg/sbo/sbo_rho.F
ViewVC logotype

Contents of /MITgcm/pkg/sbo/sbo_rho.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Thu Oct 9 04:19:20 2003 UTC (20 years, 7 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint62v, checkpoint57m_post, checkpoint52l_pre, checkpoint62u, hrcube4, hrcube5, checkpoint57g_pre, checkpoint62t, checkpoint57s_post, checkpoint58b_post, checkpoint57b_post, checkpoint52d_pre, checkpoint57g_post, checkpoint56b_post, checkpoint57y_post, checkpoint52j_pre, checkpoint51o_pre, checkpoint54d_post, checkpoint54e_post, checkpoint62c, checkpoint51l_post, checkpoint57r_post, checkpoint57d_post, checkpoint57i_post, checkpoint52k_post, checkpoint59, checkpoint58, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint53, checkpoint52, checkpoint58f_post, checkpoint52f_post, checkpoint57n_post, checkpoint58d_post, checkpoint62s, checkpoint58a_post, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint57z_post, checkpoint54f_post, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62w, checkpoint62x, checkpoint58y_post, checkpoint51t_post, checkpoint58t_post, checkpoint51n_post, checkpoint55i_post, checkpoint58m_post, checkpoint57l_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint57t_post, checkpoint55c_post, checkpoint52e_pre, checkpoint57v_post, checkpoint57f_post, checkpoint52e_post, checkpoint51n_pre, checkpoint53d_post, checkpoint60, checkpoint61, checkpoint62, checkpoint57a_post, checkpoint57h_pre, checkpoint52b_pre, checkpoint54b_post, checkpoint58w_post, checkpoint57h_post, checkpoint51l_pre, checkpoint52m_post, checkpoint57y_pre, checkpoint55g_post, checkpoint51q_post, checkpoint52b_post, checkpoint52c_post, checkpoint58o_post, checkpoint57c_post, checkpoint58p_post, checkpoint58q_post, checkpoint52f_pre, checkpoint55d_post, checkpoint58e_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, checkpoint54a_post, checkpoint55h_post, checkpoint58n_post, checkpoint51r_post, checkpoint51i_post, checkpoint57e_post, checkpoint55b_post, checkpoint53a_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint52d_post, checkpoint53g_post, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, eckpoint57e_pre, checkpoint58k_post, checkpoint52a_pre, checkpoint62b, checkpoint58v_post, checkpoint52i_post, checkpoint52h_pre, checkpoint56a_post, checkpoint58l_post, checkpoint53f_post, checkpoint57h_done, checkpoint52j_post, checkpoint57j_post, checkpoint57f_pre, checkpoint61f, checkpoint58g_post, branch-netcdf, checkpoint52l_post, checkpoint58x_post, checkpoint61n, checkpoint52n_post, checkpoint53b_pre, checkpoint59j, checkpoint58h_post, checkpoint56c_post, checkpoint58j_post, checkpoint57a_pre, checkpoint55a_post, checkpoint57o_post, checkpoint51o_post, checkpoint61q, checkpoint57k_post, checkpoint53b_post, checkpoint52a_post, checkpoint57w_post, checkpoint61e, checkpoint58i_post, ecco_c52_e35, checkpoint57x_post, checkpoint58c_post, checkpoint58u_post, checkpoint51m_post, checkpoint53d_pre, checkpoint58s_post, checkpoint55e_post, checkpoint61g, checkpoint61d, checkpoint54c_post, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint51p_post, checkpoint61z, checkpoint61x, checkpoint61y, checkpoint51u_post
Branch point for: branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.2: +2 -1 lines
 o first check-in for the "branch-genmake2" merge
 o verification suite as run on shelley (gcc 3.2.2):

Wed Oct  8 23:42:29 EDT 2003
                T           S           U           V
G D M    c        m  s        m  s        m  s        m  s
E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .

OPTFILE=NONE

Y Y Y Y 13 16 16 16  0 16 16 16 16 16 16 16 16 13 12  0  0 pass  adjustment.128x64x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16  0  0 16 16  0  0 pass  adjustment.cs-32x32x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16 22  0 16 16 22  0 pass  adjust_nlfs.cs-32x32x1
Y Y Y Y -- 13 13 16 16 13 13 13 13 16 16 16 16 16 16 16 16 N/O   advect_cs
Y Y Y Y -- 22 16 16 16 16 16 16 13 16 16 16 16 16 16 16 16 N/O   advect_xy
Y Y Y Y -- 13 16 13 16 16 16 16 16 16 16 22 16 16 16 16 16 N/O   advect_xz
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  aim.5l_cs
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 16 16 16 16 13 16 pass  aim.5l_Equatorial_Channel
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 13 16 16 13 13 16 pass  aim.5l_LatLon
Y Y Y Y 13 16 16 16 16 16 16 16 16 16 13 12 13 13 16 13 16 pass  exp0
Y Y Y Y 14 16 16 16 16 16 16 16 22 16 16 16 13 16 16 22 16 pass  exp1
Y Y Y Y 13 13 16 13 16 16 16 16 16 13 13 16 16 13 13 13 13 pass  exp2
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  exp4
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 22 16 16 16 22 16 pass  exp5
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  front_relax
Y Y Y Y 14 16 16 13 13 16 16 13 13 16 13 13 16 12 13 13 16 pass  global_ocean.90x40x15
Y Y Y Y 10 16 16 13 13 16 13 16 16 13 13 13 13 16 16 13 16 FAIL  global_ocean.cs32x15
Y Y Y Y  6 11 12 13 13 12 13 16 13  9  9  9  9 10  9  9 11 FAIL  global_ocean_pressure
Y Y Y Y 14 16 16 13 16 16 16 13 13 13 13 13 16 12 16 13 16 pass  global_with_exf
Y Y Y Y 14 16 16 16 16 16 16 16 16 11 13 22 13 16 16  9 16 pass  hs94.128x64x5
Y Y Y Y 13 16 16 16 16 16 16 16 16 11 16 16 16 13 16 22 13 pass  hs94.1x64x5
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 13 13 16 16 22 13 pass  hs94.cs-32x32x5
Y Y Y Y 10 10 16 13 13 16 16 16 22 16 13 13 13 13 13 22 13 FAIL  ideal_2D_oce
Y Y Y Y  8 16 16 16 16 16 16 16 16 13 13  8 16 16 16 16 16 FAIL  internal_wave
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 13 22 13 13 13 22 16 pass  inverted_barometer
Y Y Y Y 12 16 16 16 16 16 16 16 16 16 13 12 13 13 13 13 13 FAIL  lab_sea
Y Y Y Y 11 16 16 16 16 16 16 16 13 13 13 12 13 16 13 12 13 FAIL  natl_box
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  plume_on_slope
Y Y Y Y 13 16 16 16 16 13 16 16 16 16 16 16 16 13 16 16 16 pass  solid-body.cs-32x32x1

1 C $Header: /u/u3/gcmpack/MITgcm/pkg/sbo/sbo_rho.F,v 1.2.4.1 2003/10/02 18:18:33 adcroft Exp $
2 C $Name: $
3
4 #include "SBO_OPTIONS.h"
5
6 _RL FUNCTION SBO_RHO( DPT, LAT, S, T )
7 C /==========================================================\
8 C | _RL FUNCTION SBO_RHO |
9 C | o Compute density for SBO package. |
10 C |==========================================================|
11 C | CHECK VALUE: |
12 C | DPT=5000; LAT=30; S=30; T=30; SBO_RHO=1038.298 |
13 C \==========================================================/
14 IMPLICIT NONE
15
16 C == Routine arguments ==
17 C SBO_RHO - density (kg/m^3)
18 C DPT - depth (m)
19 C LAT - latitude north (deg)
20 C S - salinity (PSU)
21 C T - potential temperature (deg C)
22
23 _RL DPT,LAT,S,T
24
25 _RL PLAT,D,C1,P,PR,Q,X,SR,V350P,B
26
27 Real*8 PI
28 PARAMETER ( PI = 3.14159265358979323844D0 )
29
30 C First convert depth to pressure
31 C Ref: Saunders, "Practical Conversion of Pressure to Depth",
32 C J. Phys. Oceanog., April 1981.
33 C CHECK VALUE: P80=7500.004 DBARS;FOR LAT=30 DEG., DEPTH=7321.45 METERS
34
35 PLAT=abs(LAT*pi/180.)
36 D=sin(PLAT)
37 C1=5.92E-3+(D*D)*5.25E-3
38 P=((1-C1)-sqrt(((1-C1)**2)-(8.84E-6*abs(DPT))))/4.42E-6
39
40 C Second convert temperature from potential to in situ
41 C REF: BRYDEN,H.,1973,DEEP-SEA RES.,20,401-408
42 C FOFONOFF,N.,1977,DEEP-SEA RES.,24,489-491
43 C CHECKVALUE: THETA= 36.89073 C,S=40 (IPSS-78),T0=40 DEG C,
44 C P0=10000 DECIBARS,PR=0 DECIBARS
45
46 PR = P
47 P = 0.
48 Q = PR*((((-2.1687E-16*T+1.8676E-14)*T-4.6206E-13)*P+
49 & ((2.7759E-12*T-1.1351E-10)*(S-35.0)+
50 & ((-5.4481E-14*T+8.733E-12)*T-6.7795E-10)*T+
51 & 1.8741E-8))*P+(-4.2393E-8*T+1.8932E-6)*(S-35.0)+
52 & ((6.6228E-10*T-6.836E-8)*T+8.5258E-6)*T+3.5803E-5)
53
54 T = T + 0.5*Q
55 P = P + 0.5*PR
56 x = PR*((((-2.1687E-16*T+1.8676E-14)*T-4.6206E-13)*P+
57 & ((2.7759E-12*T-1.1351E-10)*(S-35.0)+
58 & ((-5.4481E-14*T+8.733E-12)*T-6.7795E-10)*T+
59 & 1.8741E-8))*P+(-4.2393E-8*T+1.8932E-6)*(S-35.0)+
60 & ((6.6228E-10*T-6.836E-8)*T+8.5258E-6)*T+3.5803E-5)
61
62 T = T + 0.29289322*(x-Q)
63 Q = 0.58578644*x + 0.121320344*Q
64 x = PR*((((-2.1687E-16*T+1.8676E-14)*T-4.6206E-13)*P+
65 & ((2.7759E-12*T-1.1351E-10)*(S-35.0)+
66 & ((-5.4481E-14*T+8.733E-12)*T-6.7795E-10)*T+
67 & 1.8741E-8))*P+(-4.2393E-8*T+1.8932E-6)*(S-35.0)+
68 & ((6.6228E-10*T-6.836E-8)*T+8.5258E-6)*T+3.5803E-5)
69
70 T = T + 1.707106781*(x-Q)
71 Q = 3.414213562*x - 4.121320344*Q
72 P = P + 0.5*PR
73 x = PR*((((-2.1687E-16*T+1.8676E-14)*T-4.6206E-13)*P+
74 & ((2.7759E-12*T-1.1351E-10)*(S-35.0)+
75 & ((-5.4481E-14*T+8.733E-12)*T-6.7795E-10)*T+
76 & 1.8741E-8))*P+(-4.2393E-8*T+1.8932E-6)*(S-35.0)+
77 & ((6.6228E-10*T-6.836E-8)*T+8.5258E-6)*T+3.5803E-5)
78 T = T + (x-2.0*Q)/6.0
79
80 C Third compute density
81 C BASED ON 1980 EQUATION
82 C OF STATE FOR SEAWATER AND 1978 PRACTICAL SALINITY SCALE.
83 C REFERENCES
84 C MILLERO, ET AL (1980) DEEP-SEA RES.,27A,255-264
85 C MILLERO AND POISSON 1981,DEEP-SEA RES.,28A PP 625-629.
86 C BOTH ABOVE REFERENCES ARE ALSO FOUND IN UNESCO REPORT 38 (1981)
87 C CHECK VALUE: SIGMA = 59.82037 KG/M**3 FOR S = 40 (IPSS-78) ,
88 C T = 40 DEG C, P0= 10000 DECIBARS.
89
90 C CONVERT PRESSURE TO BARS AND TAKE SQUARE ROOT SALINITY.
91 P=P/10.
92 SR = sqrt(abs(S))
93
94 C INTERNATIONAL ONE-ATMOSPHERE EQUATION OF STATE OF SEAWATER
95 x = (4.8314E-4 * S +
96 & ((-1.6546E-6*T+1.0227E-4)*T-5.72466E-3) * SR +
97 & (((5.3875E-9*T-8.2467E-7)*T+7.6438E-5)*T-4.0899E-3)*T
98 & +8.24493E-1)*S + ((((6.536332E-9*T-1.120083E-6)
99 & *T+1.001685E-4)*T-9.095290E-3)*T+6.793952E-2)*T-28.263737
100
101 C SPECIFIC VOLUME AT ATMOSPHERIC PRESSURE
102 V350P = 1.0/1028.1063
103 x = -x*V350P/(1028.1063+x)
104
105 C COMPUTE COMPRESSION TERMS
106 SR = ((((9.1697E-10*T+2.0816E-8)*T-9.9348E-7) * S +
107 & (5.2787E-8*T-6.12293E-6)*T+3.47718E-5) *P +
108 & (1.91075E-4 * SR + (-1.6078E-6*T-1.0981E-5)*T+2.2838E-3) *
109 & S + ((-5.77905E-7*T+1.16092E-4)*T+1.43713E-3)*T-0.1194975)
110 & *P + (((-5.3009E-4*T+1.6483E-2)*T+7.944E-2) * SR +
111 & ((-6.1670E-5*T+1.09987E-2)*T-0.603459)*T+54.6746) * S +
112 & (((-5.155288E-5*T+1.360477E-2)*T-2.327105)*T+148.4206)*T-1930.06
113
114 C EVALUATE PRESSURE POLYNOMIAL
115 B = (5.03217E-5*P+3.359406)*P+21582.27
116 x = x*(1.0 - P/B) + (V350P+x)*P*SR/(B*(B+SR))
117 SR = V350P*(1.0 - P/B)
118 SBO_RHO = 1028.106331 + P/B/SR - x / (SR*(SR+x))
119
120 RETURN
121 END

  ViewVC Help
Powered by ViewVC 1.1.22