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