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