1 | !WRF:MEDIATION_LAYER:PHYSICS |
---|
2 | ! |
---|
3 | |
---|
4 | MODULE module_diagnostics |
---|
5 | CONTAINS |
---|
6 | SUBROUTINE diagnostic_output_calc( & |
---|
7 | ids,ide, jds,jde, kds,kde, & |
---|
8 | ims,ime, jms,jme, kms,kme, & |
---|
9 | ips,ipe, jps,jpe, kps,kpe, & ! patch dims |
---|
10 | i_start,i_end,j_start,j_end,kts,kte,num_tiles & |
---|
11 | ,dpsdt,dmudt & |
---|
12 | ,p8w,pk1m,mu_2,mu_2m & |
---|
13 | ,u,v & |
---|
14 | ,raincv,rainncv,rainc,rainnc & |
---|
15 | ,i_rainc,i_rainnc & |
---|
16 | ,hfx,sfcevp,lh & |
---|
17 | ,ACSWUPT,ACSWUPTC,ACSWDNT,ACSWDNTC & ! Optional |
---|
18 | ,ACSWUPB,ACSWUPBC,ACSWDNB,ACSWDNBC & ! Optional |
---|
19 | ,ACLWUPT,ACLWUPTC,ACLWDNT,ACLWDNTC & ! Optional |
---|
20 | ,ACLWUPB,ACLWUPBC,ACLWDNB,ACLWDNBC & ! Optional |
---|
21 | ,I_ACSWUPT,I_ACSWUPTC,I_ACSWDNT,I_ACSWDNTC & ! Optional |
---|
22 | ,I_ACSWUPB,I_ACSWUPBC,I_ACSWDNB,I_ACSWDNBC & ! Optional |
---|
23 | ,I_ACLWUPT,I_ACLWUPTC,I_ACLWDNT,I_ACLWDNTC & ! Optional |
---|
24 | ,I_ACLWUPB,I_ACLWUPBC,I_ACLWDNB,I_ACLWDNBC & ! Optional |
---|
25 | ,dt,xtime,sbw,t2 & |
---|
26 | ,diag_print & |
---|
27 | ,bucket_mm, bucket_J & |
---|
28 | ,prec_acc_c, prec_acc_nc, snow_acc_nc & |
---|
29 | ,snowncv, prec_acc_dt, curr_secs & |
---|
30 | ) |
---|
31 | !---------------------------------------------------------------------- |
---|
32 | |
---|
33 | USE module_dm, ONLY: wrf_dm_sum_real, wrf_dm_maxval |
---|
34 | |
---|
35 | IMPLICIT NONE |
---|
36 | !====================================================================== |
---|
37 | ! Definitions |
---|
38 | !----------- |
---|
39 | !-- DIAG_PRINT print control: 0 - no diagnostics; 1 - dmudt only; 2 - all |
---|
40 | !-- DT time step (second) |
---|
41 | !-- XTIME forecast time |
---|
42 | !-- SBW specified boundary width - used later |
---|
43 | ! |
---|
44 | !-- P8W 3D pressure array at full eta levels |
---|
45 | !-- MU dry column hydrostatic pressure |
---|
46 | !-- RAINC cumulus scheme precipitation since hour 0 |
---|
47 | !-- RAINCV cumulus scheme precipitation in one time step (mm) |
---|
48 | !-- RAINNC explicit scheme precipitation since hour 0 |
---|
49 | !-- RAINNCV explicit scheme precipitation in one time step (mm) |
---|
50 | !-- SNOWNCV explicit scheme snow in one time step (mm) |
---|
51 | !-- HFX surface sensible heat flux |
---|
52 | !-- LH surface latent heat flux |
---|
53 | !-- SFCEVP total surface evaporation |
---|
54 | !-- U u component of wind - to be used later to compute k.e. |
---|
55 | !-- V v component of wind - to be used later to compute k.e. |
---|
56 | !-- PREC_ACC_C accumulated convective precip over accumulation time prec_acc_dt |
---|
57 | !-- PREC_ACC_NC accumulated explicit precip over accumulation time prec_acc_dt |
---|
58 | !-- SNOW_ACC_NC accumulated explicit snow precip over accumulation time prec_acc_dt |
---|
59 | !-- PREC_ACC_DT precip accumulation time, default is 60 min |
---|
60 | !-- CURR_SECS model time in seconds |
---|
61 | ! |
---|
62 | !-- ids start index for i in domain |
---|
63 | !-- ide end index for i in domain |
---|
64 | !-- jds start index for j in domain |
---|
65 | !-- jde end index for j in domain |
---|
66 | !-- kds start index for k in domain |
---|
67 | !-- kde end index for k in domain |
---|
68 | !-- ims start index for i in memory |
---|
69 | !-- ime end index for i in memory |
---|
70 | !-- jms start index for j in memory |
---|
71 | !-- jme end index for j in memory |
---|
72 | !-- ips start index for i in patch |
---|
73 | !-- ipe end index for i in patch |
---|
74 | !-- jps start index for j in patch |
---|
75 | !-- jpe end index for j in patch |
---|
76 | !-- kms start index for k in memory |
---|
77 | !-- kme end index for k in memory |
---|
78 | !-- i_start start indices for i in tile |
---|
79 | !-- i_end end indices for i in tile |
---|
80 | !-- j_start start indices for j in tile |
---|
81 | !-- j_end end indices for j in tile |
---|
82 | !-- kts start index for k in tile |
---|
83 | !-- kte end index for k in tile |
---|
84 | !-- num_tiles number of tiles |
---|
85 | ! |
---|
86 | !====================================================================== |
---|
87 | |
---|
88 | INTEGER, INTENT(IN ) :: & |
---|
89 | ids,ide, jds,jde, kds,kde, & |
---|
90 | ims,ime, jms,jme, kms,kme, & |
---|
91 | ips,ipe, jps,jpe, kps,kpe, & |
---|
92 | kts,kte, & |
---|
93 | num_tiles |
---|
94 | |
---|
95 | INTEGER, DIMENSION(num_tiles), INTENT(IN) :: & |
---|
96 | & i_start,i_end,j_start,j_end |
---|
97 | |
---|
98 | INTEGER, INTENT(IN ) :: diag_print |
---|
99 | REAL, INTENT(IN ) :: bucket_mm, bucket_J |
---|
100 | |
---|
101 | REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), & |
---|
102 | INTENT(IN ) :: u & |
---|
103 | , v & |
---|
104 | , p8w |
---|
105 | |
---|
106 | REAL, DIMENSION( ims:ime , jms:jme ), INTENT(IN) :: & |
---|
107 | MU_2 & |
---|
108 | , RAINNCV & |
---|
109 | , RAINCV & |
---|
110 | , SNOWNCV & |
---|
111 | , HFX & |
---|
112 | , LH & |
---|
113 | , SFCEVP & |
---|
114 | , T2 |
---|
115 | |
---|
116 | REAL, DIMENSION( ims:ime , jms:jme ), & |
---|
117 | INTENT(INOUT) :: DPSDT & |
---|
118 | , DMUDT & |
---|
119 | , RAINNC & |
---|
120 | , RAINC & |
---|
121 | , MU_2M & |
---|
122 | , PK1M |
---|
123 | |
---|
124 | REAL, INTENT(IN ) :: DT, XTIME |
---|
125 | INTEGER, INTENT(IN ) :: SBW |
---|
126 | INTEGER, DIMENSION( ims:ime , jms:jme ), INTENT(INOUT) :: & |
---|
127 | I_RAINC, & |
---|
128 | I_RAINNC |
---|
129 | REAL, DIMENSION( ims:ime, jms:jme ), OPTIONAL, INTENT(INOUT) ::& |
---|
130 | ACSWUPT,ACSWUPTC,ACSWDNT,ACSWDNTC, & |
---|
131 | ACSWUPB,ACSWUPBC,ACSWDNB,ACSWDNBC, & |
---|
132 | ACLWUPT,ACLWUPTC,ACLWDNT,ACLWDNTC, & |
---|
133 | ACLWUPB,ACLWUPBC,ACLWDNB,ACLWDNBC |
---|
134 | INTEGER, DIMENSION( ims:ime, jms:jme ), OPTIONAL, INTENT(INOUT) ::& |
---|
135 | I_ACSWUPT,I_ACSWUPTC,I_ACSWDNT,I_ACSWDNTC, & |
---|
136 | I_ACSWUPB,I_ACSWUPBC,I_ACSWDNB,I_ACSWDNBC, & |
---|
137 | I_ACLWUPT,I_ACLWUPTC,I_ACLWDNT,I_ACLWDNTC, & |
---|
138 | I_ACLWUPB,I_ACLWUPBC,I_ACLWDNB,I_ACLWDNBC |
---|
139 | |
---|
140 | REAL, DIMENSION( ims:ime, jms:jme ), OPTIONAL, INTENT(INOUT) ::& |
---|
141 | PREC_ACC_C, PREC_ACC_NC, SNOW_ACC_NC |
---|
142 | |
---|
143 | REAL, OPTIONAL, INTENT(IN):: PREC_ACC_DT, CURR_SECS |
---|
144 | |
---|
145 | INTEGER :: i,j,k,its,ite,jts,jte,ij |
---|
146 | INTEGER :: idp,jdp,irc,jrc,irnc,jrnc,isnh,jsnh |
---|
147 | INTEGER :: prfreq |
---|
148 | |
---|
149 | REAL :: no_points |
---|
150 | REAL :: dpsdt_sum, dmudt_sum, dardt_sum, drcdt_sum, drndt_sum |
---|
151 | REAL :: hfx_sum, lh_sum, sfcevp_sum, rainc_sum, rainnc_sum, raint_sum |
---|
152 | REAL :: dmumax, raincmax, rainncmax, snowhmax |
---|
153 | LOGICAL, EXTERNAL :: wrf_dm_on_monitor |
---|
154 | CHARACTER*256 :: outstring |
---|
155 | CHARACTER*6 :: grid_str |
---|
156 | |
---|
157 | !----------------------------------------------------------------- |
---|
158 | ! Handle accumulations with buckets to prevent round-off truncation in long runs |
---|
159 | ! This is done every 360 minutes assuming time step fits exactly into 360 minutes |
---|
160 | IF(bucket_mm .gt. 0. .AND. MOD(NINT(XTIME),360) .EQ. 0)THEN |
---|
161 | ! SET START AND END POINTS FOR TILES |
---|
162 | ! !$OMP PARALLEL DO & |
---|
163 | ! !$OMP PRIVATE ( ij ) |
---|
164 | |
---|
165 | DO ij = 1 , num_tiles |
---|
166 | |
---|
167 | IF (xtime .eq. 0.0)THEN |
---|
168 | DO j=j_start(ij),j_end(ij) |
---|
169 | DO i=i_start(ij),i_end(ij) |
---|
170 | i_rainnc(i,j) = 0 |
---|
171 | i_rainc(i,j) = 0 |
---|
172 | ENDDO |
---|
173 | ENDDO |
---|
174 | ENDIF |
---|
175 | DO j=j_start(ij),j_end(ij) |
---|
176 | DO i=i_start(ij),i_end(ij) |
---|
177 | IF(rainnc(i,j) .gt. bucket_mm)THEN |
---|
178 | rainnc(i,j) = rainnc(i,j) - bucket_mm |
---|
179 | i_rainnc(i,j) = i_rainnc(i,j) + 1 |
---|
180 | ENDIF |
---|
181 | IF(rainc(i,j) .gt. bucket_mm)THEN |
---|
182 | rainc(i,j) = rainc(i,j) - bucket_mm |
---|
183 | i_rainc(i,j) = i_rainc(i,j) + 1 |
---|
184 | ENDIF |
---|
185 | ENDDO |
---|
186 | ENDDO |
---|
187 | |
---|
188 | IF (xtime .eq. 0.0 .and. bucket_J .gt. 0.0 .and. PRESENT(ACSWUPT))THEN |
---|
189 | DO j=j_start(ij),j_end(ij) |
---|
190 | DO i=i_start(ij),i_end(ij) |
---|
191 | i_acswupt(i,j) = 0 |
---|
192 | i_acswuptc(i,j) = 0 |
---|
193 | i_acswdnt(i,j) = 0 |
---|
194 | i_acswdntc(i,j) = 0 |
---|
195 | i_acswupb(i,j) = 0 |
---|
196 | i_acswupbc(i,j) = 0 |
---|
197 | i_acswdnb(i,j) = 0 |
---|
198 | i_acswdnbc(i,j) = 0 |
---|
199 | ENDDO |
---|
200 | ENDDO |
---|
201 | ENDIF |
---|
202 | IF (xtime .eq. 0.0 .and. bucket_J .gt. 0.0 .and. PRESENT(ACLWUPT))THEN |
---|
203 | DO j=j_start(ij),j_end(ij) |
---|
204 | DO i=i_start(ij),i_end(ij) |
---|
205 | i_aclwupt(i,j) = 0 |
---|
206 | i_aclwuptc(i,j) = 0 |
---|
207 | i_aclwdnt(i,j) = 0 |
---|
208 | i_aclwdntc(i,j) = 0 |
---|
209 | i_aclwupb(i,j) = 0 |
---|
210 | i_aclwupbc(i,j) = 0 |
---|
211 | i_aclwdnb(i,j) = 0 |
---|
212 | i_aclwdnbc(i,j) = 0 |
---|
213 | ENDDO |
---|
214 | ENDDO |
---|
215 | ENDIF |
---|
216 | IF (PRESENT(ACSWUPT) .and. bucket_J .gt. 0.0)THEN |
---|
217 | DO j=j_start(ij),j_end(ij) |
---|
218 | DO i=i_start(ij),i_end(ij) |
---|
219 | IF(acswupt(i,j) .gt. bucket_J)THEN |
---|
220 | acswupt(i,j) = acswupt(i,j) - bucket_J |
---|
221 | i_acswupt(i,j) = i_acswupt(i,j) + 1 |
---|
222 | ENDIF |
---|
223 | IF(acswuptc(i,j) .gt. bucket_J)THEN |
---|
224 | acswuptc(i,j) = acswuptc(i,j) - bucket_J |
---|
225 | i_acswuptc(i,j) = i_acswuptc(i,j) + 1 |
---|
226 | ENDIF |
---|
227 | IF(acswdnt(i,j) .gt. bucket_J)THEN |
---|
228 | acswdnt(i,j) = acswdnt(i,j) - bucket_J |
---|
229 | i_acswdnt(i,j) = i_acswdnt(i,j) + 1 |
---|
230 | ENDIF |
---|
231 | IF(acswdntc(i,j) .gt. bucket_J)THEN |
---|
232 | acswdntc(i,j) = acswdntc(i,j) - bucket_J |
---|
233 | i_acswdntc(i,j) = i_acswdntc(i,j) + 1 |
---|
234 | ENDIF |
---|
235 | IF(acswupb(i,j) .gt. bucket_J)THEN |
---|
236 | acswupb(i,j) = acswupb(i,j) - bucket_J |
---|
237 | i_acswupb(i,j) = i_acswupb(i,j) + 1 |
---|
238 | ENDIF |
---|
239 | IF(acswupbc(i,j) .gt. bucket_J)THEN |
---|
240 | acswupbc(i,j) = acswupbc(i,j) - bucket_J |
---|
241 | i_acswupbc(i,j) = i_acswupbc(i,j) + 1 |
---|
242 | ENDIF |
---|
243 | IF(acswdnb(i,j) .gt. bucket_J)THEN |
---|
244 | acswdnb(i,j) = acswdnb(i,j) - bucket_J |
---|
245 | i_acswdnb(i,j) = i_acswdnb(i,j) + 1 |
---|
246 | ENDIF |
---|
247 | IF(acswdnbc(i,j) .gt. bucket_J)THEN |
---|
248 | acswdnbc(i,j) = acswdnbc(i,j) - bucket_J |
---|
249 | i_acswdnbc(i,j) = i_acswdnbc(i,j) + 1 |
---|
250 | ENDIF |
---|
251 | ENDDO |
---|
252 | ENDDO |
---|
253 | ENDIF |
---|
254 | IF (PRESENT(ACLWUPT) .and. bucket_J .gt. 0.0)THEN |
---|
255 | DO j=j_start(ij),j_end(ij) |
---|
256 | DO i=i_start(ij),i_end(ij) |
---|
257 | IF(aclwupt(i,j) .gt. bucket_J)THEN |
---|
258 | aclwupt(i,j) = aclwupt(i,j) - bucket_J |
---|
259 | i_aclwupt(i,j) = i_aclwupt(i,j) + 1 |
---|
260 | ENDIF |
---|
261 | IF(aclwuptc(i,j) .gt. bucket_J)THEN |
---|
262 | aclwuptc(i,j) = aclwuptc(i,j) - bucket_J |
---|
263 | i_aclwuptc(i,j) = i_aclwuptc(i,j) + 1 |
---|
264 | ENDIF |
---|
265 | IF(aclwdnt(i,j) .gt. bucket_J)THEN |
---|
266 | aclwdnt(i,j) = aclwdnt(i,j) - bucket_J |
---|
267 | i_aclwdnt(i,j) = i_aclwdnt(i,j) + 1 |
---|
268 | ENDIF |
---|
269 | IF(aclwdntc(i,j) .gt. bucket_J)THEN |
---|
270 | aclwdntc(i,j) = aclwdntc(i,j) - bucket_J |
---|
271 | i_aclwdntc(i,j) = i_aclwdntc(i,j) + 1 |
---|
272 | ENDIF |
---|
273 | IF(aclwupb(i,j) .gt. bucket_J)THEN |
---|
274 | aclwupb(i,j) = aclwupb(i,j) - bucket_J |
---|
275 | i_aclwupb(i,j) = i_aclwupb(i,j) + 1 |
---|
276 | ENDIF |
---|
277 | IF(aclwupbc(i,j) .gt. bucket_J)THEN |
---|
278 | aclwupbc(i,j) = aclwupbc(i,j) - bucket_J |
---|
279 | i_aclwupbc(i,j) = i_aclwupbc(i,j) + 1 |
---|
280 | ENDIF |
---|
281 | IF(aclwdnb(i,j) .gt. bucket_J)THEN |
---|
282 | aclwdnb(i,j) = aclwdnb(i,j) - bucket_J |
---|
283 | i_aclwdnb(i,j) = i_aclwdnb(i,j) + 1 |
---|
284 | ENDIF |
---|
285 | IF(aclwdnbc(i,j) .gt. bucket_J)THEN |
---|
286 | aclwdnbc(i,j) = aclwdnbc(i,j) - bucket_J |
---|
287 | i_aclwdnbc(i,j) = i_aclwdnbc(i,j) + 1 |
---|
288 | ENDIF |
---|
289 | ENDDO |
---|
290 | ENDDO |
---|
291 | ENDIF |
---|
292 | ENDDO |
---|
293 | ! !$OMP END PARALLEL DO |
---|
294 | ENDIF |
---|
295 | |
---|
296 | ! Compute precipitation accumulation in a given time window: prec_acc_dt |
---|
297 | IF (prec_acc_dt .gt. 0.) THEN |
---|
298 | |
---|
299 | ! !$OMP PARALLEL DO & |
---|
300 | ! !$OMP PRIVATE ( ij ) |
---|
301 | |
---|
302 | DO ij = 1 , num_tiles |
---|
303 | |
---|
304 | DO j=j_start(ij),j_end(ij) |
---|
305 | DO i=i_start(ij),i_end(ij) |
---|
306 | IF (mod(curr_secs, 60.* prec_acc_dt) == 0.) THEN |
---|
307 | prec_acc_c(i,j) = 0. |
---|
308 | prec_acc_nc(i,j) = 0. |
---|
309 | snow_acc_nc(i,j) = 0. |
---|
310 | ENDIF |
---|
311 | prec_acc_c(i,j) = prec_acc_c(i,j) + RAINCV(i,j) |
---|
312 | prec_acc_nc(i,j) = prec_acc_nc(i,j) + RAINNCV(i,j) |
---|
313 | prec_acc_c(i,j) = MAX (prec_acc_c(i,j), 0.0) |
---|
314 | prec_acc_nc(i,j) = MAX (prec_acc_nc(i,j), 0.0) |
---|
315 | snow_acc_nc(i,j) = snow_acc_nc(i,j) + SNOWNCV(I,J) |
---|
316 | ! add convective precip to snow bucket if t2 < 273.15 |
---|
317 | IF ( t2(i,j) .lt. 273.15 ) THEN |
---|
318 | snow_acc_nc(i,j) = snow_acc_nc(i,j) + RAINCV(i,j) |
---|
319 | snow_acc_nc(i,j) = MAX (snow_acc_nc(i,j), 0.0) |
---|
320 | ENDIF |
---|
321 | ENDDO |
---|
322 | ENDDO |
---|
323 | |
---|
324 | ENDDO |
---|
325 | |
---|
326 | ! !$OMP END PARALLEL DO |
---|
327 | ENDIF |
---|
328 | |
---|
329 | if (diag_print .eq. 0 ) return |
---|
330 | |
---|
331 | IF ( xtime .ne. 0. ) THEN |
---|
332 | |
---|
333 | if(diag_print.eq.1) then |
---|
334 | prfreq = dt |
---|
335 | ! prfreq = max(2,int(dt/60.)) ! in min |
---|
336 | else |
---|
337 | prfreq=10 ! in min |
---|
338 | endif |
---|
339 | |
---|
340 | IF (MOD(nint(dt),prfreq) == 0) THEN |
---|
341 | |
---|
342 | ! COMPUTE THE NUMBER OF MASS GRID POINTS |
---|
343 | no_points = float((ide-ids)*(jde-jds)) |
---|
344 | |
---|
345 | ! SET START AND END POINTS FOR TILES |
---|
346 | ! !$OMP PARALLEL DO & |
---|
347 | ! !$OMP PRIVATE ( ij ) |
---|
348 | |
---|
349 | dmumax = 0. |
---|
350 | DO ij = 1 , num_tiles |
---|
351 | |
---|
352 | ! print *, i_start(ij),i_end(ij),j_start(ij),j_end(ij) |
---|
353 | DO j=j_start(ij),j_end(ij) |
---|
354 | DO i=i_start(ij),i_end(ij) |
---|
355 | dpsdt(i,j)=(p8w(i,kms,j)-pk1m(i,j))/dt |
---|
356 | dmudt(i,j)=(mu_2(i,j)-mu_2m(i,j))/dt |
---|
357 | if(abs(dmudt(i,j)*dt).gt.dmumax)then |
---|
358 | dmumax=abs(dmudt(i,j)*dt) |
---|
359 | idp=i |
---|
360 | jdp=j |
---|
361 | endif |
---|
362 | ENDDO |
---|
363 | ENDDO |
---|
364 | |
---|
365 | ENDDO |
---|
366 | ! !$OMP END PARALLEL DO |
---|
367 | |
---|
368 | ! convert DMUMAX from (PA) to (bars) per time step |
---|
369 | dmumax = dmumax*1.e-5 |
---|
370 | ! compute global MAX |
---|
371 | CALL wrf_dm_maxval ( dmumax, idp, jdp ) |
---|
372 | |
---|
373 | ! print *, 'p8w(30,1,30),pk1m(30,30) : ', p8w(30,1,30),pk1m(30,30) |
---|
374 | ! print *, 'mu_2(30,30),mu_2m(30,30) : ', mu_2(30,30),mu_2m(30,30) |
---|
375 | dpsdt_sum = 0. |
---|
376 | dmudt_sum = 0. |
---|
377 | |
---|
378 | DO j = jps, min(jpe,jde-1) |
---|
379 | DO i = ips, min(ipe,ide-1) |
---|
380 | dpsdt_sum = dpsdt_sum + abs(dpsdt(i,j)) |
---|
381 | dmudt_sum = dmudt_sum + abs(dmudt(i,j)) |
---|
382 | ENDDO |
---|
383 | ENDDO |
---|
384 | |
---|
385 | ! compute global sum |
---|
386 | dpsdt_sum = wrf_dm_sum_real ( dpsdt_sum ) |
---|
387 | dmudt_sum = wrf_dm_sum_real ( dmudt_sum ) |
---|
388 | |
---|
389 | ! print *, 'dpsdt, dmudt : ', dpsdt_sum, dmudt_sum |
---|
390 | |
---|
391 | IF ( diag_print .eq. 2 ) THEN |
---|
392 | dardt_sum = 0. |
---|
393 | drcdt_sum = 0. |
---|
394 | drndt_sum = 0. |
---|
395 | rainc_sum = 0. |
---|
396 | raint_sum = 0. |
---|
397 | rainnc_sum = 0. |
---|
398 | sfcevp_sum = 0. |
---|
399 | hfx_sum = 0. |
---|
400 | lh_sum = 0. |
---|
401 | raincmax = 0. |
---|
402 | rainncmax = 0. |
---|
403 | |
---|
404 | DO j = jps, min(jpe,jde-1) |
---|
405 | DO i = ips, min(ipe,ide-1) |
---|
406 | drcdt_sum = drcdt_sum + abs(raincv(i,j)) |
---|
407 | drndt_sum = drndt_sum + abs(rainncv(i,j)) |
---|
408 | dardt_sum = dardt_sum + abs(raincv(i,j)) + abs(rainncv(i,j)) |
---|
409 | rainc_sum = rainc_sum + abs(rainc(i,j)) |
---|
410 | ! MAX for accumulated conv precip |
---|
411 | IF(rainc(i,j).gt.raincmax)then |
---|
412 | raincmax=rainc(i,j) |
---|
413 | irc=i |
---|
414 | jrc=j |
---|
415 | ENDIF |
---|
416 | rainnc_sum = rainnc_sum + abs(rainnc(i,j)) |
---|
417 | ! MAX for accumulated resolved precip |
---|
418 | IF(rainnc(i,j).gt.rainncmax)then |
---|
419 | rainncmax=rainnc(i,j) |
---|
420 | irnc=i |
---|
421 | jrnc=j |
---|
422 | ENDIF |
---|
423 | raint_sum = raint_sum + abs(rainc(i,j)) + abs(rainnc(i,j)) |
---|
424 | sfcevp_sum = sfcevp_sum + abs(sfcevp(i,j)) |
---|
425 | hfx_sum = hfx_sum + abs(hfx(i,j)) |
---|
426 | lh_sum = lh_sum + abs(lh(i,j)) |
---|
427 | ENDDO |
---|
428 | ENDDO |
---|
429 | |
---|
430 | ! compute global MAX |
---|
431 | CALL wrf_dm_maxval ( raincmax, irc, jrc ) |
---|
432 | CALL wrf_dm_maxval ( rainncmax, irnc, jrnc ) |
---|
433 | |
---|
434 | ! compute global sum |
---|
435 | drcdt_sum = wrf_dm_sum_real ( drcdt_sum ) |
---|
436 | drndt_sum = wrf_dm_sum_real ( drndt_sum ) |
---|
437 | dardt_sum = wrf_dm_sum_real ( dardt_sum ) |
---|
438 | rainc_sum = wrf_dm_sum_real ( rainc_sum ) |
---|
439 | rainnc_sum = wrf_dm_sum_real ( rainnc_sum ) |
---|
440 | raint_sum = wrf_dm_sum_real ( raint_sum ) |
---|
441 | sfcevp_sum = wrf_dm_sum_real ( sfcevp_sum ) |
---|
442 | hfx_sum = wrf_dm_sum_real ( hfx_sum ) |
---|
443 | lh_sum = wrf_dm_sum_real ( lh_sum ) |
---|
444 | |
---|
445 | ENDIF |
---|
446 | |
---|
447 | ! print out the average values |
---|
448 | |
---|
449 | CALL get_current_grid_name( grid_str ) |
---|
450 | |
---|
451 | #ifdef DM_PARALLEL |
---|
452 | IF ( wrf_dm_on_monitor() ) THEN |
---|
453 | #endif |
---|
454 | WRITE(outstring,*) grid_str,'Domain average of dpsdt, dmudt (mb/3h): ', xtime, & |
---|
455 | dpsdt_sum/no_points*108., & |
---|
456 | dmudt_sum/no_points*108. |
---|
457 | CALL wrf_message ( TRIM(outstring) ) |
---|
458 | |
---|
459 | WRITE(outstring,*) grid_str,'Max mu change time step: ', idp,jdp,dmumax |
---|
460 | CALL wrf_message ( TRIM(outstring) ) |
---|
461 | |
---|
462 | IF ( diag_print .eq. 2) THEN |
---|
463 | WRITE(outstring,*) grid_str,'Domain average of dardt, drcdt, drndt (mm/sec): ', xtime, & |
---|
464 | dardt_sum/dt/no_points, & |
---|
465 | drcdt_sum/dt/no_points, & |
---|
466 | drndt_sum/dt/no_points |
---|
467 | CALL wrf_message ( TRIM(outstring) ) |
---|
468 | WRITE(outstring,*) grid_str,'Domain average of rt_sum, rc_sum, rnc_sum (mm): ', xtime, & |
---|
469 | raint_sum/no_points, & |
---|
470 | rainc_sum/no_points, & |
---|
471 | rainnc_sum/no_points |
---|
472 | CALL wrf_message ( TRIM(outstring) ) |
---|
473 | WRITE(outstring,*) grid_str,'Max Accum Resolved Precip, I,J (mm): ' ,& |
---|
474 | rainncmax,irnc,jrnc |
---|
475 | CALL wrf_message ( TRIM(outstring) ) |
---|
476 | WRITE(outstring,*) grid_str,'Max Accum Convective Precip, I,J (mm): ' ,& |
---|
477 | raincmax,irc,jrc |
---|
478 | CALL wrf_message ( TRIM(outstring) ) |
---|
479 | WRITE(outstring,*) grid_str,'Domain average of sfcevp, hfx, lh: ', xtime, & |
---|
480 | sfcevp_sum/no_points, & |
---|
481 | hfx_sum/no_points, & |
---|
482 | lh_sum/no_points |
---|
483 | CALL wrf_message ( TRIM(outstring) ) |
---|
484 | ENDIF |
---|
485 | #ifdef DM_PARALLEL |
---|
486 | ENDIF |
---|
487 | #endif |
---|
488 | |
---|
489 | ENDIF ! print frequency |
---|
490 | ENDIF |
---|
491 | |
---|
492 | ! save values at this time step |
---|
493 | !$OMP PARALLEL DO & |
---|
494 | !$OMP PRIVATE ( ij,i,j ) |
---|
495 | DO ij = 1 , num_tiles |
---|
496 | |
---|
497 | DO j=j_start(ij),j_end(ij) |
---|
498 | DO i=i_start(ij),i_end(ij) |
---|
499 | pk1m(i,j)=p8w(i,kms,j) |
---|
500 | mu_2m(i,j)=mu_2(i,j) |
---|
501 | ENDDO |
---|
502 | ENDDO |
---|
503 | |
---|
504 | IF ( xtime .lt. 0.0001 ) THEN |
---|
505 | DO j=j_start(ij),j_end(ij) |
---|
506 | DO i=i_start(ij),i_end(ij) |
---|
507 | dpsdt(i,j)=0. |
---|
508 | dmudt(i,j)=0. |
---|
509 | ENDDO |
---|
510 | ENDDO |
---|
511 | ENDIF |
---|
512 | |
---|
513 | ENDDO |
---|
514 | !$OMP END PARALLEL DO |
---|
515 | |
---|
516 | END SUBROUTINE diagnostic_output_calc |
---|
517 | |
---|
518 | END MODULE module_diagnostics |
---|