/[MITgcm]/MITgcm/model/src/seawater.F
ViewVC logotype

Annotation of /MITgcm/model/src/seawater.F

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


Revision 1.10 - (hide annotations) (download)
Sun Feb 15 16:47:32 2015 UTC (9 years, 3 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint65j
Changes since 1.9: +4 -29 lines
- simplify SW_TEMP to just calling SW_PTMP with P and PR exchanged
  (following the matlab code)

1 mlosch 1.10 C $Header: /u/gcmpack/MITgcm/model/src/seawater.F,v 1.9 2015/02/05 19:23:05 jmc Exp $
2 ce107 1.4 C $Name: $
3 mlosch 1.1
4     #include "CPP_OPTIONS.h"
5 jmc 1.2
6     C-- File seawater.F: routines that compute quantities related to seawater.
7     C-- Contents
8     C-- o SW_PTMP: function to compute potential temperature
9 jmc 1.5 C-- o SW_TEMP: function to compute in-situ temperature from pot. temp.
10     C-- o SW_ADTG: function to compute adiabatic temperature gradient
11     C-- (used by both SW_PTMP & SW_TEMP)
12    
13     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
14    
15     CBOP
16     C !ROUTINE: SW_PTMP
17     C !INTERFACE:
18     _RL FUNCTION SW_PTMP (S,T,P,PR)
19 mlosch 1.1
20     C !DESCRIPTION: \bv
21 jmc 1.5 C *=============================================================*
22     C | S/R SW_PTMP
23     C | o compute potential temperature as per UNESCO 1983 report.
24     C *=============================================================*
25     C
26     C started:
27     C Armin Koehl akoehl@ucsd.edu
28     C
29     C ==================================================================
30     C SUBROUTINE SW_PTMP
31     C ==================================================================
32     C S :: salinity [psu (PSS-78) ]
33     C T :: temperature [degree C (IPTS-68)]
34     C P :: pressure [db]
35     C PR :: Reference pressure [db]
36 mlosch 1.1
37     C !USES:
38     IMPLICIT NONE
39    
40     C !INPUT/OUTPUT PARAMETERS:
41 jmc 1.5 _RL S,T,P,PR
42 mlosch 1.1
43 jmc 1.5 C !FUNCTIONS:
44     _RL sw_adtg
45     EXTERNAL sw_adtg
46 mlosch 1.1
47 jmc 1.5 C !LOCAL VARIABLES
48 mlosch 1.1 _RL del_P ,del_th, th, q
49     _RL onehalf, two, three
50 jmc 1.5 PARAMETER ( onehalf = 0.5 _d 0, two = 2. _d 0, three = 3. _d 0 )
51     CEOP
52 mlosch 1.1
53 jmc 1.5 C theta1
54 mlosch 1.1 del_P = PR - P
55     del_th = del_P*sw_adtg(S,T,P)
56     th = T + onehalf*del_th
57     q = del_th
58 jmc 1.5 C theta2
59 mlosch 1.1 del_th = del_P*sw_adtg(S,th,P+onehalf*del_P)
60    
61     th = th + (1 - 1/sqrt(two))*(del_th - q)
62     q = (two-sqrt(two))*del_th + (-two+three/sqrt(two))*q
63    
64 jmc 1.5 C theta3
65 mlosch 1.1 del_th = del_P*sw_adtg(S,th,P+onehalf*del_P)
66     th = th + (1 + 1/sqrt(two))*(del_th - q)
67     q = (two + sqrt(two))*del_th + (-two-three/sqrt(two))*q
68    
69 jmc 1.5 C theta4
70 mlosch 1.1 del_th = del_P*sw_adtg(S,th,P+del_P)
71     SW_PTMP = th + (del_th - two*q)/(two*three)
72    
73 jmc 1.5 RETURN
74     END
75    
76     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
77 mlosch 1.1
78     CBOP
79     C !ROUTINE: SW_TEMP
80     C !INTERFACE:
81 jmc 1.5 _RL FUNCTION SW_TEMP( S, T, P, PR )
82 mlosch 1.1 C !DESCRIPTION: \bv
83     C *=============================================================*
84     C | S/R SW_TEMP
85 jmc 1.2 C | o compute in-situ temperature from potential temperature
86 mlosch 1.1 C *=============================================================*
87     C
88     C REFERENCES:
89     C Fofonoff, P. and Millard, R.C. Jr
90     C Unesco 1983. Algorithms for computation of fundamental properties of
91     C seawater, 1983. _Unesco Tech. Pap. in Mar. Sci._, No. 44, 53 pp.
92     C Eqn.(31) p.39
93 jmc 1.2 C
94 mlosch 1.1 C Bryden, H. 1973.
95 jmc 1.6 C New Polynomials for thermal expansion, adiabatic temperature gradient
96     C and potential temperature of sea water.
97 mlosch 1.1 C DEEP-SEA RES., 1973, Vol20,401-408.
98    
99     C !USES:
100     IMPLICIT NONE
101     C === Global variables ===
102 jmc 1.2
103 mlosch 1.1 C !INPUT/OUTPUT PARAMETERS:
104     C === Routine arguments ===
105 jmc 1.5 C S :: salinity
106     C T :: potential temperature
107     C P :: pressure
108     C PR :: reference pressure
109     _RL S, T, P, PR
110 mlosch 1.1 CEOP
111    
112 jmc 1.5 C !FUNCTIONS:
113 mlosch 1.10 _RL sw_ptmp
114     EXTERNAL sw_ptmp
115 mlosch 1.1
116 mlosch 1.10 SW_temp = SW_PTMP (S,T,PR,P)
117 mlosch 1.1
118     RETURN
119     END
120    
121 jmc 1.5 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
122 mlosch 1.1
123 jmc 1.5 CBOP
124     C !ROUTINE: SW_ADTG
125     C !INTERFACE:
126 jmc 1.2 _RL FUNCTION SW_ADTG (S,T,P)
127 mlosch 1.1
128 jmc 1.5 C !DESCRIPTION: \bv
129     C *=============================================================*
130     C | S/R SW_ADTG
131     C | o compute adiabatic temperature gradient as per UNESCO 1983 routines.
132     C *=============================================================*
133     C
134     C started:
135     C Armin Koehl akoehl@ucsd.edu
136    
137     C !USES:
138     IMPLICIT NONE
139    
140     C !INPUT/OUTPUT PARAMETERS:
141     _RL S,T,P
142 mlosch 1.1
143 jmc 1.5 C !LOCAL VARIABLES:
144 mlosch 1.1 _RL a0,a1,a2,a3,b0,b1,c0,c1,c2,c3,d0,d1,e0,e1,e2
145     _RL sref
146 jmc 1.5 CEOP
147 mlosch 1.1
148     sref = 35. _d 0
149     a0 = 3.5803 _d -5
150     a1 = +8.5258 _d -6
151     a2 = -6.836 _d -8
152     a3 = 6.6228 _d -10
153    
154     b0 = +1.8932 _d -6
155     b1 = -4.2393 _d -8
156    
157     c0 = +1.8741 _d -8
158     c1 = -6.7795 _d -10
159     c2 = +8.733 _d -12
160     c3 = -5.4481 _d -14
161    
162     d0 = -1.1351 _d -10
163     d1 = 2.7759 _d -12
164    
165     e0 = -4.6206 _d -13
166     e1 = +1.8676 _d -14
167     e2 = -2.1687 _d -16
168    
169     SW_ADTG = a0 + (a1 + (a2 + a3*T)*T)*T
170     & + (b0 + b1*T)*(S-sref)
171     & + ( (c0 + (c1 + (c2 + c3*T)*T)*T) + (d0 + d1*T)*(S-sref) )*P
172     & + ( e0 + (e1 + e2*T)*T )*P*P
173 jmc 1.5
174     RETURN
175     END

  ViewVC Help
Powered by ViewVC 1.1.22