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