1 | SUBROUTINE average_3d_data |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------! |
---|
4 | ! Current revisions: |
---|
5 | ! ----------------- |
---|
6 | ! |
---|
7 | ! Former revisions: |
---|
8 | ! ----------------- |
---|
9 | ! $Id: average_3d_data.f90 772 2011-10-27 11:08:46Z letzel $ |
---|
10 | ! |
---|
11 | ! 771 2011-10-27 10:56:21Z heinze |
---|
12 | ! +lpt_av |
---|
13 | ! |
---|
14 | ! 667 2010-12-23 12:06:00Z suehring/gryschka |
---|
15 | ! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng |
---|
16 | ! |
---|
17 | ! 367 2009-08-25 08:35:52Z maronga |
---|
18 | ! Added calculation of shf* and qsws* |
---|
19 | ! |
---|
20 | ! 96 2007-06-04 08:07:41Z raasch |
---|
21 | ! Averaging of density and salinity |
---|
22 | ! |
---|
23 | ! 72 2007-03-19 08:20:46Z raasch |
---|
24 | ! Averaging the precipitation rate and roughness length (prr*, z0*) |
---|
25 | ! |
---|
26 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
27 | ! |
---|
28 | ! Revision 1.1 2006/02/23 09:48:58 raasch |
---|
29 | ! Initial revision |
---|
30 | ! |
---|
31 | ! |
---|
32 | ! Description: |
---|
33 | ! ------------ |
---|
34 | ! Time-averaging of 3d-data-arrays. |
---|
35 | !------------------------------------------------------------------------------! |
---|
36 | |
---|
37 | USE arrays_3d |
---|
38 | USE averaging |
---|
39 | USE cloud_parameters |
---|
40 | USE control_parameters |
---|
41 | USE cpulog |
---|
42 | USE indices |
---|
43 | USE interfaces |
---|
44 | |
---|
45 | IMPLICIT NONE |
---|
46 | |
---|
47 | INTEGER :: i, ii, j, k |
---|
48 | |
---|
49 | |
---|
50 | CALL cpu_log (log_point(35),'average_3d_data','start') |
---|
51 | |
---|
52 | ! |
---|
53 | !-- Check, if averaging is necessary |
---|
54 | IF ( average_count_3d <= 1 ) RETURN |
---|
55 | |
---|
56 | ! |
---|
57 | !-- Loop of all variables to be averaged. |
---|
58 | DO ii = 1, doav_n |
---|
59 | |
---|
60 | ! |
---|
61 | !-- Store the array chosen on the temporary array. |
---|
62 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
63 | |
---|
64 | CASE ( 'e' ) |
---|
65 | DO i = nxlg, nxrg |
---|
66 | DO j = nysg, nyng |
---|
67 | DO k = nzb, nzt+1 |
---|
68 | e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d ) |
---|
69 | ENDDO |
---|
70 | ENDDO |
---|
71 | ENDDO |
---|
72 | |
---|
73 | CASE ( 'qsws*' ) |
---|
74 | DO i = nxlg, nxrg |
---|
75 | DO j = nysg, nyng |
---|
76 | qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d ) |
---|
77 | ENDDO |
---|
78 | ENDDO |
---|
79 | |
---|
80 | CASE ( 'lpt' ) |
---|
81 | DO i = nxlg, nxrg |
---|
82 | DO j = nysg, nyng |
---|
83 | DO k = nzb, nzt+1 |
---|
84 | lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d ) |
---|
85 | ENDDO |
---|
86 | ENDDO |
---|
87 | ENDDO |
---|
88 | |
---|
89 | CASE ( 'lwp*' ) |
---|
90 | DO i = nxlg, nxrg |
---|
91 | DO j = nysg, nyng |
---|
92 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d ) |
---|
93 | ENDDO |
---|
94 | ENDDO |
---|
95 | |
---|
96 | CASE ( 'p' ) |
---|
97 | DO i = nxlg, nxrg |
---|
98 | DO j = nysg, nyng |
---|
99 | DO k = nzb, nzt+1 |
---|
100 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d ) |
---|
101 | ENDDO |
---|
102 | ENDDO |
---|
103 | ENDDO |
---|
104 | |
---|
105 | CASE ( 'pc' ) |
---|
106 | DO i = nxl, nxr |
---|
107 | DO j = nys, nyn |
---|
108 | DO k = nzb, nzt+1 |
---|
109 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d ) |
---|
110 | ENDDO |
---|
111 | ENDDO |
---|
112 | ENDDO |
---|
113 | |
---|
114 | CASE ( 'pr' ) |
---|
115 | DO i = nxl, nxr |
---|
116 | DO j = nys, nyn |
---|
117 | DO k = nzb, nzt+1 |
---|
118 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d ) |
---|
119 | ENDDO |
---|
120 | ENDDO |
---|
121 | ENDDO |
---|
122 | |
---|
123 | CASE ( 'prr*' ) |
---|
124 | DO i = nxlg, nxrg |
---|
125 | DO j = nysg, nyng |
---|
126 | precipitation_rate_av(j,i) = precipitation_rate_av(j,i) / & |
---|
127 | REAL( average_count_3d ) |
---|
128 | ENDDO |
---|
129 | ENDDO |
---|
130 | |
---|
131 | CASE ( 'pt' ) |
---|
132 | DO i = nxlg, nxrg |
---|
133 | DO j = nysg, nyng |
---|
134 | DO k = nzb, nzt+1 |
---|
135 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d ) |
---|
136 | ENDDO |
---|
137 | ENDDO |
---|
138 | ENDDO |
---|
139 | |
---|
140 | CASE ( 'q' ) |
---|
141 | DO i = nxlg, nxrg |
---|
142 | DO j = nysg, nyng |
---|
143 | DO k = nzb, nzt+1 |
---|
144 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d ) |
---|
145 | ENDDO |
---|
146 | ENDDO |
---|
147 | ENDDO |
---|
148 | |
---|
149 | CASE ( 'ql' ) |
---|
150 | DO i = nxlg, nxrg |
---|
151 | DO j = nysg, nyng |
---|
152 | DO k = nzb, nzt+1 |
---|
153 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d ) |
---|
154 | ENDDO |
---|
155 | ENDDO |
---|
156 | ENDDO |
---|
157 | |
---|
158 | CASE ( 'ql_c' ) |
---|
159 | DO i = nxlg, nxrg |
---|
160 | DO j = nysg, nyng |
---|
161 | DO k = nzb, nzt+1 |
---|
162 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d ) |
---|
163 | ENDDO |
---|
164 | ENDDO |
---|
165 | ENDDO |
---|
166 | |
---|
167 | CASE ( 'ql_v' ) |
---|
168 | DO i = nxlg, nxrg |
---|
169 | DO j = nysg, nyng |
---|
170 | DO k = nzb, nzt+1 |
---|
171 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d ) |
---|
172 | ENDDO |
---|
173 | ENDDO |
---|
174 | ENDDO |
---|
175 | |
---|
176 | CASE ( 'ql_vp' ) |
---|
177 | DO i = nxlg, nxrg |
---|
178 | DO j = nysg, nyng |
---|
179 | DO k = nzb, nzt+1 |
---|
180 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & |
---|
181 | REAL( average_count_3d ) |
---|
182 | ENDDO |
---|
183 | ENDDO |
---|
184 | ENDDO |
---|
185 | |
---|
186 | CASE ( 'qv' ) |
---|
187 | DO i = nxlg, nxrg |
---|
188 | DO j = nysg, nyng |
---|
189 | DO k = nzb, nzt+1 |
---|
190 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d ) |
---|
191 | ENDDO |
---|
192 | ENDDO |
---|
193 | ENDDO |
---|
194 | |
---|
195 | CASE ( 'rho' ) |
---|
196 | DO i = nxlg, nxrg |
---|
197 | DO j = nysg, nyng |
---|
198 | DO k = nzb, nzt+1 |
---|
199 | rho_av(k,j,i) = rho_av(k,j,i) / REAL( average_count_3d ) |
---|
200 | ENDDO |
---|
201 | ENDDO |
---|
202 | ENDDO |
---|
203 | |
---|
204 | CASE ( 's' ) |
---|
205 | DO i = nxlg, nxrg |
---|
206 | DO j = nysg, nyng |
---|
207 | DO k = nzb, nzt+1 |
---|
208 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d ) |
---|
209 | ENDDO |
---|
210 | ENDDO |
---|
211 | ENDDO |
---|
212 | |
---|
213 | CASE ( 'sa' ) |
---|
214 | DO i = nxlg, nxrg |
---|
215 | DO j = nysg, nyng |
---|
216 | DO k = nzb, nzt+1 |
---|
217 | sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d ) |
---|
218 | ENDDO |
---|
219 | ENDDO |
---|
220 | ENDDO |
---|
221 | |
---|
222 | CASE ( 'shf*' ) |
---|
223 | DO i = nxlg, nxrg |
---|
224 | DO j = nysg, nyng |
---|
225 | shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d ) |
---|
226 | ENDDO |
---|
227 | ENDDO |
---|
228 | |
---|
229 | CASE ( 't*' ) |
---|
230 | DO i = nxlg, nxrg |
---|
231 | DO j = nysg, nyng |
---|
232 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d ) |
---|
233 | ENDDO |
---|
234 | ENDDO |
---|
235 | |
---|
236 | CASE ( 'u' ) |
---|
237 | DO i = nxlg, nxrg |
---|
238 | DO j = nysg, nyng |
---|
239 | DO k = nzb, nzt+1 |
---|
240 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d ) |
---|
241 | ENDDO |
---|
242 | ENDDO |
---|
243 | ENDDO |
---|
244 | |
---|
245 | CASE ( 'u*' ) |
---|
246 | DO i = nxlg, nxrg |
---|
247 | DO j = nysg, nyng |
---|
248 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d ) |
---|
249 | ENDDO |
---|
250 | ENDDO |
---|
251 | |
---|
252 | CASE ( 'v' ) |
---|
253 | DO i = nxlg, nxrg |
---|
254 | DO j = nysg, nyng |
---|
255 | DO k = nzb, nzt+1 |
---|
256 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d ) |
---|
257 | ENDDO |
---|
258 | ENDDO |
---|
259 | ENDDO |
---|
260 | |
---|
261 | CASE ( 'vpt' ) |
---|
262 | DO i = nxlg, nxrg |
---|
263 | DO j = nysg, nyng |
---|
264 | DO k = nzb, nzt+1 |
---|
265 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d ) |
---|
266 | ENDDO |
---|
267 | ENDDO |
---|
268 | ENDDO |
---|
269 | |
---|
270 | CASE ( 'w' ) |
---|
271 | DO i = nxlg, nxrg |
---|
272 | DO j = nysg, nyng |
---|
273 | DO k = nzb, nzt+1 |
---|
274 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d ) |
---|
275 | ENDDO |
---|
276 | ENDDO |
---|
277 | ENDDO |
---|
278 | |
---|
279 | CASE ( 'z0*' ) |
---|
280 | DO i = nxlg, nxrg |
---|
281 | DO j = nysg, nyng |
---|
282 | z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d ) |
---|
283 | ENDDO |
---|
284 | ENDDO |
---|
285 | |
---|
286 | CASE DEFAULT |
---|
287 | ! |
---|
288 | !-- User-defined quantity |
---|
289 | CALL user_3d_data_averaging( 'average', doav(ii) ) |
---|
290 | |
---|
291 | END SELECT |
---|
292 | |
---|
293 | ENDDO |
---|
294 | |
---|
295 | ! |
---|
296 | !-- Reset the counter |
---|
297 | average_count_3d = 0.0 |
---|
298 | |
---|
299 | CALL cpu_log (log_point(35),'average_3d_data','stop','nobarrier') |
---|
300 | |
---|
301 | |
---|
302 | END SUBROUTINE average_3d_data |
---|