[1] | 1 | SUBROUTINE sum_up_3d_data |
---|
| 2 | |
---|
[1036] | 3 | !--------------------------------------------------------------------------------! |
---|
| 4 | ! This file is part of PALM. |
---|
| 5 | ! |
---|
| 6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 8 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 9 | ! |
---|
| 10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 13 | ! |
---|
| 14 | ! You should have received a copy of the GNU General Public License along with |
---|
| 15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 16 | ! |
---|
[1310] | 17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1321] | 22 | ! |
---|
[1354] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: sum_up_3d_data.f90 1354 2014-04-08 15:22:57Z witha $ |
---|
| 27 | ! |
---|
[1354] | 28 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 29 | ! REAL constants provided with KIND-attribute |
---|
| 30 | ! |
---|
[1321] | 31 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 32 | ! ONLY-attribute added to USE-statements, |
---|
| 33 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 34 | ! kinds are defined in new module kinds, |
---|
| 35 | ! old module precision_kind is removed, |
---|
| 36 | ! revision history before 2012 removed, |
---|
| 37 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 38 | ! all variable declaration statements |
---|
[1] | 39 | ! |
---|
[1319] | 40 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
| 41 | ! barrier argument removed from cpu_log, |
---|
| 42 | ! module interfaces removed |
---|
| 43 | ! |
---|
[1116] | 44 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 45 | ! ql is calculated by calc_liquid_water_content |
---|
| 46 | ! |
---|
[1054] | 47 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 48 | ! +nr, prr, qr |
---|
| 49 | ! |
---|
[1037] | 50 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 51 | ! code put under GPL (PALM 3.9) |
---|
| 52 | ! |
---|
[1008] | 53 | ! 1007 2012-09-19 14:30:36Z franke |
---|
| 54 | ! Bugfix in calculation of ql_vp |
---|
| 55 | ! |
---|
[979] | 56 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 57 | ! +z0h* |
---|
| 58 | ! |
---|
[1] | 59 | ! Revision 1.1 2006/02/23 12:55:23 raasch |
---|
| 60 | ! Initial revision |
---|
| 61 | ! |
---|
| 62 | ! |
---|
| 63 | ! Description: |
---|
| 64 | ! ------------ |
---|
| 65 | ! Sum-up the values of 3d-arrays. The real averaging is later done in routine |
---|
| 66 | ! average_3d_data. |
---|
| 67 | !------------------------------------------------------------------------------! |
---|
| 68 | |
---|
[1320] | 69 | USE arrays_3d, & |
---|
| 70 | ONLY: dzw, e, nr, p, pt, q, qc, ql, ql_c, ql_v, qr, qsws, rho, sa, & |
---|
| 71 | shf, ts, u, us, v, vpt, w, z0, z0h |
---|
[1] | 72 | |
---|
[1320] | 73 | USE averaging, & |
---|
| 74 | ONLY: e_av, lpt_av, lwp_av, nr_av, p_av, pc_av, pr_av, prr_av, & |
---|
| 75 | precipitation_rate_av, pt_av, q_av, qc_av, ql_av, ql_c_av, & |
---|
| 76 | ql_v_av, ql_vp_av, qr_av, qsws_av, qv_av, rho_av, s_av, sa_av, & |
---|
| 77 | shf_av, ts_av, u_av, us_av, v_av, vpt_av, w_av, z0_av, z0h_av |
---|
| 78 | |
---|
| 79 | USE cloud_parameters, & |
---|
| 80 | ONLY: l_d_cp, precipitation_rate, pt_d_t |
---|
| 81 | |
---|
| 82 | USE control_parameters, & |
---|
| 83 | ONLY: average_count_3d, cloud_physics, doav, doav_n |
---|
| 84 | |
---|
| 85 | USE cpulog, & |
---|
| 86 | ONLY: cpu_log, log_point |
---|
| 87 | |
---|
| 88 | USE indices, & |
---|
| 89 | ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
| 90 | |
---|
| 91 | USE kinds |
---|
| 92 | |
---|
| 93 | USE particle_attributes, & |
---|
| 94 | ONLY: particles, prt_count, prt_start_index |
---|
| 95 | |
---|
[1] | 96 | IMPLICIT NONE |
---|
| 97 | |
---|
[1320] | 98 | INTEGER(iwp) :: i !: |
---|
| 99 | INTEGER(iwp) :: ii !: |
---|
| 100 | INTEGER(iwp) :: j !: |
---|
| 101 | INTEGER(iwp) :: k !: |
---|
| 102 | INTEGER(iwp) :: n !: |
---|
| 103 | INTEGER(iwp) :: psi !: |
---|
[1] | 104 | |
---|
[1320] | 105 | REAL(wp) :: mean_r !: |
---|
| 106 | REAL(wp) :: s_r3 !: |
---|
| 107 | REAL(wp) :: s_r4 !: |
---|
[1] | 108 | |
---|
| 109 | CALL cpu_log (log_point(34),'sum_up_3d_data','start') |
---|
| 110 | |
---|
| 111 | ! |
---|
| 112 | !-- Allocate and initialize the summation arrays if called for the very first |
---|
| 113 | !-- time or the first time after average_3d_data has been called |
---|
| 114 | !-- (some or all of the arrays may have been already allocated |
---|
| 115 | !-- in read_3d_binary) |
---|
| 116 | IF ( average_count_3d == 0 ) THEN |
---|
| 117 | |
---|
| 118 | DO ii = 1, doav_n |
---|
| 119 | |
---|
| 120 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
| 121 | |
---|
| 122 | CASE ( 'e' ) |
---|
| 123 | IF ( .NOT. ALLOCATED( e_av ) ) THEN |
---|
[667] | 124 | ALLOCATE( e_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 125 | ENDIF |
---|
[1353] | 126 | e_av = 0.0_wp |
---|
[1] | 127 | |
---|
[771] | 128 | CASE ( 'lpt' ) |
---|
| 129 | IF ( .NOT. ALLOCATED( lpt_av ) ) THEN |
---|
| 130 | ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 131 | ENDIF |
---|
[1353] | 132 | lpt_av = 0.0_wp |
---|
[771] | 133 | |
---|
[1] | 134 | CASE ( 'lwp*' ) |
---|
| 135 | IF ( .NOT. ALLOCATED( lwp_av ) ) THEN |
---|
[667] | 136 | ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 137 | ENDIF |
---|
[1353] | 138 | lwp_av = 0.0_wp |
---|
[1] | 139 | |
---|
[1053] | 140 | CASE ( 'nr' ) |
---|
| 141 | IF ( .NOT. ALLOCATED( nr_av ) ) THEN |
---|
| 142 | ALLOCATE( nr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 143 | ENDIF |
---|
[1353] | 144 | nr_av = 0.0_wp |
---|
[1053] | 145 | |
---|
[1] | 146 | CASE ( 'p' ) |
---|
| 147 | IF ( .NOT. ALLOCATED( p_av ) ) THEN |
---|
[667] | 148 | ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 149 | ENDIF |
---|
[1353] | 150 | p_av = 0.0_wp |
---|
[1] | 151 | |
---|
| 152 | CASE ( 'pc' ) |
---|
| 153 | IF ( .NOT. ALLOCATED( pc_av ) ) THEN |
---|
[667] | 154 | ALLOCATE( pc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 155 | ENDIF |
---|
[1353] | 156 | pc_av = 0.0_wp |
---|
[1] | 157 | |
---|
| 158 | CASE ( 'pr' ) |
---|
| 159 | IF ( .NOT. ALLOCATED( pr_av ) ) THEN |
---|
[667] | 160 | ALLOCATE( pr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 161 | ENDIF |
---|
[1353] | 162 | pr_av = 0.0_wp |
---|
[1] | 163 | |
---|
[1053] | 164 | CASE ( 'prr' ) |
---|
| 165 | IF ( .NOT. ALLOCATED( prr_av ) ) THEN |
---|
| 166 | ALLOCATE( prr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 167 | ENDIF |
---|
[1353] | 168 | prr_av = 0.0_wp |
---|
[1053] | 169 | |
---|
[72] | 170 | CASE ( 'prr*' ) |
---|
| 171 | IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN |
---|
[667] | 172 | ALLOCATE( precipitation_rate_av(nysg:nyng,nxlg:nxrg) ) |
---|
[72] | 173 | ENDIF |
---|
[1353] | 174 | precipitation_rate_av = 0.0_wp |
---|
[72] | 175 | |
---|
[1] | 176 | CASE ( 'pt' ) |
---|
| 177 | IF ( .NOT. ALLOCATED( pt_av ) ) THEN |
---|
[667] | 178 | ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 179 | ENDIF |
---|
[1353] | 180 | pt_av = 0.0_wp |
---|
[1] | 181 | |
---|
| 182 | CASE ( 'q' ) |
---|
| 183 | IF ( .NOT. ALLOCATED( q_av ) ) THEN |
---|
[667] | 184 | ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 185 | ENDIF |
---|
[1353] | 186 | q_av = 0.0_wp |
---|
[1] | 187 | |
---|
[1115] | 188 | CASE ( 'qc' ) |
---|
| 189 | IF ( .NOT. ALLOCATED( qc_av ) ) THEN |
---|
| 190 | ALLOCATE( qc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 191 | ENDIF |
---|
[1353] | 192 | qc_av = 0.0_wp |
---|
[1115] | 193 | |
---|
[1] | 194 | CASE ( 'ql' ) |
---|
| 195 | IF ( .NOT. ALLOCATED( ql_av ) ) THEN |
---|
[667] | 196 | ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 197 | ENDIF |
---|
[1353] | 198 | ql_av = 0.0_wp |
---|
[1] | 199 | |
---|
| 200 | CASE ( 'ql_c' ) |
---|
| 201 | IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN |
---|
[667] | 202 | ALLOCATE( ql_c_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 203 | ENDIF |
---|
[1353] | 204 | ql_c_av = 0.0_wp |
---|
[1] | 205 | |
---|
| 206 | CASE ( 'ql_v' ) |
---|
| 207 | IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN |
---|
[667] | 208 | ALLOCATE( ql_v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 209 | ENDIF |
---|
[1353] | 210 | ql_v_av = 0.0_wp |
---|
[1] | 211 | |
---|
| 212 | CASE ( 'ql_vp' ) |
---|
| 213 | IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN |
---|
[667] | 214 | ALLOCATE( ql_vp_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 215 | ENDIF |
---|
[1353] | 216 | ql_vp_av = 0.0_wp |
---|
[1] | 217 | |
---|
[1053] | 218 | CASE ( 'qr' ) |
---|
| 219 | IF ( .NOT. ALLOCATED( qr_av ) ) THEN |
---|
| 220 | ALLOCATE( qr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 221 | ENDIF |
---|
[1353] | 222 | qr_av = 0.0_wp |
---|
[1053] | 223 | |
---|
[354] | 224 | CASE ( 'qsws*' ) |
---|
| 225 | IF ( .NOT. ALLOCATED( qsws_av ) ) THEN |
---|
[667] | 226 | ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 227 | ENDIF |
---|
[1353] | 228 | qsws_av = 0.0_wp |
---|
[354] | 229 | |
---|
[1] | 230 | CASE ( 'qv' ) |
---|
| 231 | IF ( .NOT. ALLOCATED( qv_av ) ) THEN |
---|
[667] | 232 | ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 233 | ENDIF |
---|
[1353] | 234 | qv_av = 0.0_wp |
---|
[1] | 235 | |
---|
[96] | 236 | CASE ( 'rho' ) |
---|
| 237 | IF ( .NOT. ALLOCATED( rho_av ) ) THEN |
---|
[667] | 238 | ALLOCATE( rho_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[96] | 239 | ENDIF |
---|
[1353] | 240 | rho_av = 0.0_wp |
---|
[96] | 241 | |
---|
[1] | 242 | CASE ( 's' ) |
---|
| 243 | IF ( .NOT. ALLOCATED( s_av ) ) THEN |
---|
[667] | 244 | ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 245 | ENDIF |
---|
[1353] | 246 | s_av = 0.0_wp |
---|
[1] | 247 | |
---|
[96] | 248 | CASE ( 'sa' ) |
---|
| 249 | IF ( .NOT. ALLOCATED( sa_av ) ) THEN |
---|
[667] | 250 | ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[96] | 251 | ENDIF |
---|
[1353] | 252 | sa_av = 0.0_wp |
---|
[96] | 253 | |
---|
[354] | 254 | CASE ( 'shf*' ) |
---|
| 255 | IF ( .NOT. ALLOCATED( shf_av ) ) THEN |
---|
[667] | 256 | ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 257 | ENDIF |
---|
[1353] | 258 | shf_av = 0.0_wp |
---|
[354] | 259 | |
---|
[1] | 260 | CASE ( 't*' ) |
---|
| 261 | IF ( .NOT. ALLOCATED( ts_av ) ) THEN |
---|
[667] | 262 | ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 263 | ENDIF |
---|
[1353] | 264 | ts_av = 0.0_wp |
---|
[1] | 265 | |
---|
| 266 | CASE ( 'u' ) |
---|
| 267 | IF ( .NOT. ALLOCATED( u_av ) ) THEN |
---|
[667] | 268 | ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 269 | ENDIF |
---|
[1353] | 270 | u_av = 0.0_wp |
---|
[1] | 271 | |
---|
| 272 | CASE ( 'u*' ) |
---|
| 273 | IF ( .NOT. ALLOCATED( us_av ) ) THEN |
---|
[667] | 274 | ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 275 | ENDIF |
---|
[1353] | 276 | us_av = 0.0_wp |
---|
[1] | 277 | |
---|
| 278 | CASE ( 'v' ) |
---|
| 279 | IF ( .NOT. ALLOCATED( v_av ) ) THEN |
---|
[667] | 280 | ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 281 | ENDIF |
---|
[1353] | 282 | v_av = 0.0_wp |
---|
[1] | 283 | |
---|
| 284 | CASE ( 'vpt' ) |
---|
| 285 | IF ( .NOT. ALLOCATED( vpt_av ) ) THEN |
---|
[667] | 286 | ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 287 | ENDIF |
---|
[1353] | 288 | vpt_av = 0.0_wp |
---|
[1] | 289 | |
---|
| 290 | CASE ( 'w' ) |
---|
| 291 | IF ( .NOT. ALLOCATED( w_av ) ) THEN |
---|
[667] | 292 | ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 293 | ENDIF |
---|
[1353] | 294 | w_av = 0.0_wp |
---|
[1] | 295 | |
---|
[72] | 296 | CASE ( 'z0*' ) |
---|
| 297 | IF ( .NOT. ALLOCATED( z0_av ) ) THEN |
---|
[667] | 298 | ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) |
---|
[72] | 299 | ENDIF |
---|
[1353] | 300 | z0_av = 0.0_wp |
---|
[72] | 301 | |
---|
[978] | 302 | CASE ( 'z0h*' ) |
---|
| 303 | IF ( .NOT. ALLOCATED( z0h_av ) ) THEN |
---|
| 304 | ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 305 | ENDIF |
---|
[1353] | 306 | z0h_av = 0.0_wp |
---|
[978] | 307 | |
---|
[1] | 308 | CASE DEFAULT |
---|
| 309 | ! |
---|
| 310 | !-- User-defined quantity |
---|
| 311 | CALL user_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 312 | |
---|
| 313 | END SELECT |
---|
| 314 | |
---|
| 315 | ENDDO |
---|
| 316 | |
---|
| 317 | ENDIF |
---|
| 318 | |
---|
| 319 | ! |
---|
| 320 | !-- Loop of all variables to be averaged. |
---|
| 321 | DO ii = 1, doav_n |
---|
| 322 | |
---|
| 323 | ! |
---|
| 324 | !-- Store the array chosen on the temporary array. |
---|
| 325 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
| 326 | |
---|
| 327 | CASE ( 'e' ) |
---|
[667] | 328 | DO i = nxlg, nxrg |
---|
| 329 | DO j = nysg, nyng |
---|
[1] | 330 | DO k = nzb, nzt+1 |
---|
| 331 | e_av(k,j,i) = e_av(k,j,i) + e(k,j,i) |
---|
| 332 | ENDDO |
---|
| 333 | ENDDO |
---|
| 334 | ENDDO |
---|
| 335 | |
---|
[771] | 336 | CASE ( 'lpt' ) |
---|
| 337 | DO i = nxlg, nxrg |
---|
| 338 | DO j = nysg, nyng |
---|
| 339 | DO k = nzb, nzt+1 |
---|
| 340 | lpt_av(k,j,i) = lpt_av(k,j,i) + pt(k,j,i) |
---|
| 341 | ENDDO |
---|
| 342 | ENDDO |
---|
| 343 | ENDDO |
---|
| 344 | |
---|
[1] | 345 | CASE ( 'lwp*' ) |
---|
[667] | 346 | DO i = nxlg, nxrg |
---|
| 347 | DO j = nysg, nyng |
---|
[1] | 348 | lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i) * & |
---|
| 349 | dzw(1:nzt+1) ) |
---|
| 350 | ENDDO |
---|
| 351 | ENDDO |
---|
| 352 | |
---|
[1053] | 353 | CASE ( 'nr' ) |
---|
| 354 | DO i = nxlg, nxrg |
---|
| 355 | DO j = nysg, nyng |
---|
| 356 | DO k = nzb, nzt+1 |
---|
| 357 | nr_av(k,j,i) = nr_av(k,j,i) + nr(k,j,i) |
---|
| 358 | ENDDO |
---|
| 359 | ENDDO |
---|
| 360 | ENDDO |
---|
| 361 | |
---|
[1] | 362 | CASE ( 'p' ) |
---|
[667] | 363 | DO i = nxlg, nxrg |
---|
| 364 | DO j = nysg, nyng |
---|
[1] | 365 | DO k = nzb, nzt+1 |
---|
| 366 | p_av(k,j,i) = p_av(k,j,i) + p(k,j,i) |
---|
| 367 | ENDDO |
---|
| 368 | ENDDO |
---|
| 369 | ENDDO |
---|
| 370 | |
---|
| 371 | CASE ( 'pc' ) |
---|
| 372 | DO i = nxl, nxr |
---|
| 373 | DO j = nys, nyn |
---|
| 374 | DO k = nzb, nzt+1 |
---|
| 375 | pc_av(k,j,i) = pc_av(k,j,i) + prt_count(k,j,i) |
---|
| 376 | ENDDO |
---|
| 377 | ENDDO |
---|
| 378 | ENDDO |
---|
| 379 | |
---|
| 380 | CASE ( 'pr' ) |
---|
| 381 | DO i = nxl, nxr |
---|
| 382 | DO j = nys, nyn |
---|
| 383 | DO k = nzb, nzt+1 |
---|
| 384 | psi = prt_start_index(k,j,i) |
---|
[1353] | 385 | s_r3 = 0.0_wp |
---|
| 386 | s_r4 = 0.0_wp |
---|
[1] | 387 | DO n = psi, psi+prt_count(k,j,i)-1 |
---|
[790] | 388 | s_r3 = s_r3 + particles(n)%radius**3 * & |
---|
| 389 | particles(n)%weight_factor |
---|
| 390 | s_r4 = s_r4 + particles(n)%radius**4 * & |
---|
| 391 | particles(n)%weight_factor |
---|
[1] | 392 | ENDDO |
---|
[1353] | 393 | IF ( s_r3 /= 0.0_wp ) THEN |
---|
[1] | 394 | mean_r = s_r4 / s_r3 |
---|
| 395 | ELSE |
---|
[1353] | 396 | mean_r = 0.0_wp |
---|
[1] | 397 | ENDIF |
---|
| 398 | pr_av(k,j,i) = pr_av(k,j,i) + mean_r |
---|
| 399 | ENDDO |
---|
| 400 | ENDDO |
---|
| 401 | ENDDO |
---|
| 402 | |
---|
[72] | 403 | CASE ( 'pr*' ) |
---|
[667] | 404 | DO i = nxlg, nxrg |
---|
| 405 | DO j = nysg, nyng |
---|
[72] | 406 | precipitation_rate_av(j,i) = precipitation_rate_av(j,i) + & |
---|
| 407 | precipitation_rate(j,i) |
---|
| 408 | ENDDO |
---|
| 409 | ENDDO |
---|
| 410 | |
---|
[1] | 411 | CASE ( 'pt' ) |
---|
| 412 | IF ( .NOT. cloud_physics ) THEN |
---|
[667] | 413 | DO i = nxlg, nxrg |
---|
| 414 | DO j = nysg, nyng |
---|
| 415 | DO k = nzb, nzt+1 |
---|
[1] | 416 | pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) |
---|
| 417 | ENDDO |
---|
| 418 | ENDDO |
---|
| 419 | ENDDO |
---|
| 420 | ELSE |
---|
[667] | 421 | DO i = nxlg, nxrg |
---|
| 422 | DO j = nysg, nyng |
---|
| 423 | DO k = nzb, nzt+1 |
---|
[1] | 424 | pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) + l_d_cp * & |
---|
| 425 | pt_d_t(k) * ql(k,j,i) |
---|
| 426 | ENDDO |
---|
| 427 | ENDDO |
---|
| 428 | ENDDO |
---|
| 429 | ENDIF |
---|
| 430 | |
---|
| 431 | CASE ( 'q' ) |
---|
[667] | 432 | DO i = nxlg, nxrg |
---|
| 433 | DO j = nysg, nyng |
---|
[1] | 434 | DO k = nzb, nzt+1 |
---|
| 435 | q_av(k,j,i) = q_av(k,j,i) + q(k,j,i) |
---|
| 436 | ENDDO |
---|
| 437 | ENDDO |
---|
| 438 | ENDDO |
---|
[402] | 439 | |
---|
[1115] | 440 | CASE ( 'qc' ) |
---|
| 441 | DO i = nxlg, nxrg |
---|
| 442 | DO j = nysg, nyng |
---|
| 443 | DO k = nzb, nzt+1 |
---|
| 444 | qc_av(k,j,i) = qc_av(k,j,i) + qc(k,j,i) |
---|
| 445 | ENDDO |
---|
| 446 | ENDDO |
---|
| 447 | ENDDO |
---|
| 448 | |
---|
[1] | 449 | CASE ( 'ql' ) |
---|
[667] | 450 | DO i = nxlg, nxrg |
---|
| 451 | DO j = nysg, nyng |
---|
[1] | 452 | DO k = nzb, nzt+1 |
---|
| 453 | ql_av(k,j,i) = ql_av(k,j,i) + ql(k,j,i) |
---|
| 454 | ENDDO |
---|
| 455 | ENDDO |
---|
| 456 | ENDDO |
---|
| 457 | |
---|
| 458 | CASE ( 'ql_c' ) |
---|
[667] | 459 | DO i = nxlg, nxrg |
---|
| 460 | DO j = nysg, nyng |
---|
[1] | 461 | DO k = nzb, nzt+1 |
---|
| 462 | ql_c_av(k,j,i) = ql_c_av(k,j,i) + ql_c(k,j,i) |
---|
| 463 | ENDDO |
---|
| 464 | ENDDO |
---|
| 465 | ENDDO |
---|
| 466 | |
---|
| 467 | CASE ( 'ql_v' ) |
---|
[667] | 468 | DO i = nxlg, nxrg |
---|
| 469 | DO j = nysg, nyng |
---|
[1] | 470 | DO k = nzb, nzt+1 |
---|
| 471 | ql_v_av(k,j,i) = ql_v_av(k,j,i) + ql_v(k,j,i) |
---|
| 472 | ENDDO |
---|
| 473 | ENDDO |
---|
| 474 | ENDDO |
---|
| 475 | |
---|
| 476 | CASE ( 'ql_vp' ) |
---|
[1007] | 477 | DO i = nxl, nxr |
---|
| 478 | DO j = nys, nyn |
---|
[1] | 479 | DO k = nzb, nzt+1 |
---|
[1007] | 480 | psi = prt_start_index(k,j,i) |
---|
| 481 | DO n = psi, psi+prt_count(k,j,i)-1 |
---|
| 482 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) + & |
---|
| 483 | particles(n)%weight_factor / & |
---|
| 484 | prt_count(k,j,i) |
---|
| 485 | ENDDO |
---|
[1] | 486 | ENDDO |
---|
| 487 | ENDDO |
---|
| 488 | ENDDO |
---|
| 489 | |
---|
[1053] | 490 | CASE ( 'qr' ) |
---|
| 491 | DO i = nxlg, nxrg |
---|
| 492 | DO j = nysg, nyng |
---|
| 493 | DO k = nzb, nzt+1 |
---|
| 494 | qr_av(k,j,i) = qr_av(k,j,i) + qr(k,j,i) |
---|
| 495 | ENDDO |
---|
| 496 | ENDDO |
---|
| 497 | ENDDO |
---|
| 498 | |
---|
[402] | 499 | CASE ( 'qsws*' ) |
---|
[667] | 500 | DO i = nxlg, nxrg |
---|
| 501 | DO j = nysg, nyng |
---|
[402] | 502 | qsws_av(j,i) = qsws_av(j,i) + qsws(j,i) |
---|
| 503 | ENDDO |
---|
| 504 | ENDDO |
---|
| 505 | |
---|
[1] | 506 | CASE ( 'qv' ) |
---|
[667] | 507 | DO i = nxlg, nxrg |
---|
| 508 | DO j = nysg, nyng |
---|
[1] | 509 | DO k = nzb, nzt+1 |
---|
| 510 | qv_av(k,j,i) = qv_av(k,j,i) + q(k,j,i) - ql(k,j,i) |
---|
| 511 | ENDDO |
---|
| 512 | ENDDO |
---|
| 513 | ENDDO |
---|
| 514 | |
---|
[96] | 515 | CASE ( 'rho' ) |
---|
[667] | 516 | DO i = nxlg, nxrg |
---|
| 517 | DO j = nysg, nyng |
---|
[96] | 518 | DO k = nzb, nzt+1 |
---|
| 519 | rho_av(k,j,i) = rho_av(k,j,i) + rho(k,j,i) |
---|
| 520 | ENDDO |
---|
| 521 | ENDDO |
---|
| 522 | ENDDO |
---|
[402] | 523 | |
---|
[1] | 524 | CASE ( 's' ) |
---|
[667] | 525 | DO i = nxlg, nxrg |
---|
| 526 | DO j = nysg, nyng |
---|
[1] | 527 | DO k = nzb, nzt+1 |
---|
| 528 | s_av(k,j,i) = s_av(k,j,i) + q(k,j,i) |
---|
| 529 | ENDDO |
---|
| 530 | ENDDO |
---|
| 531 | ENDDO |
---|
[402] | 532 | |
---|
[96] | 533 | CASE ( 'sa' ) |
---|
[667] | 534 | DO i = nxlg, nxrg |
---|
| 535 | DO j = nysg, nyng |
---|
[96] | 536 | DO k = nzb, nzt+1 |
---|
| 537 | sa_av(k,j,i) = sa_av(k,j,i) + sa(k,j,i) |
---|
| 538 | ENDDO |
---|
| 539 | ENDDO |
---|
| 540 | ENDDO |
---|
[402] | 541 | |
---|
| 542 | CASE ( 'shf*' ) |
---|
[667] | 543 | DO i = nxlg, nxrg |
---|
| 544 | DO j = nysg, nyng |
---|
[402] | 545 | shf_av(j,i) = shf_av(j,i) + shf(j,i) |
---|
| 546 | ENDDO |
---|
| 547 | ENDDO |
---|
| 548 | |
---|
[1] | 549 | CASE ( 't*' ) |
---|
[667] | 550 | DO i = nxlg, nxrg |
---|
| 551 | DO j = nysg, nyng |
---|
[1] | 552 | ts_av(j,i) = ts_av(j,i) + ts(j,i) |
---|
| 553 | ENDDO |
---|
| 554 | ENDDO |
---|
| 555 | |
---|
| 556 | CASE ( 'u' ) |
---|
[667] | 557 | DO i = nxlg, nxrg |
---|
| 558 | DO j = nysg, nyng |
---|
[1] | 559 | DO k = nzb, nzt+1 |
---|
| 560 | u_av(k,j,i) = u_av(k,j,i) + u(k,j,i) |
---|
| 561 | ENDDO |
---|
| 562 | ENDDO |
---|
| 563 | ENDDO |
---|
| 564 | |
---|
| 565 | CASE ( 'u*' ) |
---|
[667] | 566 | DO i = nxlg, nxrg |
---|
| 567 | DO j = nysg, nyng |
---|
[1] | 568 | us_av(j,i) = us_av(j,i) + us(j,i) |
---|
| 569 | ENDDO |
---|
| 570 | ENDDO |
---|
| 571 | |
---|
| 572 | CASE ( 'v' ) |
---|
[667] | 573 | DO i = nxlg, nxrg |
---|
| 574 | DO j = nysg, nyng |
---|
[1] | 575 | DO k = nzb, nzt+1 |
---|
| 576 | v_av(k,j,i) = v_av(k,j,i) + v(k,j,i) |
---|
| 577 | ENDDO |
---|
| 578 | ENDDO |
---|
| 579 | ENDDO |
---|
| 580 | |
---|
| 581 | CASE ( 'vpt' ) |
---|
[667] | 582 | DO i = nxlg, nxrg |
---|
| 583 | DO j = nysg, nyng |
---|
[1] | 584 | DO k = nzb, nzt+1 |
---|
| 585 | vpt_av(k,j,i) = vpt_av(k,j,i) + vpt(k,j,i) |
---|
| 586 | ENDDO |
---|
| 587 | ENDDO |
---|
| 588 | ENDDO |
---|
| 589 | |
---|
| 590 | CASE ( 'w' ) |
---|
[667] | 591 | DO i = nxlg, nxrg |
---|
| 592 | DO j = nysg, nyng |
---|
[1] | 593 | DO k = nzb, nzt+1 |
---|
| 594 | w_av(k,j,i) = w_av(k,j,i) + w(k,j,i) |
---|
| 595 | ENDDO |
---|
| 596 | ENDDO |
---|
| 597 | ENDDO |
---|
| 598 | |
---|
[72] | 599 | CASE ( 'z0*' ) |
---|
[667] | 600 | DO i = nxlg, nxrg |
---|
| 601 | DO j = nysg, nyng |
---|
[72] | 602 | z0_av(j,i) = z0_av(j,i) + z0(j,i) |
---|
| 603 | ENDDO |
---|
| 604 | ENDDO |
---|
| 605 | |
---|
[978] | 606 | CASE ( 'z0h*' ) |
---|
| 607 | DO i = nxlg, nxrg |
---|
| 608 | DO j = nysg, nyng |
---|
| 609 | z0h_av(j,i) = z0h_av(j,i) + z0h(j,i) |
---|
| 610 | ENDDO |
---|
| 611 | ENDDO |
---|
| 612 | |
---|
[1] | 613 | CASE DEFAULT |
---|
| 614 | ! |
---|
| 615 | !-- User-defined quantity |
---|
| 616 | CALL user_3d_data_averaging( 'sum', doav(ii) ) |
---|
| 617 | |
---|
| 618 | END SELECT |
---|
| 619 | |
---|
| 620 | ENDDO |
---|
| 621 | |
---|
[1318] | 622 | CALL cpu_log( log_point(34), 'sum_up_3d_data', 'stop' ) |
---|
[1] | 623 | |
---|
| 624 | |
---|
| 625 | END SUBROUTINE sum_up_3d_data |
---|