1 | SUBROUTINE average_3d_data |
---|
2 | |
---|
3 | !--------------------------------------------------------------------------------! |
---|
4 | ! This file is part of PALM. |
---|
5 | ! |
---|
6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
8 | ! either version 3 of the License, or (at your option) any later version. |
---|
9 | ! |
---|
10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
13 | ! |
---|
14 | ! You should have received a copy of the GNU General Public License along with |
---|
15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
16 | ! |
---|
17 | ! Copyright 1997-2012 Leibniz University Hannover |
---|
18 | !--------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: average_3d_data.f90 1116 2013-03-26 18:49:55Z kanani $ |
---|
27 | ! |
---|
28 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
29 | ! +qc |
---|
30 | ! |
---|
31 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
32 | ! averaging of nr, qr added |
---|
33 | ! |
---|
34 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
35 | ! code put under GPL (PALM 3.9) |
---|
36 | ! |
---|
37 | ! 978 2012-08-09 08:28:32Z fricke |
---|
38 | ! +z0h_av |
---|
39 | ! |
---|
40 | ! 771 2011-10-27 10:56:21Z heinze |
---|
41 | ! +lpt_av |
---|
42 | ! |
---|
43 | ! 667 2010-12-23 12:06:00Z suehring/gryschka |
---|
44 | ! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng |
---|
45 | ! |
---|
46 | ! 367 2009-08-25 08:35:52Z maronga |
---|
47 | ! Added calculation of shf* and qsws* |
---|
48 | ! |
---|
49 | ! 96 2007-06-04 08:07:41Z raasch |
---|
50 | ! Averaging of density and salinity |
---|
51 | ! |
---|
52 | ! 72 2007-03-19 08:20:46Z raasch |
---|
53 | ! Averaging the precipitation rate and roughness length (prr*, z0*) |
---|
54 | ! |
---|
55 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
56 | ! |
---|
57 | ! Revision 1.1 2006/02/23 09:48:58 raasch |
---|
58 | ! Initial revision |
---|
59 | ! |
---|
60 | ! |
---|
61 | ! Description: |
---|
62 | ! ------------ |
---|
63 | ! Time-averaging of 3d-data-arrays. |
---|
64 | !------------------------------------------------------------------------------! |
---|
65 | |
---|
66 | USE arrays_3d |
---|
67 | USE averaging |
---|
68 | USE cloud_parameters |
---|
69 | USE control_parameters |
---|
70 | USE cpulog |
---|
71 | USE indices |
---|
72 | USE interfaces |
---|
73 | |
---|
74 | IMPLICIT NONE |
---|
75 | |
---|
76 | INTEGER :: i, ii, j, k |
---|
77 | |
---|
78 | |
---|
79 | CALL cpu_log (log_point(35),'average_3d_data','start') |
---|
80 | |
---|
81 | ! |
---|
82 | !-- Check, if averaging is necessary |
---|
83 | IF ( average_count_3d <= 1 ) RETURN |
---|
84 | |
---|
85 | ! |
---|
86 | !-- Loop of all variables to be averaged. |
---|
87 | DO ii = 1, doav_n |
---|
88 | |
---|
89 | ! |
---|
90 | !-- Store the array chosen on the temporary array. |
---|
91 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
92 | |
---|
93 | CASE ( 'e' ) |
---|
94 | DO i = nxlg, nxrg |
---|
95 | DO j = nysg, nyng |
---|
96 | DO k = nzb, nzt+1 |
---|
97 | e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d ) |
---|
98 | ENDDO |
---|
99 | ENDDO |
---|
100 | ENDDO |
---|
101 | |
---|
102 | CASE ( 'qsws*' ) |
---|
103 | DO i = nxlg, nxrg |
---|
104 | DO j = nysg, nyng |
---|
105 | qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d ) |
---|
106 | ENDDO |
---|
107 | ENDDO |
---|
108 | |
---|
109 | CASE ( 'lpt' ) |
---|
110 | DO i = nxlg, nxrg |
---|
111 | DO j = nysg, nyng |
---|
112 | DO k = nzb, nzt+1 |
---|
113 | lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d ) |
---|
114 | ENDDO |
---|
115 | ENDDO |
---|
116 | ENDDO |
---|
117 | |
---|
118 | CASE ( 'lwp*' ) |
---|
119 | DO i = nxlg, nxrg |
---|
120 | DO j = nysg, nyng |
---|
121 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d ) |
---|
122 | ENDDO |
---|
123 | ENDDO |
---|
124 | |
---|
125 | CASE ( 'nr' ) |
---|
126 | DO i = nxlg, nxrg |
---|
127 | DO j = nysg, nyng |
---|
128 | DO k = nzb, nzt+1 |
---|
129 | nr_av(k,j,i) = nr_av(k,j,i) / REAL( average_count_3d ) |
---|
130 | ENDDO |
---|
131 | ENDDO |
---|
132 | ENDDO |
---|
133 | |
---|
134 | CASE ( 'p' ) |
---|
135 | DO i = nxlg, nxrg |
---|
136 | DO j = nysg, nyng |
---|
137 | DO k = nzb, nzt+1 |
---|
138 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d ) |
---|
139 | ENDDO |
---|
140 | ENDDO |
---|
141 | ENDDO |
---|
142 | |
---|
143 | CASE ( 'pc' ) |
---|
144 | DO i = nxl, nxr |
---|
145 | DO j = nys, nyn |
---|
146 | DO k = nzb, nzt+1 |
---|
147 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d ) |
---|
148 | ENDDO |
---|
149 | ENDDO |
---|
150 | ENDDO |
---|
151 | |
---|
152 | CASE ( 'pr' ) |
---|
153 | DO i = nxl, nxr |
---|
154 | DO j = nys, nyn |
---|
155 | DO k = nzb, nzt+1 |
---|
156 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d ) |
---|
157 | ENDDO |
---|
158 | ENDDO |
---|
159 | ENDDO |
---|
160 | |
---|
161 | CASE ( 'prr*' ) |
---|
162 | DO i = nxlg, nxrg |
---|
163 | DO j = nysg, nyng |
---|
164 | precipitation_rate_av(j,i) = precipitation_rate_av(j,i) / & |
---|
165 | REAL( average_count_3d ) |
---|
166 | ENDDO |
---|
167 | ENDDO |
---|
168 | |
---|
169 | CASE ( 'pt' ) |
---|
170 | DO i = nxlg, nxrg |
---|
171 | DO j = nysg, nyng |
---|
172 | DO k = nzb, nzt+1 |
---|
173 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d ) |
---|
174 | ENDDO |
---|
175 | ENDDO |
---|
176 | ENDDO |
---|
177 | |
---|
178 | CASE ( 'q' ) |
---|
179 | DO i = nxlg, nxrg |
---|
180 | DO j = nysg, nyng |
---|
181 | DO k = nzb, nzt+1 |
---|
182 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d ) |
---|
183 | ENDDO |
---|
184 | ENDDO |
---|
185 | ENDDO |
---|
186 | |
---|
187 | CASE ( 'qc' ) |
---|
188 | DO i = nxlg, nxrg |
---|
189 | DO j = nysg, nyng |
---|
190 | DO k = nzb, nzt+1 |
---|
191 | qc_av(k,j,i) = qc_av(k,j,i) / REAL( average_count_3d ) |
---|
192 | ENDDO |
---|
193 | ENDDO |
---|
194 | ENDDO |
---|
195 | |
---|
196 | CASE ( 'ql' ) |
---|
197 | DO i = nxlg, nxrg |
---|
198 | DO j = nysg, nyng |
---|
199 | DO k = nzb, nzt+1 |
---|
200 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d ) |
---|
201 | ENDDO |
---|
202 | ENDDO |
---|
203 | ENDDO |
---|
204 | |
---|
205 | CASE ( 'ql_c' ) |
---|
206 | DO i = nxlg, nxrg |
---|
207 | DO j = nysg, nyng |
---|
208 | DO k = nzb, nzt+1 |
---|
209 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d ) |
---|
210 | ENDDO |
---|
211 | ENDDO |
---|
212 | ENDDO |
---|
213 | |
---|
214 | CASE ( 'ql_v' ) |
---|
215 | DO i = nxlg, nxrg |
---|
216 | DO j = nysg, nyng |
---|
217 | DO k = nzb, nzt+1 |
---|
218 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d ) |
---|
219 | ENDDO |
---|
220 | ENDDO |
---|
221 | ENDDO |
---|
222 | |
---|
223 | CASE ( 'ql_vp' ) |
---|
224 | DO i = nxlg, nxrg |
---|
225 | DO j = nysg, nyng |
---|
226 | DO k = nzb, nzt+1 |
---|
227 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & |
---|
228 | REAL( average_count_3d ) |
---|
229 | ENDDO |
---|
230 | ENDDO |
---|
231 | ENDDO |
---|
232 | |
---|
233 | CASE ( 'qr' ) |
---|
234 | DO i = nxlg, nxrg |
---|
235 | DO j = nysg, nyng |
---|
236 | DO k = nzb, nzt+1 |
---|
237 | qr_av(k,j,i) = qr_av(k,j,i) / REAL( average_count_3d ) |
---|
238 | ENDDO |
---|
239 | ENDDO |
---|
240 | ENDDO |
---|
241 | |
---|
242 | CASE ( 'qv' ) |
---|
243 | DO i = nxlg, nxrg |
---|
244 | DO j = nysg, nyng |
---|
245 | DO k = nzb, nzt+1 |
---|
246 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d ) |
---|
247 | ENDDO |
---|
248 | ENDDO |
---|
249 | ENDDO |
---|
250 | |
---|
251 | CASE ( 'rho' ) |
---|
252 | DO i = nxlg, nxrg |
---|
253 | DO j = nysg, nyng |
---|
254 | DO k = nzb, nzt+1 |
---|
255 | rho_av(k,j,i) = rho_av(k,j,i) / REAL( average_count_3d ) |
---|
256 | ENDDO |
---|
257 | ENDDO |
---|
258 | ENDDO |
---|
259 | |
---|
260 | CASE ( 's' ) |
---|
261 | DO i = nxlg, nxrg |
---|
262 | DO j = nysg, nyng |
---|
263 | DO k = nzb, nzt+1 |
---|
264 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d ) |
---|
265 | ENDDO |
---|
266 | ENDDO |
---|
267 | ENDDO |
---|
268 | |
---|
269 | CASE ( 'sa' ) |
---|
270 | DO i = nxlg, nxrg |
---|
271 | DO j = nysg, nyng |
---|
272 | DO k = nzb, nzt+1 |
---|
273 | sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d ) |
---|
274 | ENDDO |
---|
275 | ENDDO |
---|
276 | ENDDO |
---|
277 | |
---|
278 | CASE ( 'shf*' ) |
---|
279 | DO i = nxlg, nxrg |
---|
280 | DO j = nysg, nyng |
---|
281 | shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d ) |
---|
282 | ENDDO |
---|
283 | ENDDO |
---|
284 | |
---|
285 | CASE ( 't*' ) |
---|
286 | DO i = nxlg, nxrg |
---|
287 | DO j = nysg, nyng |
---|
288 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d ) |
---|
289 | ENDDO |
---|
290 | ENDDO |
---|
291 | |
---|
292 | CASE ( 'u' ) |
---|
293 | DO i = nxlg, nxrg |
---|
294 | DO j = nysg, nyng |
---|
295 | DO k = nzb, nzt+1 |
---|
296 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d ) |
---|
297 | ENDDO |
---|
298 | ENDDO |
---|
299 | ENDDO |
---|
300 | |
---|
301 | CASE ( 'u*' ) |
---|
302 | DO i = nxlg, nxrg |
---|
303 | DO j = nysg, nyng |
---|
304 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d ) |
---|
305 | ENDDO |
---|
306 | ENDDO |
---|
307 | |
---|
308 | CASE ( 'v' ) |
---|
309 | DO i = nxlg, nxrg |
---|
310 | DO j = nysg, nyng |
---|
311 | DO k = nzb, nzt+1 |
---|
312 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d ) |
---|
313 | ENDDO |
---|
314 | ENDDO |
---|
315 | ENDDO |
---|
316 | |
---|
317 | CASE ( 'vpt' ) |
---|
318 | DO i = nxlg, nxrg |
---|
319 | DO j = nysg, nyng |
---|
320 | DO k = nzb, nzt+1 |
---|
321 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d ) |
---|
322 | ENDDO |
---|
323 | ENDDO |
---|
324 | ENDDO |
---|
325 | |
---|
326 | CASE ( 'w' ) |
---|
327 | DO i = nxlg, nxrg |
---|
328 | DO j = nysg, nyng |
---|
329 | DO k = nzb, nzt+1 |
---|
330 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d ) |
---|
331 | ENDDO |
---|
332 | ENDDO |
---|
333 | ENDDO |
---|
334 | |
---|
335 | CASE ( 'z0*' ) |
---|
336 | DO i = nxlg, nxrg |
---|
337 | DO j = nysg, nyng |
---|
338 | z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d ) |
---|
339 | ENDDO |
---|
340 | ENDDO |
---|
341 | |
---|
342 | CASE ( 'z0h*' ) |
---|
343 | DO i = nxlg, nxrg |
---|
344 | DO j = nysg, nyng |
---|
345 | z0h_av(j,i) = z0h_av(j,i) / REAL( average_count_3d ) |
---|
346 | ENDDO |
---|
347 | ENDDO |
---|
348 | |
---|
349 | CASE DEFAULT |
---|
350 | ! |
---|
351 | !-- User-defined quantity |
---|
352 | CALL user_3d_data_averaging( 'average', doav(ii) ) |
---|
353 | |
---|
354 | END SELECT |
---|
355 | |
---|
356 | ENDDO |
---|
357 | |
---|
358 | ! |
---|
359 | !-- Reset the counter |
---|
360 | average_count_3d = 0.0 |
---|
361 | |
---|
362 | CALL cpu_log (log_point(35),'average_3d_data','stop','nobarrier') |
---|
363 | |
---|
364 | |
---|
365 | END SUBROUTINE average_3d_data |
---|