/[MITgcm]/MITgcm/pkg/fizhi/fizhi_step_diag.F
ViewVC logotype

Contents of /MITgcm/pkg/fizhi/fizhi_step_diag.F

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


Revision 1.20 - (show annotations) (download)
Tue Mar 20 19:50:45 2012 UTC (12 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.19: +72 -75 lines
fix filling of diag RADSWT

1 C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_step_diag.F,v 1.19 2006/03/09 00:00:36 molod Exp $
2 C $Name: $
3
4 #include "FIZHI_OPTIONS.h"
5 SUBROUTINE FIZHI_STEP_DIAG(myid,p,uphy,vphy,thphy,sphy,qq,pk,dp,
6 & radswt,radswg,swgclr,osr,osrclr,st4,dst4,tgz,tg0,radlwg,lwgclr,
7 & turbu,turbv,turbt,turbq,moistu,moistv,moistt,moistq,
8 & lwdt,swdt,lwdtclr,swdtclr,dlwdtg,
9 & im1,im2,jm1,jm2,Nrphys,Nbi,Nbj,bi,bj,ntracer)
10 C***********************************************************************
11 IMPLICIT NONE
12
13 INTEGER myid,im1,im2,jm1,jm2,Nrphys,Nbi,Nbj,bi,bj,ntracer
14 _RL p(im2,jm2,Nbi,Nbj)
15 _RL uphy(im2,jm2,Nrphys)
16 _RL vphy(im2,jm2,Nrphys)
17 _RL thphy(im2,jm2,Nrphys)
18 _RL sphy(im2,jm2,Nrphys)
19 _RL qq(im2,jm2,Nrphys,Nbi,Nbj),pk(im2,jm2,Nrphys,Nbi,Nbj)
20 _RL dp(im2,jm2,Nrphys,Nbi,Nbj)
21 _RL radswt(im2,jm2,Nbi,Nbj),radswg(im2,jm2,Nbi,Nbj)
22 _RL swgclr(im2,jm2,Nbi,Nbj),osr(im2,jm2,Nbi,Nbj)
23 _RL osrclr(im2,jm2,Nbi,Nbj),st4(im2,jm2,Nbi,Nbj)
24 _RL dst4(im2,jm2,Nbi,Nbj),tgz(im2,jm2,Nbi,Nbj)
25 _RL tg0(im2,jm2,Nbi,Nbj),radlwg(im2,jm2,Nbi,Nbj)
26 _RL lwgclr(im2,jm2,Nbi,Nbj)
27 _RL turbu(im2,jm2,Nrphys,Nbi,Nbj)
28 _RL turbv(im2,jm2,Nrphys,Nbi,Nbj)
29 _RL turbt(im2,jm2,Nrphys,Nbi,Nbj)
30 _RL turbq(im2,jm2,Nrphys,ntracer,Nbi,Nbj)
31 _RL moistu(im2,jm2,Nrphys,Nbi,Nbj)
32 _RL moistv(im2,jm2,Nrphys,Nbi,Nbj)
33 _RL moistt(im2,jm2,Nrphys,Nbi,Nbj)
34 _RL moistq(im2,jm2,Nrphys,ntracer,Nbi,Nbj)
35 _RL lwdt(im2,jm2,Nrphys,Nbi,Nbj)
36 _RL swdt(im2,jm2,Nrphys,Nbi,Nbj)
37 _RL lwdtclr(im2,jm2,Nrphys,Nbi,Nbj)
38 _RL swdtclr(im2,jm2,Nrphys,Nbi,Nbj)
39 _RL dlwdtg(im2,jm2,Nrphys,Nbi,Nbj)
40
41 INTEGER i,j,L
42 _RL getcon, gravity
43 _RL pinv(im2,jm2), qbar(im2,jm2),tmpdiag(im2,jm2)
44 #ifdef ALLOW_DIAGNOSTICS
45 LOGICAL diagnostics_is_on
46 EXTERNAL diagnostics_is_on
47 #endif
48
49 C **********************************************************************
50
51 #ifdef ALLOW_DIAGNOSTICS
52 do j=jm1,jm2
53 do i=im1,im2
54 pinv(i,j) = 1.0 / p(i,j,bi,bj)
55 enddo
56 enddo
57
58 c Surface Pressure (mb)
59 c ---------------------------------
60 call diagnostics_fill(p(1,1,bi,bj),'PS ',0,1,3,bi,bj,myid)
61
62 c Incident Solar Radiation (W/m**2)
63 c ---------------------------------
64 call diagnostics_fill(radswt(1,1,bi,bj),'RADSWT ',
65 & 0,1,3,bi,bj,myid)
66
67 c Net Solar Radiation at the Ground (W/m**2)
68 c ------------------------------------------
69 if(diagnostics_is_on('RADSWG ',myid) ) then
70 do j=jm1,jm2
71 do i=im1,im2
72 tmpdiag(i,j) = radswg(i,j,bi,bj)*radswt(i,j,bi,bj)
73 enddo
74 enddo
75 call diagnostics_fill(tmpdiag,'RADSWG ',0,1,3,bi,bj,myid)
76 endif
77
78 c Net Clear Sky Solar Radiation at the Ground (W/m**2)
79 c ----------------------------------------------------
80 if(diagnostics_is_on('SWGCLR ',myid) ) then
81 do j=jm1,jm2
82 do i=im1,im2
83 tmpdiag(i,j) = swgclr(i,j,bi,bj)*radswt(i,j,bi,bj)
84 enddo
85 enddo
86 call diagnostics_fill(tmpdiag,'SWGCLR ',0,1,3,bi,bj,myid)
87 endif
88
89 c Outgoing Solar Radiation at top (W/m**2)
90 c -----------------------------------------
91 if(diagnostics_is_on('OSR ',myid) ) then
92 do j=jm1,jm2
93 do i=im1,im2
94 tmpdiag(i,j) = (1.0-osr(i,j,bi,bj))*radswt(i,j,bi,bj)
95 enddo
96 enddo
97 call diagnostics_fill(tmpdiag,'OSR ',0,1,3,bi,bj,myid)
98 endif
99
100 c Outgoing Clear Sky Solar Radiation at top (W/m**2)
101 c ---------------------------------------------------
102 if(diagnostics_is_on('OSRCLR ',myid) ) then
103 do j=jm1,jm2
104 do i=im1,im2
105 tmpdiag(i,j) = (1.0-osrclr(i,j,bi,bj))*radswt(i,j,bi,bj)
106 enddo
107 enddo
108 call diagnostics_fill(tmpdiag,'OSRCLR ',0,1,3,bi,bj,myid)
109 endif
110
111 c Planetary Albedo
112 c ----------------
113 if(diagnostics_is_on('PLALBEDO',myid) ) then
114 do j=jm1,jm2
115 do i=im1,im2
116 if(radswt(i,j,bi,bj).ne.0.) then
117 tmpdiag(i,j) = osr(i,j,bi,bj)
118 else
119 tmpdiag(i,j) = 0.
120 endif
121 enddo
122 enddo
123 call diagnostics_fill(tmpdiag,'PLALBEDO',0,1,3,bi,bj,myid)
124 endif
125
126 c Upward Longwave Flux at the Ground (W/m**2)
127 c -------------------------------------------
128 if(diagnostics_is_on('LWGUP ',myid) ) then
129 do j=jm1,jm2
130 do i=im1,im2
131 tmpdiag(i,j) = st4(i,j,bi,bj)
132 & + dst4(i,j,bi,bj)*(tgz(i,j,bi,bj)-tg0(i,j,bi,bj))
133 enddo
134 enddo
135 call diagnostics_fill(tmpdiag,'LWGUP ',0,1,3,bi,bj,myid)
136 endif
137
138 c Net Longwave Flux at the Ground (W/m**2)
139 c ----------------------------------------
140 if(diagnostics_is_on('RADLWG ',myid) ) then
141 do j=jm1,jm2
142 do i=im1,im2
143 tmpdiag(i,j) = radlwg(i,j,bi,bj) +
144 & dst4(i,j,bi,bj)*(tgz(i,j,bi,bj)-tg0(i,j,bi,bj))
145 enddo
146 enddo
147 call diagnostics_fill(tmpdiag,'RADLWG ',0,1,3,bi,bj,myid)
148 endif
149
150 c Net Longwave Flux at the Ground Clear Sky (W/m**2)
151 c --------------------------------------------------
152 if(diagnostics_is_on('LWGCLR ',myid) ) then
153 do j=jm1,jm2
154 do i=im1,im2
155 tmpdiag(i,j) = lwgclr(i,j,bi,bj) +
156 & dst4(i,j,bi,bj)*(tgz(i,j,bi,bj)-tg0(i,j,bi,bj))
157 enddo
158 enddo
159 call diagnostics_fill(tmpdiag,'LWGCLR ',0,1,3,bi,bj,myid)
160 endif
161
162 C **********************************************************************
163 do L=1,Nrphys
164
165 c Total Diabatic U-Tendency (m/sec/day)
166 c -------------------------------------
167 if(diagnostics_is_on('DIABU ',myid) ) then
168 do j=jm1,jm2
169 do i=im1,im2
170 tmpdiag(i,j) = (moistu (i,j,L,bi,bj)+turbu(i,j,L,bi,bj) )*86400
171 enddo
172 enddo
173 call diagnostics_fill(tmpdiag,'DIABU ',L,1,3,bi,bj,myid)
174 endif
175
176 c Total Diabatic V-Tendency (m/sec/day)
177 c -------------------------------------
178 if(diagnostics_is_on('DIABV ',myid) ) then
179 do j=jm1,jm2
180 do i=im1,im2
181 tmpdiag(i,j) = (moistv (i,j,L,bi,bj)+turbv(i,j,L,bi,bj) )*86400
182 enddo
183 enddo
184 call diagnostics_fill(tmpdiag,'DIABV ',L,1,3,bi,bj,myid)
185 endif
186
187 c Total Diabatic T-Tendency (deg/day)
188 c -----------------------------------
189 if(diagnostics_is_on('DIABT ',myid) ) then
190 do j=jm1,jm2
191 do i=im1,im2
192 tmpdiag(i,j) =
193 & ( turbt(i,j,L,bi,bj) + moistt(i,j,L,bi,bj) +
194 & lwdt(i,j,L,bi,bj) +
195 & dlwdtg(i,j,L,bi,bj)*(tgz(i,j,bi,bj)-tg0(i,j,bi,bj)) +
196 & swdt(i,j,L,bi,bj)*radswt(i,j,bi,bj) )
197 & * pk(i,j,L,bi,bj)*pinv(i,j)*86400
198 enddo
199 enddo
200 call diagnostics_fill(tmpdiag,'DIABT ',L,1,3,bi,bj,myid)
201 endif
202
203 c Total Diabatic Q-Tendency (g/kg/day)
204 c ------------------------------------
205 if(diagnostics_is_on('DIABQ ',myid) ) then
206 do j=jm1,jm2
207 do i=im1,im2
208 tmpdiag(i,j) =
209 & ( turbq(i,j,L,1,bi,bj) + moistq(i,j,L,1,bi,bj) ) *
210 & pinv(i,j)*86400*1000
211 enddo
212 enddo
213 call diagnostics_fill(tmpdiag,'DIABQ ',L,1,3,bi,bj,myid)
214 endif
215
216 c Longwave Heating (deg/day)
217 c --------------------------
218 if(diagnostics_is_on('RADLW ',myid) ) then
219 do j=jm1,jm2
220 do i=im1,im2
221 tmpdiag(i,j) =
222 & ( lwdt(i,j,l,bi,bj) +
223 & dlwdtg (i,j,L,bi,bj)*(tgz(i,j,bi,bj)-tg0(i,j,bi,bj)) )
224 & * pk(i,j,l,bi,bj)*pinv(i,j)*86400
225 enddo
226 enddo
227 call diagnostics_fill(tmpdiag,'RADLW ',L,1,3,bi,bj,myid)
228 endif
229
230 c Longwave Heating Clear-Sky (deg/day)
231 c ------------------------------------
232 if(diagnostics_is_on('LWCLR ',myid) ) then
233 do j=jm1,jm2
234 do i=im1,im2
235 tmpdiag(i,j) =
236 & ( lwdtclr(i,j,l,bi,bj) +
237 & dlwdtg (i,j,L,bi,bj)*(tgz(i,j,bi,bj)-tg0(i,j,bi,bj)) )
238 & * pk(i,j,l,bi,bj)*pinv(i,j)*86400
239 enddo
240 enddo
241 call diagnostics_fill(tmpdiag,'LWCLR ',L,1,3,bi,bj,myid)
242 endif
243
244 c Solar Radiative Heating (deg/day)
245 c ---------------------------------
246 if(diagnostics_is_on('RADSW ',myid) ) then
247 do j=jm1,jm2
248 do i=im1,im2
249 tmpdiag(i,j) =
250 & + swdt(i,j,l,bi,bj)*radswt(i,j,bi,bj)*
251 & pk(i,j,l,bi,bj)*pinv(i,j)*86400
252 enddo
253 enddo
254 call diagnostics_fill(tmpdiag,'RADSW ',L,1,3,bi,bj,myid)
255 endif
256
257 c Clear Sky Solar Radiative Heating (deg/day)
258 c -------------------------------------------
259 if(diagnostics_is_on('SWCLR ',myid) ) then
260 do j=jm1,jm2
261 do i=im1,im2
262 tmpdiag(i,j) =
263 & + swdtclr(i,j,l,bi,bj)*radswt(i,j,bi,bj)*
264 & pk(i,j,l,bi,bj)*pinv(i,j)*86400
265 enddo
266 enddo
267 call diagnostics_fill(tmpdiag,'SWCLR ',L,1,3,bi,bj,myid)
268 endif
269
270 c Averaged U-Field (m/sec)
271 c ------------------------
272 if(diagnostics_is_on('UWND ',myid) ) then
273 do j=jm1,jm2
274 do i=im1,im2
275 tmpdiag(i,j) = uphy(i,j,L)
276 enddo
277 enddo
278 call diagnostics_fill(tmpdiag,'UWND ',L,1,3,bi,bj,myid)
279 endif
280
281 c Averaged V-Field (m/sec)
282 c ------------------------
283 if(diagnostics_is_on('VWND ',myid) ) then
284 do j=jm1,jm2
285 do i=im1,im2
286 tmpdiag(i,j) = vphy(i,j,L)
287 enddo
288 enddo
289 call diagnostics_fill(tmpdiag,'VWND ',L,1,3,bi,bj,myid)
290 endif
291
292 c Averaged T-Field (deg)
293 c ----------------------
294 if(diagnostics_is_on('TMPU ',myid) ) then
295 do j=jm1,jm2
296 do i=im1,im2
297 tmpdiag(i,j) = thphy(i,j,L)*pk(i,j,L,bi,bj)
298 enddo
299 enddo
300 call diagnostics_fill(tmpdiag,'TMPU ',L,1,3,bi,bj,myid)
301 endif
302
303 c Averaged QQ-Field (m/sec)**2
304 c ----------------------------
305 if(diagnostics_is_on('TKE ',myid) ) then
306 do j=jm1,jm2
307 do i=im1,im2
308 tmpdiag(i,j) = qq(i,j,L,bi,bj)
309 enddo
310 enddo
311 call diagnostics_fill(tmpdiag,'TKE ',L,1,3,bi,bj,myid)
312 endif
313
314 c Averaged Q-Field (g/kg)
315 c -----------------------
316 if(diagnostics_is_on('SPHU ',myid) ) then
317 do j=jm1,jm2
318 do i=im1,im2
319 tmpdiag(i,j) = sphy(i,j,L) * 1000.
320 enddo
321 enddo
322 call diagnostics_fill(tmpdiag,'SPHU ',L,1,3,bi,bj,myid)
323 endif
324
325 enddo
326
327 C **********************************************************************
328
329 c Vertically Averaged Moist-T Increment (K/day)
330 c ---------------------------------------------
331 if(diagnostics_is_on('VDTMOIST',myid) ) then
332 do j=jm1,jm2
333 do i=im1,im2
334 qbar(i,j) = 0.0
335 enddo
336 enddo
337 do L=1,Nrphys
338 do j=jm1,jm2
339 do i=im1,im2
340 qbar(i,j) = qbar(i,j) +
341 & moistt(i,j,L,bi,bj)*pk(i,j,l,bi,bj)*dp(i,j,L,bi,bj)
342 enddo
343 enddo
344 enddo
345 do j=jm1,jm2
346 do i=im1,im2
347 tmpdiag(i,j) = qbar(i,j)*pinv(i,j)*pinv(i,j)*86400
348 enddo
349 enddo
350 call diagnostics_fill(tmpdiag,'VDTMOIST',0,1,3,bi,bj,myid)
351 endif
352
353 c Vertically Averaged Turb-T Increment (K/day)
354 c --------------------------------------------
355 if(diagnostics_is_on('VDTTURB ',myid) ) then
356 do j=jm1,jm2
357 do i=im1,im2
358 qbar(i,j) = 0.0
359 enddo
360 enddo
361 do L=1,Nrphys
362 do j=jm1,jm2
363 do i=im1,im2
364 qbar(i,j) = qbar(i,j) +
365 & turbt(i,j,L,bi,bj)*pk(i,j,l,bi,bj)*dp(i,j,L,bi,bj)
366 enddo
367 enddo
368 enddo
369 do j=jm1,jm2
370 do i=im1,im2
371 tmpdiag(i,j) = qbar(i,j)*pinv(i,j)*pinv(i,j)*86400
372 enddo
373 enddo
374 call diagnostics_fill(tmpdiag,'VDTTURB ',0,1,3,bi,bj,myid)
375 endif
376
377 c Vertically Averaged RADLW Temperature Increment (K/day)
378 c -------------------------------------------------------
379 if(diagnostics_is_on('VDTRADLW',myid) ) then
380 do j=jm1,jm2
381 do i=im1,im2
382 qbar(i,j) = 0.0
383 enddo
384 enddo
385 do L=1,Nrphys
386 do j=jm1,jm2
387 do i=im1,im2
388 qbar(i,j) = qbar(i,j) + ( lwdt(i,j,L,bi,bj) +
389 & dlwdtg(i,j,L,bi,bj)*(tgz(i,j,bi,bj)-tg0(i,j,bi,bj)) )
390 & *pk(i,j,l,bi,bj)*dp(i,j,L,bi,bj)
391 enddo
392 enddo
393 enddo
394 do j=jm1,jm2
395 do i=im1,im2
396 tmpdiag(i,j) = qbar(i,j)*pinv(i,j)*pinv(i,j)*86400
397 enddo
398 enddo
399 call diagnostics_fill(tmpdiag,'VDTRADLW',0,1,3,bi,bj,myid)
400 endif
401
402 c Vertically Averaged RADSW Temperature Increment (K/day)
403 c -------------------------------------------------------
404 if(diagnostics_is_on('VDTRADSW',myid) ) then
405 do j=jm1,jm2
406 do i=im1,im2
407 qbar(i,j) = 0.0
408 enddo
409 enddo
410 do L=1,Nrphys
411 do j=jm1,jm2
412 do i=im1,im2
413 qbar(i,j) = qbar(i,j) +
414 & swdt(i,j,L,bi,bj)*pk(i,j,l,bi,bj)*dp(i,j,L,bi,bj)
415 enddo
416 enddo
417 enddo
418 do j=jm1,jm2
419 do i=im1,im2
420 tmpdiag(i,j) = qbar(i,j) *
421 & radswt(i,j,bi,bj) * pinv(i,j) * pinv(i,j) * 86400
422 enddo
423 enddo
424 call diagnostics_fill(tmpdiag,'VDTRADSW',0,1,3,bi,bj,myid)
425 endif
426
427 c Total Precipitable Water (g/cm^2)
428 c ---------------------------------------------
429 if(diagnostics_is_on('TPW ',myid) ) then
430 gravity = getcon('GRAVITY')
431 do j=jm1,jm2
432 do i=im1,im2
433 qbar(i,j) = 0.0
434 enddo
435 enddo
436 do L=1,Nrphys
437 do j=jm1,jm2
438 do i=im1,im2
439 qbar(i,j) = qbar(i,j) +
440 & sphy(i,j,L)*dp(i,j,L,bi,bj)
441 enddo
442 enddo
443 enddo
444 do j=jm1,jm2
445 do i=im1,im2
446 tmpdiag(i,j) = qbar(i,j)*10. _d 0 /gravity
447 enddo
448 enddo
449 call diagnostics_fill(tmpdiag,'TPW ',0,1,3,bi,bj,myid)
450 endif
451 #endif
452 return
453 end

  ViewVC Help
Powered by ViewVC 1.1.22