1 | SUBROUTINE average_3d_data |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------! |
---|
4 | ! Actual revisions: |
---|
5 | ! ----------------- |
---|
6 | ! |
---|
7 | ! |
---|
8 | ! Former revisions: |
---|
9 | ! ----------------- |
---|
10 | ! $Id: average_3d_data.f90 98 2007-06-21 09:36:33Z weinreis $ |
---|
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 ( 'lwp*' ) |
---|
66 | DO i = nxl-1, nxr+1 |
---|
67 | DO j = nys-1, nyn+1 |
---|
68 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d ) |
---|
69 | ENDDO |
---|
70 | ENDDO |
---|
71 | |
---|
72 | CASE ( 'p' ) |
---|
73 | DO i = nxl-1, nxr+1 |
---|
74 | DO j = nys-1, nyn+1 |
---|
75 | DO k = nzb, nzt+1 |
---|
76 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d ) |
---|
77 | ENDDO |
---|
78 | ENDDO |
---|
79 | ENDDO |
---|
80 | |
---|
81 | CASE ( 'pc' ) |
---|
82 | DO i = nxl, nxr |
---|
83 | DO j = nys, nyn |
---|
84 | DO k = nzb, nzt+1 |
---|
85 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d ) |
---|
86 | ENDDO |
---|
87 | ENDDO |
---|
88 | ENDDO |
---|
89 | |
---|
90 | CASE ( 'pr' ) |
---|
91 | DO i = nxl, nxr |
---|
92 | DO j = nys, nyn |
---|
93 | DO k = nzb, nzt+1 |
---|
94 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d ) |
---|
95 | ENDDO |
---|
96 | ENDDO |
---|
97 | ENDDO |
---|
98 | |
---|
99 | CASE ( 'prr*' ) |
---|
100 | DO i = nxl-1, nxr+1 |
---|
101 | DO j = nys-1, nyn+1 |
---|
102 | precipitation_rate_av(j,i) = precipitation_rate_av(j,i) / & |
---|
103 | REAL( average_count_3d ) |
---|
104 | ENDDO |
---|
105 | ENDDO |
---|
106 | |
---|
107 | CASE ( 'pt' ) |
---|
108 | DO i = nxl-1, nxr+1 |
---|
109 | DO j = nys-1, nyn+1 |
---|
110 | DO k = nzb, nzt+1 |
---|
111 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d ) |
---|
112 | ENDDO |
---|
113 | ENDDO |
---|
114 | ENDDO |
---|
115 | |
---|
116 | CASE ( 'q' ) |
---|
117 | DO i = nxl-1, nxr+1 |
---|
118 | DO j = nys-1, nyn+1 |
---|
119 | DO k = nzb, nzt+1 |
---|
120 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d ) |
---|
121 | ENDDO |
---|
122 | ENDDO |
---|
123 | ENDDO |
---|
124 | |
---|
125 | CASE ( 'ql' ) |
---|
126 | DO i = nxl-1, nxr+1 |
---|
127 | DO j = nys-1, nyn+1 |
---|
128 | DO k = nzb, nzt+1 |
---|
129 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d ) |
---|
130 | ENDDO |
---|
131 | ENDDO |
---|
132 | ENDDO |
---|
133 | |
---|
134 | CASE ( 'ql_c' ) |
---|
135 | DO i = nxl-1, nxr+1 |
---|
136 | DO j = nys-1, nyn+1 |
---|
137 | DO k = nzb, nzt+1 |
---|
138 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d ) |
---|
139 | ENDDO |
---|
140 | ENDDO |
---|
141 | ENDDO |
---|
142 | |
---|
143 | CASE ( 'ql_v' ) |
---|
144 | DO i = nxl-1, nxr+1 |
---|
145 | DO j = nys-1, nyn+1 |
---|
146 | DO k = nzb, nzt+1 |
---|
147 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d ) |
---|
148 | ENDDO |
---|
149 | ENDDO |
---|
150 | ENDDO |
---|
151 | |
---|
152 | CASE ( 'ql_vp' ) |
---|
153 | DO i = nxl-1, nxr+1 |
---|
154 | DO j = nys-1, nyn+1 |
---|
155 | DO k = nzb, nzt+1 |
---|
156 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & |
---|
157 | REAL( average_count_3d ) |
---|
158 | ENDDO |
---|
159 | ENDDO |
---|
160 | ENDDO |
---|
161 | |
---|
162 | CASE ( 'qv' ) |
---|
163 | DO i = nxl-1, nxr+1 |
---|
164 | DO j = nys-1, nyn+1 |
---|
165 | DO k = nzb, nzt+1 |
---|
166 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d ) |
---|
167 | ENDDO |
---|
168 | ENDDO |
---|
169 | ENDDO |
---|
170 | |
---|
171 | CASE ( 'rho' ) |
---|
172 | DO i = nxl-1, nxr+1 |
---|
173 | DO j = nys-1, nyn+1 |
---|
174 | DO k = nzb, nzt+1 |
---|
175 | rho_av(k,j,i) = rho_av(k,j,i) / REAL( average_count_3d ) |
---|
176 | ENDDO |
---|
177 | ENDDO |
---|
178 | ENDDO |
---|
179 | |
---|
180 | CASE ( 's' ) |
---|
181 | DO i = nxl-1, nxr+1 |
---|
182 | DO j = nys-1, nyn+1 |
---|
183 | DO k = nzb, nzt+1 |
---|
184 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d ) |
---|
185 | ENDDO |
---|
186 | ENDDO |
---|
187 | ENDDO |
---|
188 | |
---|
189 | CASE ( 'sa' ) |
---|
190 | DO i = nxl-1, nxr+1 |
---|
191 | DO j = nys-1, nyn+1 |
---|
192 | DO k = nzb, nzt+1 |
---|
193 | sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d ) |
---|
194 | ENDDO |
---|
195 | ENDDO |
---|
196 | ENDDO |
---|
197 | |
---|
198 | CASE ( 't*' ) |
---|
199 | DO i = nxl-1, nxr+1 |
---|
200 | DO j = nys-1, nyn+1 |
---|
201 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d ) |
---|
202 | ENDDO |
---|
203 | ENDDO |
---|
204 | |
---|
205 | CASE ( 'u' ) |
---|
206 | DO i = nxl-1, nxr+1 |
---|
207 | DO j = nys-1, nyn+1 |
---|
208 | DO k = nzb, nzt+1 |
---|
209 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d ) |
---|
210 | ENDDO |
---|
211 | ENDDO |
---|
212 | ENDDO |
---|
213 | |
---|
214 | CASE ( 'u*' ) |
---|
215 | DO i = nxl-1, nxr+1 |
---|
216 | DO j = nys-1, nyn+1 |
---|
217 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d ) |
---|
218 | ENDDO |
---|
219 | ENDDO |
---|
220 | |
---|
221 | CASE ( 'v' ) |
---|
222 | DO i = nxl-1, nxr+1 |
---|
223 | DO j = nys-1, nyn+1 |
---|
224 | DO k = nzb, nzt+1 |
---|
225 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d ) |
---|
226 | ENDDO |
---|
227 | ENDDO |
---|
228 | ENDDO |
---|
229 | |
---|
230 | CASE ( 'vpt' ) |
---|
231 | DO i = nxl-1, nxr+1 |
---|
232 | DO j = nys-1, nyn+1 |
---|
233 | DO k = nzb, nzt+1 |
---|
234 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d ) |
---|
235 | ENDDO |
---|
236 | ENDDO |
---|
237 | ENDDO |
---|
238 | |
---|
239 | CASE ( 'w' ) |
---|
240 | DO i = nxl-1, nxr+1 |
---|
241 | DO j = nys-1, nyn+1 |
---|
242 | DO k = nzb, nzt+1 |
---|
243 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d ) |
---|
244 | ENDDO |
---|
245 | ENDDO |
---|
246 | ENDDO |
---|
247 | |
---|
248 | CASE ( 'z0*' ) |
---|
249 | DO i = nxl-1, nxr+1 |
---|
250 | DO j = nys-1, nyn+1 |
---|
251 | z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d ) |
---|
252 | ENDDO |
---|
253 | ENDDO |
---|
254 | |
---|
255 | CASE DEFAULT |
---|
256 | ! |
---|
257 | !-- User-defined quantity |
---|
258 | CALL user_3d_data_averaging( 'average', doav(ii) ) |
---|
259 | |
---|
260 | END SELECT |
---|
261 | |
---|
262 | ENDDO |
---|
263 | |
---|
264 | ! |
---|
265 | !-- Reset the counter |
---|
266 | average_count_3d = 0.0 |
---|
267 | |
---|
268 | CALL cpu_log (log_point(35),'average_3d_data','stop','nobarrier') |
---|
269 | |
---|
270 | |
---|
271 | END SUBROUTINE average_3d_data |
---|