1 | !> @file sum_up_3d_data.f90 |
---|
2 | !--------------------------------------------------------------------------------! |
---|
3 | ! This file is part of PALM. |
---|
4 | ! |
---|
5 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
6 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
7 | ! either version 3 of the License, or (at your option) any later version. |
---|
8 | ! |
---|
9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
10 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
11 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
12 | ! |
---|
13 | ! You should have received a copy of the GNU General Public License along with |
---|
14 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
15 | ! |
---|
16 | ! Copyright 1997-2015 Leibniz Universitaet Hannover |
---|
17 | !--------------------------------------------------------------------------------! |
---|
18 | ! |
---|
19 | ! Current revisions: |
---|
20 | ! ----------------- |
---|
21 | ! Added z0q and z0q_av |
---|
22 | ! |
---|
23 | ! Former revisions: |
---|
24 | ! ----------------- |
---|
25 | ! $Id: sum_up_3d_data.f90 1788 2016-03-10 11:01:04Z maronga $ |
---|
26 | ! |
---|
27 | ! 1693 2015-10-27 08:35:45Z maronga |
---|
28 | ! Last revision text corrected |
---|
29 | ! |
---|
30 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
31 | ! Added output of Obukhov length and radiative heating rates for RRTMG. |
---|
32 | ! Corrected output of liquid water path. |
---|
33 | ! |
---|
34 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
35 | ! Code annotations made doxygen readable |
---|
36 | ! |
---|
37 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
38 | ! Adapted for RRTMG |
---|
39 | ! |
---|
40 | ! 1555 2015-03-04 17:44:27Z maronga |
---|
41 | ! Added output of r_a and r_s |
---|
42 | ! |
---|
43 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
44 | ! Added support for land surface model and radiation model data. |
---|
45 | ! |
---|
46 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
47 | ! New particle structure integrated. |
---|
48 | ! |
---|
49 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
50 | ! REAL constants provided with KIND-attribute |
---|
51 | ! |
---|
52 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
53 | ! ONLY-attribute added to USE-statements, |
---|
54 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
55 | ! kinds are defined in new module kinds, |
---|
56 | ! old module precision_kind is removed, |
---|
57 | ! revision history before 2012 removed, |
---|
58 | ! comment fields (!:) to be used for variable explanations added to |
---|
59 | ! all variable declaration statements |
---|
60 | ! |
---|
61 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
62 | ! barrier argument removed from cpu_log, |
---|
63 | ! module interfaces removed |
---|
64 | ! |
---|
65 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
66 | ! ql is calculated by calc_liquid_water_content |
---|
67 | ! |
---|
68 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
69 | ! +nr, prr, qr |
---|
70 | ! |
---|
71 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
72 | ! code put under GPL (PALM 3.9) |
---|
73 | ! |
---|
74 | ! 1007 2012-09-19 14:30:36Z franke |
---|
75 | ! Bugfix in calculation of ql_vp |
---|
76 | ! |
---|
77 | ! 978 2012-08-09 08:28:32Z fricke |
---|
78 | ! +z0h* |
---|
79 | ! |
---|
80 | ! Revision 1.1 2006/02/23 12:55:23 raasch |
---|
81 | ! Initial revision |
---|
82 | ! |
---|
83 | ! |
---|
84 | ! Description: |
---|
85 | ! ------------ |
---|
86 | !> Sum-up the values of 3d-arrays. The real averaging is later done in routine |
---|
87 | !> average_3d_data. |
---|
88 | !------------------------------------------------------------------------------! |
---|
89 | SUBROUTINE sum_up_3d_data |
---|
90 | |
---|
91 | |
---|
92 | USE arrays_3d, & |
---|
93 | ONLY: dzw, e, nr, ol, p, pt, q, qc, ql, ql_c, ql_v, qr, qsws, rho, sa,& |
---|
94 | shf, ts, u, us, v, vpt, w, z0, z0h, z0q |
---|
95 | |
---|
96 | USE averaging, & |
---|
97 | ONLY: e_av, lpt_av, lwp_av, nr_av, ol_av, p_av, pc_av, pr_av, prr_av, & |
---|
98 | precipitation_rate_av, pt_av, q_av, qc_av, ql_av, ql_c_av, & |
---|
99 | ql_v_av, ql_vp_av, qr_av, qsws_av, qv_av, rho_av, s_av, sa_av, & |
---|
100 | shf_av, ts_av, u_av, us_av, v_av, vpt_av, w_av, z0_av, z0h_av, & |
---|
101 | z0q_av |
---|
102 | |
---|
103 | USE cloud_parameters, & |
---|
104 | ONLY: l_d_cp, precipitation_rate, pt_d_t |
---|
105 | |
---|
106 | USE control_parameters, & |
---|
107 | ONLY: average_count_3d, cloud_physics, doav, doav_n, rho_surface |
---|
108 | |
---|
109 | USE cpulog, & |
---|
110 | ONLY: cpu_log, log_point |
---|
111 | |
---|
112 | USE indices, & |
---|
113 | ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
114 | |
---|
115 | USE kinds |
---|
116 | |
---|
117 | USE land_surface_model_mod, & |
---|
118 | ONLY: c_liq, c_liq_av, c_soil_av, c_veg, c_veg_av, ghf_eb, & |
---|
119 | ghf_eb_av, lai, lai_av, m_liq_eb, m_liq_eb_av, m_soil, & |
---|
120 | m_soil_av, nzb_soil, nzt_soil, qsws_eb, qsws_eb_av, & |
---|
121 | qsws_liq_eb, qsws_liq_eb_av, qsws_soil_eb, qsws_soil_eb_av, & |
---|
122 | qsws_veg_eb, qsws_veg_eb_av, shf_eb, shf_eb_av, r_a, r_a_av, & |
---|
123 | r_s, r_s_av, t_soil, t_soil_av |
---|
124 | |
---|
125 | USE particle_attributes, & |
---|
126 | ONLY: grid_particles, number_of_particles, particles, prt_count |
---|
127 | |
---|
128 | USE radiation_model_mod, & |
---|
129 | ONLY: rad_net, rad_net_av, rad_sw_in, rad_sw_in_av, rad_sw_out, & |
---|
130 | rad_sw_out_av, rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr, & |
---|
131 | rad_sw_hr_av, rad_lw_in, rad_lw_in_av, rad_lw_out, & |
---|
132 | rad_lw_out_av, rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr, & |
---|
133 | rad_lw_hr_av |
---|
134 | |
---|
135 | |
---|
136 | IMPLICIT NONE |
---|
137 | |
---|
138 | INTEGER(iwp) :: i !< |
---|
139 | INTEGER(iwp) :: ii !< |
---|
140 | INTEGER(iwp) :: j !< |
---|
141 | INTEGER(iwp) :: k !< |
---|
142 | INTEGER(iwp) :: n !< |
---|
143 | INTEGER(iwp) :: psi !< |
---|
144 | |
---|
145 | REAL(wp) :: mean_r !< |
---|
146 | REAL(wp) :: s_r2 !< |
---|
147 | REAL(wp) :: s_r3 !< |
---|
148 | |
---|
149 | CALL cpu_log (log_point(34),'sum_up_3d_data','start') |
---|
150 | |
---|
151 | ! |
---|
152 | !-- Allocate and initialize the summation arrays if called for the very first |
---|
153 | !-- time or the first time after average_3d_data has been called |
---|
154 | !-- (some or all of the arrays may have been already allocated |
---|
155 | !-- in read_3d_binary) |
---|
156 | IF ( average_count_3d == 0 ) THEN |
---|
157 | |
---|
158 | DO ii = 1, doav_n |
---|
159 | |
---|
160 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
161 | |
---|
162 | CASE ( 'c_liq*' ) |
---|
163 | IF ( .NOT. ALLOCATED( c_liq_av ) ) THEN |
---|
164 | ALLOCATE( c_liq_av(nysg:nyng,nxlg:nxrg) ) |
---|
165 | ENDIF |
---|
166 | c_liq_av = 0.0_wp |
---|
167 | |
---|
168 | CASE ( 'c_soil*' ) |
---|
169 | IF ( .NOT. ALLOCATED( c_soil_av ) ) THEN |
---|
170 | ALLOCATE( c_soil_av(nysg:nyng,nxlg:nxrg) ) |
---|
171 | ENDIF |
---|
172 | c_soil_av = 0.0_wp |
---|
173 | |
---|
174 | CASE ( 'c_veg*' ) |
---|
175 | IF ( .NOT. ALLOCATED( c_veg_av ) ) THEN |
---|
176 | ALLOCATE( c_veg_av(nysg:nyng,nxlg:nxrg) ) |
---|
177 | ENDIF |
---|
178 | c_veg_av = 0.0_wp |
---|
179 | |
---|
180 | CASE ( 'e' ) |
---|
181 | IF ( .NOT. ALLOCATED( e_av ) ) THEN |
---|
182 | ALLOCATE( e_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
183 | ENDIF |
---|
184 | e_av = 0.0_wp |
---|
185 | |
---|
186 | CASE ( 'ghf_eb*' ) |
---|
187 | IF ( .NOT. ALLOCATED( ghf_eb_av ) ) THEN |
---|
188 | ALLOCATE( ghf_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
189 | ENDIF |
---|
190 | ghf_eb_av = 0.0_wp |
---|
191 | |
---|
192 | CASE ( 'lai*' ) |
---|
193 | IF ( .NOT. ALLOCATED( lai_av ) ) THEN |
---|
194 | ALLOCATE( lai_av(nysg:nyng,nxlg:nxrg) ) |
---|
195 | ENDIF |
---|
196 | lai_av = 0.0_wp |
---|
197 | |
---|
198 | CASE ( 'lpt' ) |
---|
199 | IF ( .NOT. ALLOCATED( lpt_av ) ) THEN |
---|
200 | ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
201 | ENDIF |
---|
202 | lpt_av = 0.0_wp |
---|
203 | |
---|
204 | CASE ( 'lwp*' ) |
---|
205 | IF ( .NOT. ALLOCATED( lwp_av ) ) THEN |
---|
206 | ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) |
---|
207 | ENDIF |
---|
208 | lwp_av = 0.0_wp |
---|
209 | |
---|
210 | CASE ( 'm_liq_eb*' ) |
---|
211 | IF ( .NOT. ALLOCATED( m_liq_eb_av ) ) THEN |
---|
212 | ALLOCATE( m_liq_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
213 | ENDIF |
---|
214 | m_liq_eb_av = 0.0_wp |
---|
215 | |
---|
216 | CASE ( 'm_soil' ) |
---|
217 | IF ( .NOT. ALLOCATED( m_soil_av ) ) THEN |
---|
218 | ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) |
---|
219 | ENDIF |
---|
220 | m_soil_av = 0.0_wp |
---|
221 | |
---|
222 | CASE ( 'nr' ) |
---|
223 | IF ( .NOT. ALLOCATED( nr_av ) ) THEN |
---|
224 | ALLOCATE( nr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
225 | ENDIF |
---|
226 | nr_av = 0.0_wp |
---|
227 | |
---|
228 | CASE ( 'ol*' ) |
---|
229 | IF ( .NOT. ALLOCATED( ol_av ) ) THEN |
---|
230 | ALLOCATE( ol_av(nysg:nyng,nxlg:nxrg) ) |
---|
231 | ENDIF |
---|
232 | ol_av = 0.0_wp |
---|
233 | |
---|
234 | CASE ( 'p' ) |
---|
235 | IF ( .NOT. ALLOCATED( p_av ) ) THEN |
---|
236 | ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
237 | ENDIF |
---|
238 | p_av = 0.0_wp |
---|
239 | |
---|
240 | CASE ( 'pc' ) |
---|
241 | IF ( .NOT. ALLOCATED( pc_av ) ) THEN |
---|
242 | ALLOCATE( pc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
243 | ENDIF |
---|
244 | pc_av = 0.0_wp |
---|
245 | |
---|
246 | CASE ( 'pr' ) |
---|
247 | IF ( .NOT. ALLOCATED( pr_av ) ) THEN |
---|
248 | ALLOCATE( pr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
249 | ENDIF |
---|
250 | pr_av = 0.0_wp |
---|
251 | |
---|
252 | CASE ( 'prr' ) |
---|
253 | IF ( .NOT. ALLOCATED( prr_av ) ) THEN |
---|
254 | ALLOCATE( prr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
255 | ENDIF |
---|
256 | prr_av = 0.0_wp |
---|
257 | |
---|
258 | CASE ( 'prr*' ) |
---|
259 | IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN |
---|
260 | ALLOCATE( precipitation_rate_av(nysg:nyng,nxlg:nxrg) ) |
---|
261 | ENDIF |
---|
262 | precipitation_rate_av = 0.0_wp |
---|
263 | |
---|
264 | CASE ( 'pt' ) |
---|
265 | IF ( .NOT. ALLOCATED( pt_av ) ) THEN |
---|
266 | ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
267 | ENDIF |
---|
268 | pt_av = 0.0_wp |
---|
269 | |
---|
270 | CASE ( 'q' ) |
---|
271 | IF ( .NOT. ALLOCATED( q_av ) ) THEN |
---|
272 | ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
273 | ENDIF |
---|
274 | q_av = 0.0_wp |
---|
275 | |
---|
276 | CASE ( 'qc' ) |
---|
277 | IF ( .NOT. ALLOCATED( qc_av ) ) THEN |
---|
278 | ALLOCATE( qc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
279 | ENDIF |
---|
280 | qc_av = 0.0_wp |
---|
281 | |
---|
282 | CASE ( 'ql' ) |
---|
283 | IF ( .NOT. ALLOCATED( ql_av ) ) THEN |
---|
284 | ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
285 | ENDIF |
---|
286 | ql_av = 0.0_wp |
---|
287 | |
---|
288 | CASE ( 'ql_c' ) |
---|
289 | IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN |
---|
290 | ALLOCATE( ql_c_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
291 | ENDIF |
---|
292 | ql_c_av = 0.0_wp |
---|
293 | |
---|
294 | CASE ( 'ql_v' ) |
---|
295 | IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN |
---|
296 | ALLOCATE( ql_v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
297 | ENDIF |
---|
298 | ql_v_av = 0.0_wp |
---|
299 | |
---|
300 | CASE ( 'ql_vp' ) |
---|
301 | IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN |
---|
302 | ALLOCATE( ql_vp_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
303 | ENDIF |
---|
304 | ql_vp_av = 0.0_wp |
---|
305 | |
---|
306 | CASE ( 'qr' ) |
---|
307 | IF ( .NOT. ALLOCATED( qr_av ) ) THEN |
---|
308 | ALLOCATE( qr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
309 | ENDIF |
---|
310 | qr_av = 0.0_wp |
---|
311 | |
---|
312 | CASE ( 'qsws*' ) |
---|
313 | IF ( .NOT. ALLOCATED( qsws_av ) ) THEN |
---|
314 | ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) |
---|
315 | ENDIF |
---|
316 | qsws_av = 0.0_wp |
---|
317 | |
---|
318 | CASE ( 'qsws_eb*' ) |
---|
319 | IF ( .NOT. ALLOCATED( qsws_eb_av ) ) THEN |
---|
320 | ALLOCATE( qsws_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
321 | ENDIF |
---|
322 | qsws_eb_av = 0.0_wp |
---|
323 | |
---|
324 | CASE ( 'qsws_liq_eb*' ) |
---|
325 | IF ( .NOT. ALLOCATED( qsws_liq_eb_av ) ) THEN |
---|
326 | ALLOCATE( qsws_liq_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
327 | ENDIF |
---|
328 | qsws_liq_eb_av = 0.0_wp |
---|
329 | |
---|
330 | CASE ( 'qsws_soil_eb*' ) |
---|
331 | IF ( .NOT. ALLOCATED( qsws_soil_eb_av ) ) THEN |
---|
332 | ALLOCATE( qsws_soil_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
333 | ENDIF |
---|
334 | qsws_soil_eb_av = 0.0_wp |
---|
335 | |
---|
336 | CASE ( 'qsws_veg_eb*' ) |
---|
337 | IF ( .NOT. ALLOCATED( qsws_veg_eb_av ) ) THEN |
---|
338 | ALLOCATE( qsws_veg_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
339 | ENDIF |
---|
340 | qsws_veg_eb_av = 0.0_wp |
---|
341 | |
---|
342 | CASE ( 'qv' ) |
---|
343 | IF ( .NOT. ALLOCATED( qv_av ) ) THEN |
---|
344 | ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
345 | ENDIF |
---|
346 | qv_av = 0.0_wp |
---|
347 | |
---|
348 | CASE ( 'rad_net*' ) |
---|
349 | IF ( .NOT. ALLOCATED( rad_net_av ) ) THEN |
---|
350 | ALLOCATE( rad_net_av(nysg:nyng,nxlg:nxrg) ) |
---|
351 | ENDIF |
---|
352 | rad_net_av = 0.0_wp |
---|
353 | |
---|
354 | CASE ( 'rad_lw_in' ) |
---|
355 | IF ( .NOT. ALLOCATED( rad_lw_in_av ) ) THEN |
---|
356 | ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
357 | ENDIF |
---|
358 | rad_lw_in_av = 0.0_wp |
---|
359 | |
---|
360 | CASE ( 'rad_lw_out' ) |
---|
361 | IF ( .NOT. ALLOCATED( rad_lw_out_av ) ) THEN |
---|
362 | ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
363 | ENDIF |
---|
364 | rad_lw_out_av = 0.0_wp |
---|
365 | |
---|
366 | CASE ( 'rad_lw_cs_hr' ) |
---|
367 | IF ( .NOT. ALLOCATED( rad_lw_cs_hr_av ) ) THEN |
---|
368 | ALLOCATE( rad_lw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
369 | ENDIF |
---|
370 | rad_lw_cs_hr_av = 0.0_wp |
---|
371 | |
---|
372 | CASE ( 'rad_lw_hr' ) |
---|
373 | IF ( .NOT. ALLOCATED( rad_lw_hr_av ) ) THEN |
---|
374 | ALLOCATE( rad_lw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
375 | ENDIF |
---|
376 | rad_lw_hr_av = 0.0_wp |
---|
377 | |
---|
378 | CASE ( 'rad_sw_in' ) |
---|
379 | IF ( .NOT. ALLOCATED( rad_sw_in_av ) ) THEN |
---|
380 | ALLOCATE( rad_sw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
381 | ENDIF |
---|
382 | rad_sw_in_av = 0.0_wp |
---|
383 | |
---|
384 | CASE ( 'rad_sw_out' ) |
---|
385 | IF ( .NOT. ALLOCATED( rad_sw_out_av ) ) THEN |
---|
386 | ALLOCATE( rad_sw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
387 | ENDIF |
---|
388 | rad_sw_out_av = 0.0_wp |
---|
389 | |
---|
390 | CASE ( 'rad_sw_cs_hr' ) |
---|
391 | IF ( .NOT. ALLOCATED( rad_sw_cs_hr_av ) ) THEN |
---|
392 | ALLOCATE( rad_sw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
393 | ENDIF |
---|
394 | rad_sw_cs_hr_av = 0.0_wp |
---|
395 | |
---|
396 | CASE ( 'rad_sw_hr' ) |
---|
397 | IF ( .NOT. ALLOCATED( rad_sw_hr_av ) ) THEN |
---|
398 | ALLOCATE( rad_sw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
399 | ENDIF |
---|
400 | rad_sw_hr_av = 0.0_wp |
---|
401 | |
---|
402 | CASE ( 'rho' ) |
---|
403 | IF ( .NOT. ALLOCATED( rho_av ) ) THEN |
---|
404 | ALLOCATE( rho_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
405 | ENDIF |
---|
406 | rho_av = 0.0_wp |
---|
407 | |
---|
408 | CASE ( 'r_a*' ) |
---|
409 | IF ( .NOT. ALLOCATED( r_a_av ) ) THEN |
---|
410 | ALLOCATE( r_a_av(nysg:nyng,nxlg:nxrg) ) |
---|
411 | ENDIF |
---|
412 | r_a_av = 0.0_wp |
---|
413 | |
---|
414 | CASE ( 'r_s*' ) |
---|
415 | IF ( .NOT. ALLOCATED( r_s_av ) ) THEN |
---|
416 | ALLOCATE( r_s_av(nysg:nyng,nxlg:nxrg) ) |
---|
417 | ENDIF |
---|
418 | r_s_av = 0.0_wp |
---|
419 | |
---|
420 | CASE ( 's' ) |
---|
421 | IF ( .NOT. ALLOCATED( s_av ) ) THEN |
---|
422 | ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
423 | ENDIF |
---|
424 | s_av = 0.0_wp |
---|
425 | |
---|
426 | CASE ( 'sa' ) |
---|
427 | IF ( .NOT. ALLOCATED( sa_av ) ) THEN |
---|
428 | ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
429 | ENDIF |
---|
430 | sa_av = 0.0_wp |
---|
431 | |
---|
432 | CASE ( 'shf*' ) |
---|
433 | IF ( .NOT. ALLOCATED( shf_av ) ) THEN |
---|
434 | ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) |
---|
435 | ENDIF |
---|
436 | shf_av = 0.0_wp |
---|
437 | |
---|
438 | CASE ( 'shf_eb*' ) |
---|
439 | IF ( .NOT. ALLOCATED( shf_eb_av ) ) THEN |
---|
440 | ALLOCATE( shf_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
441 | ENDIF |
---|
442 | shf_eb_av = 0.0_wp |
---|
443 | |
---|
444 | CASE ( 't_soil' ) |
---|
445 | IF ( .NOT. ALLOCATED( t_soil_av ) ) THEN |
---|
446 | ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) |
---|
447 | ENDIF |
---|
448 | t_soil_av = 0.0_wp |
---|
449 | |
---|
450 | CASE ( 't*' ) |
---|
451 | IF ( .NOT. ALLOCATED( ts_av ) ) THEN |
---|
452 | ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) |
---|
453 | ENDIF |
---|
454 | ts_av = 0.0_wp |
---|
455 | |
---|
456 | CASE ( 'u' ) |
---|
457 | IF ( .NOT. ALLOCATED( u_av ) ) THEN |
---|
458 | ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
459 | ENDIF |
---|
460 | u_av = 0.0_wp |
---|
461 | |
---|
462 | CASE ( 'u*' ) |
---|
463 | IF ( .NOT. ALLOCATED( us_av ) ) THEN |
---|
464 | ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) |
---|
465 | ENDIF |
---|
466 | us_av = 0.0_wp |
---|
467 | |
---|
468 | CASE ( 'v' ) |
---|
469 | IF ( .NOT. ALLOCATED( v_av ) ) THEN |
---|
470 | ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
471 | ENDIF |
---|
472 | v_av = 0.0_wp |
---|
473 | |
---|
474 | CASE ( 'vpt' ) |
---|
475 | IF ( .NOT. ALLOCATED( vpt_av ) ) THEN |
---|
476 | ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
477 | ENDIF |
---|
478 | vpt_av = 0.0_wp |
---|
479 | |
---|
480 | CASE ( 'w' ) |
---|
481 | IF ( .NOT. ALLOCATED( w_av ) ) THEN |
---|
482 | ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
483 | ENDIF |
---|
484 | w_av = 0.0_wp |
---|
485 | |
---|
486 | CASE ( 'z0*' ) |
---|
487 | IF ( .NOT. ALLOCATED( z0_av ) ) THEN |
---|
488 | ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) |
---|
489 | ENDIF |
---|
490 | z0_av = 0.0_wp |
---|
491 | |
---|
492 | CASE ( 'z0h*' ) |
---|
493 | IF ( .NOT. ALLOCATED( z0h_av ) ) THEN |
---|
494 | ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) |
---|
495 | ENDIF |
---|
496 | z0h_av = 0.0_wp |
---|
497 | |
---|
498 | CASE ( 'z0q*' ) |
---|
499 | IF ( .NOT. ALLOCATED( z0q_av ) ) THEN |
---|
500 | ALLOCATE( z0q_av(nysg:nyng,nxlg:nxrg) ) |
---|
501 | ENDIF |
---|
502 | z0q_av = 0.0_wp |
---|
503 | |
---|
504 | CASE DEFAULT |
---|
505 | ! |
---|
506 | !-- User-defined quantity |
---|
507 | CALL user_3d_data_averaging( 'allocate', doav(ii) ) |
---|
508 | |
---|
509 | END SELECT |
---|
510 | |
---|
511 | ENDDO |
---|
512 | |
---|
513 | ENDIF |
---|
514 | |
---|
515 | ! |
---|
516 | !-- Loop of all variables to be averaged. |
---|
517 | DO ii = 1, doav_n |
---|
518 | |
---|
519 | ! |
---|
520 | !-- Store the array chosen on the temporary array. |
---|
521 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
522 | |
---|
523 | CASE ( 'c_liq*' ) |
---|
524 | DO i = nxlg, nxrg |
---|
525 | DO j = nysg, nyng |
---|
526 | c_liq_av(j,i) = c_liq_av(j,i) |
---|
527 | ENDDO |
---|
528 | ENDDO |
---|
529 | |
---|
530 | CASE ( 'c_soil*' ) |
---|
531 | DO i = nxlg, nxrg |
---|
532 | DO j = nysg, nyng |
---|
533 | c_soil_av(j,i) = c_soil_av(j,i) + (1.0_wp - c_veg(j,i)) |
---|
534 | ENDDO |
---|
535 | ENDDO |
---|
536 | |
---|
537 | CASE ( 'c_veg*' ) |
---|
538 | DO i = nxlg, nxrg |
---|
539 | DO j = nysg, nyng |
---|
540 | c_veg_av(j,i) = c_veg_av(j,i) |
---|
541 | ENDDO |
---|
542 | ENDDO |
---|
543 | |
---|
544 | CASE ( 'e' ) |
---|
545 | DO i = nxlg, nxrg |
---|
546 | DO j = nysg, nyng |
---|
547 | DO k = nzb, nzt+1 |
---|
548 | e_av(k,j,i) = e_av(k,j,i) + e(k,j,i) |
---|
549 | ENDDO |
---|
550 | ENDDO |
---|
551 | ENDDO |
---|
552 | |
---|
553 | CASE ( 'ghf_eb*' ) |
---|
554 | DO i = nxlg, nxrg |
---|
555 | DO j = nysg, nyng |
---|
556 | ghf_eb_av(j,i) = ghf_eb_av(j,i) + ghf_eb(j,i) |
---|
557 | ENDDO |
---|
558 | ENDDO |
---|
559 | |
---|
560 | CASE ( 'lai*' ) |
---|
561 | DO i = nxlg, nxrg |
---|
562 | DO j = nysg, nyng |
---|
563 | lai_av(j,i) = lai_av(j,i) |
---|
564 | ENDDO |
---|
565 | ENDDO |
---|
566 | |
---|
567 | CASE ( 'lpt' ) |
---|
568 | DO i = nxlg, nxrg |
---|
569 | DO j = nysg, nyng |
---|
570 | DO k = nzb, nzt+1 |
---|
571 | lpt_av(k,j,i) = lpt_av(k,j,i) + pt(k,j,i) |
---|
572 | ENDDO |
---|
573 | ENDDO |
---|
574 | ENDDO |
---|
575 | |
---|
576 | CASE ( 'lwp*' ) |
---|
577 | DO i = nxlg, nxrg |
---|
578 | DO j = nysg, nyng |
---|
579 | lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i) & |
---|
580 | * dzw(1:nzt+1) ) * rho_surface |
---|
581 | ENDDO |
---|
582 | ENDDO |
---|
583 | |
---|
584 | CASE ( 'm_liq_eb*' ) |
---|
585 | DO i = nxlg, nxrg |
---|
586 | DO j = nysg, nyng |
---|
587 | m_liq_eb_av(j,i) = m_liq_eb_av(j,i) + m_liq_eb(j,i) |
---|
588 | ENDDO |
---|
589 | ENDDO |
---|
590 | |
---|
591 | CASE ( 'm_soil' ) |
---|
592 | DO i = nxlg, nxrg |
---|
593 | DO j = nysg, nyng |
---|
594 | DO k = nzb_soil, nzt_soil |
---|
595 | m_soil_av(k,j,i) = m_soil_av(k,j,i) + m_soil(k,j,i) |
---|
596 | ENDDO |
---|
597 | ENDDO |
---|
598 | ENDDO |
---|
599 | |
---|
600 | CASE ( 'nr' ) |
---|
601 | DO i = nxlg, nxrg |
---|
602 | DO j = nysg, nyng |
---|
603 | DO k = nzb, nzt+1 |
---|
604 | nr_av(k,j,i) = nr_av(k,j,i) + nr(k,j,i) |
---|
605 | ENDDO |
---|
606 | ENDDO |
---|
607 | ENDDO |
---|
608 | |
---|
609 | CASE ( 'ol*' ) |
---|
610 | DO i = nxlg, nxrg |
---|
611 | DO j = nysg, nyng |
---|
612 | ol_av(j,i) = ol_av(j,i) + ol(j,i) |
---|
613 | ENDDO |
---|
614 | ENDDO |
---|
615 | |
---|
616 | CASE ( 'p' ) |
---|
617 | DO i = nxlg, nxrg |
---|
618 | DO j = nysg, nyng |
---|
619 | DO k = nzb, nzt+1 |
---|
620 | p_av(k,j,i) = p_av(k,j,i) + p(k,j,i) |
---|
621 | ENDDO |
---|
622 | ENDDO |
---|
623 | ENDDO |
---|
624 | |
---|
625 | CASE ( 'pc' ) |
---|
626 | DO i = nxl, nxr |
---|
627 | DO j = nys, nyn |
---|
628 | DO k = nzb, nzt+1 |
---|
629 | pc_av(k,j,i) = pc_av(k,j,i) + prt_count(k,j,i) |
---|
630 | ENDDO |
---|
631 | ENDDO |
---|
632 | ENDDO |
---|
633 | |
---|
634 | CASE ( 'pr' ) |
---|
635 | DO i = nxl, nxr |
---|
636 | DO j = nys, nyn |
---|
637 | DO k = nzb, nzt+1 |
---|
638 | number_of_particles = prt_count(k,j,i) |
---|
639 | IF ( number_of_particles <= 0 ) CYCLE |
---|
640 | particles => grid_particles(k,j,i)%particles(1:number_of_particles) |
---|
641 | s_r2 = 0.0_wp |
---|
642 | s_r3 = 0.0_wp |
---|
643 | |
---|
644 | DO n = 1, number_of_particles |
---|
645 | IF ( particles(n)%particle_mask ) THEN |
---|
646 | s_r2 = s_r2 + particles(n)%radius**2 * & |
---|
647 | particles(n)%weight_factor |
---|
648 | s_r3 = s_r3 + particles(n)%radius**3 * & |
---|
649 | particles(n)%weight_factor |
---|
650 | ENDIF |
---|
651 | ENDDO |
---|
652 | |
---|
653 | IF ( s_r2 > 0.0_wp ) THEN |
---|
654 | mean_r = s_r3 / s_r2 |
---|
655 | ELSE |
---|
656 | mean_r = 0.0_wp |
---|
657 | ENDIF |
---|
658 | pr_av(k,j,i) = pr_av(k,j,i) + mean_r |
---|
659 | ENDDO |
---|
660 | ENDDO |
---|
661 | ENDDO |
---|
662 | |
---|
663 | |
---|
664 | CASE ( 'pr*' ) |
---|
665 | DO i = nxlg, nxrg |
---|
666 | DO j = nysg, nyng |
---|
667 | precipitation_rate_av(j,i) = precipitation_rate_av(j,i) + & |
---|
668 | precipitation_rate(j,i) |
---|
669 | ENDDO |
---|
670 | ENDDO |
---|
671 | |
---|
672 | CASE ( 'pt' ) |
---|
673 | IF ( .NOT. cloud_physics ) THEN |
---|
674 | DO i = nxlg, nxrg |
---|
675 | DO j = nysg, nyng |
---|
676 | DO k = nzb, nzt+1 |
---|
677 | pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) |
---|
678 | ENDDO |
---|
679 | ENDDO |
---|
680 | ENDDO |
---|
681 | ELSE |
---|
682 | DO i = nxlg, nxrg |
---|
683 | DO j = nysg, nyng |
---|
684 | DO k = nzb, nzt+1 |
---|
685 | pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) + l_d_cp * & |
---|
686 | pt_d_t(k) * ql(k,j,i) |
---|
687 | ENDDO |
---|
688 | ENDDO |
---|
689 | ENDDO |
---|
690 | ENDIF |
---|
691 | |
---|
692 | CASE ( 'q' ) |
---|
693 | DO i = nxlg, nxrg |
---|
694 | DO j = nysg, nyng |
---|
695 | DO k = nzb, nzt+1 |
---|
696 | q_av(k,j,i) = q_av(k,j,i) + q(k,j,i) |
---|
697 | ENDDO |
---|
698 | ENDDO |
---|
699 | ENDDO |
---|
700 | |
---|
701 | CASE ( 'qc' ) |
---|
702 | DO i = nxlg, nxrg |
---|
703 | DO j = nysg, nyng |
---|
704 | DO k = nzb, nzt+1 |
---|
705 | qc_av(k,j,i) = qc_av(k,j,i) + qc(k,j,i) |
---|
706 | ENDDO |
---|
707 | ENDDO |
---|
708 | ENDDO |
---|
709 | |
---|
710 | CASE ( 'ql' ) |
---|
711 | DO i = nxlg, nxrg |
---|
712 | DO j = nysg, nyng |
---|
713 | DO k = nzb, nzt+1 |
---|
714 | ql_av(k,j,i) = ql_av(k,j,i) + ql(k,j,i) |
---|
715 | ENDDO |
---|
716 | ENDDO |
---|
717 | ENDDO |
---|
718 | |
---|
719 | CASE ( 'ql_c' ) |
---|
720 | DO i = nxlg, nxrg |
---|
721 | DO j = nysg, nyng |
---|
722 | DO k = nzb, nzt+1 |
---|
723 | ql_c_av(k,j,i) = ql_c_av(k,j,i) + ql_c(k,j,i) |
---|
724 | ENDDO |
---|
725 | ENDDO |
---|
726 | ENDDO |
---|
727 | |
---|
728 | CASE ( 'ql_v' ) |
---|
729 | DO i = nxlg, nxrg |
---|
730 | DO j = nysg, nyng |
---|
731 | DO k = nzb, nzt+1 |
---|
732 | ql_v_av(k,j,i) = ql_v_av(k,j,i) + ql_v(k,j,i) |
---|
733 | ENDDO |
---|
734 | ENDDO |
---|
735 | ENDDO |
---|
736 | |
---|
737 | CASE ( 'ql_vp' ) |
---|
738 | DO i = nxl, nxr |
---|
739 | DO j = nys, nyn |
---|
740 | DO k = nzb, nzt+1 |
---|
741 | number_of_particles = prt_count(k,j,i) |
---|
742 | IF ( number_of_particles <= 0 ) CYCLE |
---|
743 | particles => grid_particles(k,j,i)%particles(1:number_of_particles) |
---|
744 | DO n = 1, number_of_particles |
---|
745 | IF ( particles(n)%particle_mask ) THEN |
---|
746 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) + & |
---|
747 | particles(n)%weight_factor / & |
---|
748 | number_of_particles |
---|
749 | ENDIF |
---|
750 | ENDDO |
---|
751 | ENDDO |
---|
752 | ENDDO |
---|
753 | ENDDO |
---|
754 | |
---|
755 | CASE ( 'qr' ) |
---|
756 | DO i = nxlg, nxrg |
---|
757 | DO j = nysg, nyng |
---|
758 | DO k = nzb, nzt+1 |
---|
759 | qr_av(k,j,i) = qr_av(k,j,i) + qr(k,j,i) |
---|
760 | ENDDO |
---|
761 | ENDDO |
---|
762 | ENDDO |
---|
763 | |
---|
764 | CASE ( 'qsws*' ) |
---|
765 | DO i = nxlg, nxrg |
---|
766 | DO j = nysg, nyng |
---|
767 | qsws_av(j,i) = qsws_av(j,i) + qsws(j,i) |
---|
768 | ENDDO |
---|
769 | ENDDO |
---|
770 | |
---|
771 | CASE ( 'qsws_eb*' ) |
---|
772 | DO i = nxlg, nxrg |
---|
773 | DO j = nysg, nyng |
---|
774 | qsws_eb_av(j,i) = qsws_eb_av(j,i) + qsws_eb(j,i) |
---|
775 | ENDDO |
---|
776 | ENDDO |
---|
777 | |
---|
778 | CASE ( 'qsws_liq_eb*' ) |
---|
779 | DO i = nxlg, nxrg |
---|
780 | DO j = nysg, nyng |
---|
781 | qsws_liq_eb_av(j,i) = qsws_liq_eb_av(j,i) + qsws_liq_eb(j,i) |
---|
782 | ENDDO |
---|
783 | ENDDO |
---|
784 | |
---|
785 | CASE ( 'qsws_soil_eb*' ) |
---|
786 | DO i = nxlg, nxrg |
---|
787 | DO j = nysg, nyng |
---|
788 | qsws_soil_eb_av(j,i) = qsws_soil_eb_av(j,i) + qsws_soil_eb(j,i) |
---|
789 | ENDDO |
---|
790 | ENDDO |
---|
791 | |
---|
792 | CASE ( 'qsws_veg_eb*' ) |
---|
793 | DO i = nxlg, nxrg |
---|
794 | DO j = nysg, nyng |
---|
795 | qsws_veg_eb_av(j,i) = qsws_veg_eb_av(j,i) + qsws_veg_eb(j,i) |
---|
796 | ENDDO |
---|
797 | ENDDO |
---|
798 | |
---|
799 | CASE ( 'qv' ) |
---|
800 | DO i = nxlg, nxrg |
---|
801 | DO j = nysg, nyng |
---|
802 | DO k = nzb, nzt+1 |
---|
803 | qv_av(k,j,i) = qv_av(k,j,i) + q(k,j,i) - ql(k,j,i) |
---|
804 | ENDDO |
---|
805 | ENDDO |
---|
806 | ENDDO |
---|
807 | |
---|
808 | CASE ( 'rad_net*' ) |
---|
809 | DO i = nxlg, nxrg |
---|
810 | DO j = nysg, nyng |
---|
811 | rad_net_av(j,i) = rad_net_av(j,i) + rad_net(j,i) |
---|
812 | ENDDO |
---|
813 | ENDDO |
---|
814 | |
---|
815 | CASE ( 'rad_lw_in' ) |
---|
816 | DO i = nxlg, nxrg |
---|
817 | DO j = nysg, nyng |
---|
818 | DO k = nzb, nzt+1 |
---|
819 | rad_lw_in_av(k,j,i) = rad_lw_in_av(k,j,i) + rad_lw_in(k,j,i) |
---|
820 | ENDDO |
---|
821 | ENDDO |
---|
822 | ENDDO |
---|
823 | |
---|
824 | CASE ( 'rad_lw_out' ) |
---|
825 | DO i = nxlg, nxrg |
---|
826 | DO j = nysg, nyng |
---|
827 | DO k = nzb, nzt+1 |
---|
828 | rad_lw_out_av(k,j,i) = rad_lw_out_av(k,j,i) + rad_lw_out(k,j,i) |
---|
829 | ENDDO |
---|
830 | ENDDO |
---|
831 | ENDDO |
---|
832 | |
---|
833 | CASE ( 'rad_lw_cs_hr' ) |
---|
834 | DO i = nxlg, nxrg |
---|
835 | DO j = nysg, nyng |
---|
836 | DO k = nzb, nzt+1 |
---|
837 | rad_lw_cs_hr_av(k,j,i) = rad_lw_cs_hr_av(k,j,i) + rad_lw_cs_hr(k,j,i) |
---|
838 | ENDDO |
---|
839 | ENDDO |
---|
840 | ENDDO |
---|
841 | |
---|
842 | CASE ( 'rad_lw_hr' ) |
---|
843 | DO i = nxlg, nxrg |
---|
844 | DO j = nysg, nyng |
---|
845 | DO k = nzb, nzt+1 |
---|
846 | rad_lw_hr_av(k,j,i) = rad_lw_hr_av(k,j,i) + rad_lw_hr(k,j,i) |
---|
847 | ENDDO |
---|
848 | ENDDO |
---|
849 | ENDDO |
---|
850 | |
---|
851 | CASE ( 'rad_sw_in' ) |
---|
852 | DO i = nxlg, nxrg |
---|
853 | DO j = nysg, nyng |
---|
854 | DO k = nzb, nzt+1 |
---|
855 | rad_sw_in_av(k,j,i) = rad_sw_in_av(k,j,i) + rad_sw_in(k,j,i) |
---|
856 | ENDDO |
---|
857 | ENDDO |
---|
858 | ENDDO |
---|
859 | |
---|
860 | CASE ( 'rad_sw_out' ) |
---|
861 | DO i = nxlg, nxrg |
---|
862 | DO j = nysg, nyng |
---|
863 | DO k = nzb, nzt+1 |
---|
864 | rad_sw_out_av(k,j,i) = rad_sw_out_av(k,j,i) + rad_sw_out(k,j,i) |
---|
865 | ENDDO |
---|
866 | ENDDO |
---|
867 | ENDDO |
---|
868 | |
---|
869 | CASE ( 'rad_sw_cs_hr' ) |
---|
870 | DO i = nxlg, nxrg |
---|
871 | DO j = nysg, nyng |
---|
872 | DO k = nzb, nzt+1 |
---|
873 | rad_sw_cs_hr_av(k,j,i) = rad_sw_cs_hr_av(k,j,i) + rad_sw_cs_hr(k,j,i) |
---|
874 | ENDDO |
---|
875 | ENDDO |
---|
876 | ENDDO |
---|
877 | |
---|
878 | CASE ( 'rad_sw_hr' ) |
---|
879 | DO i = nxlg, nxrg |
---|
880 | DO j = nysg, nyng |
---|
881 | DO k = nzb, nzt+1 |
---|
882 | rad_sw_hr_av(k,j,i) = rad_sw_hr_av(k,j,i) + rad_sw_hr(k,j,i) |
---|
883 | ENDDO |
---|
884 | ENDDO |
---|
885 | ENDDO |
---|
886 | |
---|
887 | CASE ( 'r_a*' ) |
---|
888 | DO i = nxlg, nxrg |
---|
889 | DO j = nysg, nyng |
---|
890 | r_a_av(j,i) = r_a_av(j,i) + r_a(j,i) |
---|
891 | ENDDO |
---|
892 | ENDDO |
---|
893 | |
---|
894 | CASE ( 'r_s*' ) |
---|
895 | DO i = nxlg, nxrg |
---|
896 | DO j = nysg, nyng |
---|
897 | r_s_av(j,i) = r_s_av(j,i) + r_s(j,i) |
---|
898 | ENDDO |
---|
899 | ENDDO |
---|
900 | |
---|
901 | CASE ( 'rho' ) |
---|
902 | DO i = nxlg, nxrg |
---|
903 | DO j = nysg, nyng |
---|
904 | DO k = nzb, nzt+1 |
---|
905 | rho_av(k,j,i) = rho_av(k,j,i) + rho(k,j,i) |
---|
906 | ENDDO |
---|
907 | ENDDO |
---|
908 | ENDDO |
---|
909 | |
---|
910 | CASE ( 's' ) |
---|
911 | DO i = nxlg, nxrg |
---|
912 | DO j = nysg, nyng |
---|
913 | DO k = nzb, nzt+1 |
---|
914 | s_av(k,j,i) = s_av(k,j,i) + q(k,j,i) |
---|
915 | ENDDO |
---|
916 | ENDDO |
---|
917 | ENDDO |
---|
918 | |
---|
919 | CASE ( 'sa' ) |
---|
920 | DO i = nxlg, nxrg |
---|
921 | DO j = nysg, nyng |
---|
922 | DO k = nzb, nzt+1 |
---|
923 | sa_av(k,j,i) = sa_av(k,j,i) + sa(k,j,i) |
---|
924 | ENDDO |
---|
925 | ENDDO |
---|
926 | ENDDO |
---|
927 | |
---|
928 | CASE ( 'shf*' ) |
---|
929 | DO i = nxlg, nxrg |
---|
930 | DO j = nysg, nyng |
---|
931 | shf_av(j,i) = shf_av(j,i) + shf(j,i) |
---|
932 | ENDDO |
---|
933 | ENDDO |
---|
934 | |
---|
935 | CASE ( 'shf_eb*' ) |
---|
936 | DO i = nxlg, nxrg |
---|
937 | DO j = nysg, nyng |
---|
938 | shf_eb_av(j,i) = shf_eb_av(j,i) + shf_eb(j,i) |
---|
939 | ENDDO |
---|
940 | ENDDO |
---|
941 | |
---|
942 | CASE ( 't*' ) |
---|
943 | DO i = nxlg, nxrg |
---|
944 | DO j = nysg, nyng |
---|
945 | ts_av(j,i) = ts_av(j,i) + ts(j,i) |
---|
946 | ENDDO |
---|
947 | ENDDO |
---|
948 | |
---|
949 | CASE ( 't_soil' ) |
---|
950 | DO i = nxlg, nxrg |
---|
951 | DO j = nysg, nyng |
---|
952 | DO k = nzb_soil, nzt_soil |
---|
953 | t_soil_av(k,j,i) = t_soil_av(k,j,i) + t_soil(k,j,i) |
---|
954 | ENDDO |
---|
955 | ENDDO |
---|
956 | ENDDO |
---|
957 | |
---|
958 | CASE ( 'u' ) |
---|
959 | DO i = nxlg, nxrg |
---|
960 | DO j = nysg, nyng |
---|
961 | DO k = nzb, nzt+1 |
---|
962 | u_av(k,j,i) = u_av(k,j,i) + u(k,j,i) |
---|
963 | ENDDO |
---|
964 | ENDDO |
---|
965 | ENDDO |
---|
966 | |
---|
967 | CASE ( 'u*' ) |
---|
968 | DO i = nxlg, nxrg |
---|
969 | DO j = nysg, nyng |
---|
970 | us_av(j,i) = us_av(j,i) + us(j,i) |
---|
971 | ENDDO |
---|
972 | ENDDO |
---|
973 | |
---|
974 | CASE ( 'v' ) |
---|
975 | DO i = nxlg, nxrg |
---|
976 | DO j = nysg, nyng |
---|
977 | DO k = nzb, nzt+1 |
---|
978 | v_av(k,j,i) = v_av(k,j,i) + v(k,j,i) |
---|
979 | ENDDO |
---|
980 | ENDDO |
---|
981 | ENDDO |
---|
982 | |
---|
983 | CASE ( 'vpt' ) |
---|
984 | DO i = nxlg, nxrg |
---|
985 | DO j = nysg, nyng |
---|
986 | DO k = nzb, nzt+1 |
---|
987 | vpt_av(k,j,i) = vpt_av(k,j,i) + vpt(k,j,i) |
---|
988 | ENDDO |
---|
989 | ENDDO |
---|
990 | ENDDO |
---|
991 | |
---|
992 | CASE ( 'w' ) |
---|
993 | DO i = nxlg, nxrg |
---|
994 | DO j = nysg, nyng |
---|
995 | DO k = nzb, nzt+1 |
---|
996 | w_av(k,j,i) = w_av(k,j,i) + w(k,j,i) |
---|
997 | ENDDO |
---|
998 | ENDDO |
---|
999 | ENDDO |
---|
1000 | |
---|
1001 | CASE ( 'z0*' ) |
---|
1002 | DO i = nxlg, nxrg |
---|
1003 | DO j = nysg, nyng |
---|
1004 | z0_av(j,i) = z0_av(j,i) + z0(j,i) |
---|
1005 | ENDDO |
---|
1006 | ENDDO |
---|
1007 | |
---|
1008 | CASE ( 'z0h*' ) |
---|
1009 | DO i = nxlg, nxrg |
---|
1010 | DO j = nysg, nyng |
---|
1011 | z0h_av(j,i) = z0h_av(j,i) + z0h(j,i) |
---|
1012 | ENDDO |
---|
1013 | ENDDO |
---|
1014 | |
---|
1015 | CASE ( 'z0q*' ) |
---|
1016 | DO i = nxlg, nxrg |
---|
1017 | DO j = nysg, nyng |
---|
1018 | z0q_av(j,i) = z0q_av(j,i) + z0q(j,i) |
---|
1019 | ENDDO |
---|
1020 | ENDDO |
---|
1021 | |
---|
1022 | CASE DEFAULT |
---|
1023 | ! |
---|
1024 | !-- User-defined quantity |
---|
1025 | CALL user_3d_data_averaging( 'sum', doav(ii) ) |
---|
1026 | |
---|
1027 | END SELECT |
---|
1028 | |
---|
1029 | ENDDO |
---|
1030 | |
---|
1031 | CALL cpu_log( log_point(34), 'sum_up_3d_data', 'stop' ) |
---|
1032 | |
---|
1033 | |
---|
1034 | END SUBROUTINE sum_up_3d_data |
---|