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