/[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.15 - (show annotations) (download)
Sat May 21 23:50:13 2005 UTC (19 years, 1 month ago) by molod
Branch: MAIN
Changes since 1.14: +234 -269 lines
Change code to use standard diagnostics filling

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

  ViewVC Help
Powered by ViewVC 1.1.22