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

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

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


Revision 1.5 - (hide annotations) (download)
Mon Oct 1 13:35:34 2007 UTC (16 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59k, checkpoint59j, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61l, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i
Changes since 1.4: +4 -11 lines
Change EmPmR units: from m/s to kg/m2/s

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

  ViewVC Help
Powered by ViewVC 1.1.22