/[MITgcm]/MITgcm/pkg/ebm/ebm_atmosphere.F
ViewVC logotype

Contents of /MITgcm/pkg/ebm/ebm_atmosphere.F

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


Revision 1.3 - (show annotations) (download)
Fri May 21 21:45:35 2004 UTC (20 years, 4 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint53d_post, checkpoint54a_pre, checkpoint54a_post, checkpoint53c_post, checkpoint54b_post, checkpoint54d_post, checkpoint54, checkpoint53g_post, checkpoint53f_post, checkpoint53d_pre, checkpoint54c_post
Changes since 1.2: +109 -69 lines
o Adjoint for EBM package (needs further testing)
o bug fix for parallel EBM in ebm_zonalmean.F

1 C $Header: /u/gcmpack/MITgcm/pkg/ebm/ebm_atmosphere.F,v 1.2 2004/05/19 20:38:53 heimbach Exp $
2 C $Name: $
3
4 #include "EBM_OPTIONS.h"
5
6 SUBROUTINE EBM_ATMOSPHERE ( myTime, myiter, myThid )
7
8 C |==========================================================|
9 C | S/R CALCULATE FORCING FROM ENERGY AND MOISTURE |
10 C | BALANCE ATMOSPHERE |
11 C |==========================================================|
12 C References:
13 C * X. Wang, P. Stone and J. Marotzke, 1999:
14 C Global thermohaline circulation. Part I:
15 C Sensitivity to atmospheric moisture transport.
16 C J. Climate 12(1), 71-82
17 C * X. Wang, P. Stone and J. Marotzke, 1999:
18 C Global thermohaline circulation. Part II:
19 C Sensitivity with interactive transport.
20 C J. Climate 12(1), 83-91
21 C * M. Nakamura, P. Stone and J. Marotzke, 1994:
22 C Destabilization of the thermohaline circulation
23 C by atmospheric eddy transports.
24 C J. Climate 7(12), 1870-1882
25
26 IMPLICIT NONE
27
28 C === Global variables ===
29 #include "SIZE.h"
30 #include "EEPARAMS.h"
31 #include "PARAMS.h"
32 #include "FFIELDS.h"
33 #include "DYNVARS.h"
34 #include "GRID.h"
35 #ifdef ALLOW_EBM
36 # include "EBM.h"
37 #endif
38 #ifdef ALLOW_AUTODIFF_TAMC
39 # include "tamc.h"
40 # include "tamc_keys.h"
41 #endif
42
43 C === Routine arguments ===
44 C myThid - Instance number for this innvocation of CALC_FORCING
45 INTEGER myThid
46 INTEGER myIter
47 _RL myTime
48 CEndOfInterface
49
50 #ifdef ALLOW_EBM
51
52 C == Local variables ==
53 _RL Dy
54 _RL ReCountX(1-OLy:sNy+OLy,nSy)
55 INTEGER bi, bj
56 INTEGER i, j
57 INTEGER no_so
58 INTEGER iebmkey
59 LOGICAL TOP_LAYER
60
61 C-- Top layer only
62 cph TOP_LAYER = k .EQ. 1
63
64 cph IF ( TOP_LAYER ) THEN
65
66 DO bj=myByLo(myThid),myByHi(myThid)
67 DO bi=myBxLo(myThid),myBxHi(myThid)
68
69 #ifdef ALLOW_AUTODIFF_TAMC
70 act1 = bi - myBxLo(myThid)
71 max1 = myBxHi(myThid) - myBxLo(myThid) + 1
72 act2 = bj - myByLo(myThid)
73 max2 = myByHi(myThid) - myByLo(myThid) + 1
74 act3 = myThid - 1
75 max3 = nTx*nTy
76 act4 = ikey_dynamics - 1
77 iebmkey = (act1 + 1) + act2*max1
78 & + act3*max1*max2
79 & + act4*max1*max2*max3
80 #endif /* ALLOW_AUTODIFF_TAMC */
81
82 DO j=1-oLy,sNy+oLy
83 DO i=1-oLx,sNx+oLx
84 S(i,j,bj) = 0.0
85 P2(i,j,bj) = 0.0
86 P4(i,j,bj) = 0.0
87 ENDDO
88 SW(j,bj) = 0.0
89 LW(j,bj) = 0.0
90 Hd(j,bj) = 0.0
91 Fw(j,bj) = 0.0
92 T(j,bj) = 0.0
93 ReCountX(j,bj) = 0.0
94 ENDDO
95
96 print *, 'SH', TmlS-t_mlt, TtS-t_mlt
97 print *, 'NH', TmlN-t_mlt, TtN-t_mlt
98
99 C-- account for ice (can absorb heat on an annual averaged basis)
100 C-- Greenland in Northern Hemisphere, Antarctica in Southern
101 DO j = 1,sNy
102 ReCountX(j,bj) = CountX(j,bj)
103 IF (yC(1,j,bi,bj) .LE. -62.0) THEN
104 ReCountX(j,bj) = 90.
105 ELSE IF (yC(1,j,bi,bj) .EQ. 74.0) THEN
106 ReCountX(j,bj) = CountX(j,bj) + 9.0
107 ELSE IF (yC(1,j,bi,bj) .EQ. 70.0) THEN
108 ReCountX(j,bj) = CountX(j,bj) + 8.0
109 ELSE IF (yC(1,j,bi,bj) .EQ. 66.0) THEN
110 ReCountX(j,bj) = CountX(j,bj) + 5.0
111 ELSE IF (yC(1,j,bi,bj) .EQ. 62.0) THEN
112 ReCountX(j,bj) = CountX(j,bj) + 1.0
113 ENDIF
114 ENDDO
115 #ifdef ALLOW_AUTODIFF_TAMC
116 CADJ STORE ReCountX(:,bj) = comlev1_bibj, key=iebmkey, byte=isbyte
117 #endif
118
119 c=====================================================
120 c Fit area-weighed averaged SST north/south of 34
121 c degree to second Legendre polynomial:
122 c=======================================================
123 T_var(1) = SIN(lat(2)*deg2rad) - SIN(lat(1)*deg2rad)
124 T_var(2) = SIN(lat(3)*deg2rad) - SIN(lat(2)*deg2rad)
125 T_var(3) = SIN(lat(2)*deg2rad)**3. - SIN(lat(1)*deg2rad)**3.
126 T_var(4) = SIN(lat(3)*deg2rad)**3. - SIN(lat(2)*deg2rad)**3.
127 #ifdef ALLOW_AUTODIFF_TAMC
128 CADJ STORE T_var(:) = comlev1_bibj, key=iebmkey, byte=isbyte
129 #endif
130
131 c----------------------------------------
132 c Southern hemisphere:
133 c----------------------------------------
134 T2(1) = 2.*(TtS - TmlS)*T_var(1)*T_var(2)/
135 < (T_var(3)*T_var(2) - T_var(4)*T_var(1))
136 T0(1) = TtS - 0.5*T2(1)*((T_var(3)/T_var(1)) - 1.)
137 c----------------------------------------
138 c Northern hemisphere
139 c----------------------------------------
140 T2(2) = 2.*(TtN - TmlN)*T_var(1)*T_var(2)/
141 < (T_var(3)*T_var(2) - T_var(4)*T_var(1))
142 T0(2) = TtN - 0.5*T2(2)*((T_var(3)/T_var(1)) - 1.)
143 c-----------------------------------------
144 c Temperature at 35 N/S
145 c-----------------------------------------
146 DO no_so = 1,2
147 T35(no_so)= T0(no_so) +
148 < T2(no_so)*0.5*
149 < ((3.*SIN(lat(2)*deg2rad)**2. - 1.))
150 ENDDO
151 c-----------------------------------------
152 c Temperature gradient at 35 N/S
153 c-----------------------------------------
154 DO no_so = 1, 2
155 DTDy35(no_so) = 3.*T2(no_so)*
156 < SIN(lat(2)*deg2rad)/rSphere
157 ENDDO
158 c-----------------------------------------------------------
159 c Magnitude of the heat and moisture transport at 35 N/S
160 c-----------------------------------------------------------
161
162 #ifdef ALLOW_AUTODIFF_TAMC
163 CADJ STORE T35(:) = comlev1_bibj, key=iebmkey, byte=isbyte
164 CADJ STORE DTDy35(:) = comlev1_bibj, key=iebmkey, byte=isbyte
165 #endif
166
167 DO no_so = 1, 2
168 gamma = -T35(no_so)*beta*Hw*Nw*Nw/
169 < (gravity*f0*DTDy35(no_so))
170 kappa = Hw/(1 + gamma)
171 De = Hw/(0.48 + 1.48*gamma)
172 C = 0.6*gravity*kappa*kappa*Nw/
173 < (Tw*f0*f0)
174 Cs = rho_air*cp*C*
175 < (1/(1/Hw+1/De) - 1/(1/Hw+1/De+1/dz))
176 Cf = htil*2.97e12*C/(T35(no_so)**3)*(
177 < 1/(1/De + (5420*tau /(T35(no_so)**2)))
178 < - 1/(1/De+5420*tau/(T35(no_so)**2)+1/dz))
179 Cl = Cf*lv
180 Hd35(no_so) = 2.*PI*rSphere*COS(lat(2)*deg2rad)
181 < *(Cs + Cl*exp(-5420./T35(no_so)))
182 < *(abs(DTDy35(no_so))**trans_eff)
183 Fw35(no_so) = 2.*PI*rSphere*COS(lat(2)*deg2rad)
184 < *(abs(DTDy35(no_so))**trans_eff)
185 < *Cf*exp(-5420./T35(no_so))
186 c write(0,*) no_so, Hd35(no_so), Fw35(no_so)
187 ENDDO
188 Fw35(1) = 929944128.
189 Fw35(2) = 678148032.
190 #ifdef EBM_VERSION_1BASIN
191 c Fw35(2) = 0.7*Fw35(2)
192 #else
193 Hd35(2) = 1.6*Hd35(2)
194 #endif
195 c======================================================
196 c Calculation of latitudinal profiles
197 c======================================================
198 c
199 DO j=1,sNy
200 DO i=1,sNx
201 C sin(lat)
202 S(i,j,bj) = sin(yC(i,j,bi,bj)*deg2rad)
203 C setup Legendre polynomials and derivatives
204 P2(i,j,bj) = 0.5*(3.*S(i,j,bj)**2 - 1.)
205 P4(i,j,bj) = 0.12*(35.*S(i,j,bj)**4 - 30.*S(i,j,bj)**2 + 3.)
206 ENDDO
207 ENDDO
208 #ifdef ALLOW_AUTODIFF_TAMC
209 CADJ STORE S(:,:,bj) = comlev1_bibj, key=iebmkey, byte=isbyte
210 CADJ STORE P2(:,:,bj) = comlev1_bibj, key=iebmkey, byte=isbyte
211 CADJ STORE P4(:,:,bj) = comlev1_bibj, key=iebmkey, byte=isbyte
212 #endif
213 c
214 DO j=1,sNy
215 DO i=1,sNx
216
217 IF (yC(i,j,bi,bj) .LT. 0.) THEN
218 no_so = 1
219 ELSE
220 no_so = 2
221 ENDIF
222 c net shortwave
223 SW(j,bj) = 0.25*Q0*(1 + Q2*P2(i,j,bj))*
224 < (1 - A0 - A2*P2(i,j,bj) - A4*P4(i,j,bj) )
225 c temperature
226 T(j,bj) = T0(no_so) + T2(no_so)*P2(i,j,bj)
227 c net longwave
228 LW(j,bj) = LW0 + LW1*(T(j,bj)-t_mlt)
229 c climate change run, the parameter to change is DLW
230 #ifdef EBM_CLIMATE_CHANGE
231 LW(j,bj) = LW(j,bj) -
232 < (myTime-startTime)*3.215e-8*DLW
233 c < - 6.0
234 c < *75.0*0.0474*
235 c < (-2.62*S(i,j,bj)**8 + 0.73*S(i,j,bj)**7 +
236 c < 4.82*S(i,j,bj)**6 -
237 c < 1.12*S(i,j,bj)**5 - 2.69*S(i,j,bj)**4 + 0.47*S(i,j,bj)**3 +
238 c < 0.51*S(i,j,bj)**2 - 0.05*S(i,j,bj)**1 + 0.17)
239 #endif
240 c fluxes at ocean/atmosphere interface
241 c Heat Flux = -Div(atmospheric heat transport) + SW - LW
242 #ifdef EBM_VERSION_1BASIN
243 Qnet(i,j,bi,bj) = -1.0*( SW(j,bj) - LW(j,bj) -
244 < Hd35(no_so)*(
245 < 0.000728e4 - 0.00678e4*S(i,j,bj) +
246 < 0.0955e4*S(i,j,bj)**2 + 0.0769e4*S(i,j,bj)**3 -
247 < 0.8508e4*S(i,j,bj)**4 - 0.3581e4*S(i,j,bj)**5 +
248 < 2.9240e4*S(i,j,bj)**6 + 0.8311e4*S(i,j,bj)**7 -
249 < 4.9548e4*S(i,j,bj)**8 - 0.8808e4*S(i,j,bj)**9 +
250 < 4.0644e4*S(i,j,bj)**10 +0.3409e4*S(i,j,bj)**11 -
251 < 1.2893e4*S(i,j,bj)**12 )
252 < /(2*PI*rSphere*rSphere*25.0) )
253 c Qnet(i,j,bi,bj) = -1.0*( SW(j,bj) - LW(j,bj) -
254 c < 0.5*Hd35(no_so)*(3.054e1 - 3.763e1*S(i,j,bj) +
255 c < 1.892e2*S(i,j,bj)**2 + 3.041e2*S(i,j,bj)**3 -
256 c < 1.540e3*S(i,j,bj)**4 - 9.586e2*S(i,j,bj)**5 +
257 c < 2.939e3*S(i,j,bj)**6 + 1.219e3*S(i,j,bj)**7 -
258 c < 2.550e3*S(i,j,bj)**8 - 5.396e2*S(i,j,bj)**9 +
259 c < 8.119e2*S(i,j,bj)**10)
260 c < /(2*PI*rSphere*rSphere*22.3) )
261 #else
262 IF (ReCountX(j,bj) .GT. 0.) THEN
263 Qnet(i,j,bi,bj) = (-90./ReCountX(j,bj))*
264 < ( SW(j,bj) - LW(j,bj) -
265 < Hd35(no_so)*(3.054e1 - 3.763e1*S(i,j,bj) +
266 < 1.892e2*S(i,j,bj)**2 + 3.041e2*S(i,j,bj)**3 -
267 < 1.540e3*S(i,j,bj)**4 - 9.586e2*S(i,j,bj)**5 +
268 < 2.939e3*S(i,j,bj)**6 + 1.219e3*S(i,j,bj)**7 -
269 < 2.550e3*S(i,j,bj)**8 - 5.396e2*S(i,j,bj)**9 +
270 < 8.119e2*S(i,j,bj)**10)
271 < /(2*PI*rSphere*rSphere*22.3) )
272 ELSE
273 Qnet(i,j,bi,bj) = 0.
274 ENDIF
275 #endif
276 c Freshwater Flux = Div(atmospheric moisture transport)
277 c--- conversion of E-P from kg/(s m^2) -> m/s -> psu/s: 1e-3*35/delZ(1)
278 #ifdef EBM_VERSION_1BASIN
279 EmPmR(i,j,bi,bj) = -1.e-3*Fw35(no_so)
280 < *(-0.8454e5*S(i,j,bj)**14 + 0.5367e5*S(i,j,bj)**13
281 < +3.3173e5*S(i,j,bj)**12 - 1.8965e5*S(i,j,bj)**11
282 < -5.1701e5*S(i,j,bj)**10
283 < +2.6240e5*S(i,j,bj)**9 + 4.077e5*S(i,j,bj)**8
284 < -1.791e5*S(i,j,bj)**7
285 < -1.7231e5*S(i,j,bj)**6 + 0.6229e5*S(i,j,bj)**5
286 < +0.3824e5*S(i,j,bj)**4
287 < -0.1017e5*S(i,j,bj)**3 - 0.0387e5*S(i,j,bj)**2
288 < +0.00562e5*S(i,j,bj) + 0.0007743e5)
289 < /(2.0*12.0*PI*rSphere*rSphere)
290 c EmPmR(i,j,bi,bj) = 1.e-3*Fw35(no_so)
291 c < *(50.0 + 228.0*S(i,j,bj) -1.593e3*S(i,j,bj)**2
292 c < - 2.127e3*S(i,j,bj)**3 + 7.3e3*S(i,j,bj)**4
293 c < + 5.799e3*S(i,j,bj)**5 - 1.232e4*S(i,j,bj)**6
294 c < - 6.389e3*S(i,j,bj)**7 + 9.123e3*S(i,j,bj)**8
295 c < + 2.495e3*S(i,j,bj)**9 - 2.567e3*S(i,j,bj)**10)
296 c < /(2*PI*rSphere*rSphere*15.0)
297 #else
298 IF (yC(i,j,bi,bj) .LT. -40.) THEN
299 c-- Southern Hemisphere
300 EmPmR(i,j,bi,bj) = -1.e-3*(Fw35(no_so)*
301 < (-6.5 + 35.3 + 71.7*S(i,j,bj)
302 < - 1336.3*S(i,j,bj)**2 - 425.8*S(i,j,bj)**3
303 < + 5434.8*S(i,j,bj)**4 + 707.9*S(i,j,bj)**5
304 < - 6987.7*S(i,j,bj)**6 - 360.4*S(i,j,bj)**7
305 < + 2855.0*S(i,j,bj)**8)
306 < /(2*PI*rSphere*rSphere*18.0))
307 ELSE
308 c-- Atlantic
309 IF (xC(i,j,bi,bj) .GT. 284.
310 < .OR. xC(i,j,bi,bj) .LT. 28.) THEN
311 EmPmR(i,j,bi,bj) = -1.e-3*(Fw35(no_so)*
312 < (-6.5 -2.878 + 3.157e2*S(i,j,bj) -
313 < 2.388e3*S(i,j,bj)**2 - 4.101e3*S(i,j,bj)**3 +
314 < 1.963e4*S(i,j,bj)**4 + 1.534e4*S(i,j,bj)**5 -
315 < 6.556e4*S(i,j,bj)**6 - 2.478e4*S(i,j,bj)**7 +
316 < 1.083e5*S(i,j,bj)**8 + 1.85e4*S(i,j,bj)**9 -
317 < 8.703e4*S(i,j,bj)**10 - 5.276e3*S(i,j,bj)**11 +
318 < 2.703e4*S(i,j,bj)**12)
319 < /(2*PI*rSphere*rSphere*12.0))
320 ELSE
321 c-- Pacific
322 EmPmR(i,j,bi,bj) = -1.e-3*(Fw35(no_so)
323 < *(-6.5 +51.89 + 4.916e2*S(i,j,bj) -
324 < 1.041e3*S(i,j,bj)**2 - 7.546e3*S(i,j,bj)**3 +
325 < 2.335e3*S(i,j,bj)**4 + 3.449e4*S(i,j,bj)**5 +
326 < 6.702e3*S(i,j,bj)**6 - 6.601e4*S(i,j,bj)**7 -
327 < 2.594e4*S(i,j,bj)**8 + 5.652e4*S(i,j,bj)**9 +
328 < 2.738e4*S(i,j,bj)**10 - 1.795e4*S(i,j,bj)**11 -
329 < 9.486e3*S(i,j,bj)**12)
330 < /(2*PI*rSphere*rSphere*12.0))
331 ENDIF
332 ENDIF
333 #endif
334 ENDDO
335 ENDDO
336 ENDDO
337 ENDDO
338
339 _EXCH_XY_R4(Qnet , myThid )
340 _EXCH_XY_R4(EmPmR , myThid )
341
342
343 C CALL PLOT_FIELD_XYRS( Qnet, 'Qnet' , 1, myThid )
344 C CALL PLOT_FIELD_XYRS( EmPmR, 'EmPmR' , 1, myThid )
345
346 cph end of IF TOP_LAYER
347 cph ENDIF
348
349 #endif /* ALLOW_EBM */
350
351 END
352
353
354
355
356

  ViewVC Help
Powered by ViewVC 1.1.22