[1682] | 1 | !> @file average_3d_data.f90 |
---|
[4509] | 2 | !--------------------------------------------------------------------------------------------------! |
---|
[2696] | 3 | ! This file is part of the PALM model system. |
---|
[1036] | 4 | ! |
---|
[4509] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General |
---|
| 6 | ! Public License as published by the Free Software Foundation, either version 3 of the License, or |
---|
| 7 | ! (at your option) any later version. |
---|
[1036] | 8 | ! |
---|
[4509] | 9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
---|
| 10 | ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
| 11 | ! Public License for more details. |
---|
[1036] | 12 | ! |
---|
[4509] | 13 | ! You should have received a copy of the GNU General Public License along with PALM. If not, see |
---|
| 14 | ! <http://www.gnu.org/licenses/>. |
---|
[1036] | 15 | ! |
---|
[4360] | 16 | ! Copyright 1997-2020 Leibniz Universitaet Hannover |
---|
[4509] | 17 | !--------------------------------------------------------------------------------------------------! |
---|
[1036] | 18 | ! |
---|
[484] | 19 | ! Current revisions: |
---|
[1] | 20 | ! ----------------- |
---|
[3589] | 21 | ! |
---|
| 22 | ! |
---|
| 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: average_3d_data.f90 4558 2020-06-10 16:27:30Z resler $ |
---|
[4558] | 26 | ! bugfix: average_count_3d is set to integer 0 |
---|
| 27 | ! |
---|
| 28 | ! 4514 2020-04-30 16:29:59Z suehring |
---|
[4514] | 29 | ! Enable output of qsurf and ssurf |
---|
| 30 | ! |
---|
| 31 | ! 4509 2020-04-26 15:57:55Z raasch |
---|
[4509] | 32 | ! file re-formatted to follow the PALM coding standard |
---|
| 33 | ! |
---|
| 34 | ! 4457 2020-03-11 14:20:43Z raasch |
---|
[4457] | 35 | ! use statement for exchange horiz added, |
---|
| 36 | ! bugfix for call of exchange horiz 2d |
---|
| 37 | ! |
---|
| 38 | ! 4360 2020-01-07 11:25:50Z suehring |
---|
[4331] | 39 | ! Move 2-m potential temperature output to diagnostic_output_quantities |
---|
| 40 | ! |
---|
| 41 | ! 4182 2019-08-22 15:20:23Z scharf |
---|
[4182] | 42 | ! Corrected "Former revisions" section |
---|
| 43 | ! |
---|
| 44 | ! 4048 2019-06-21 21:00:21Z knoop |
---|
[4048] | 45 | ! Moved tcm_3d_data_averaging to module_interface |
---|
| 46 | ! |
---|
| 47 | ! 4039 2019-06-18 10:32:41Z suehring |
---|
[4039] | 48 | ! Modularize diagnostic output |
---|
| 49 | ! |
---|
| 50 | ! 3994 2019-05-22 18:08:09Z suehring |
---|
[3994] | 51 | ! output of turbulence intensity added |
---|
| 52 | ! |
---|
| 53 | ! 3933 2019-04-25 12:33:20Z kanani |
---|
[3933] | 54 | ! Bugfix in CASE theta_2m*, removal of redundant code |
---|
| 55 | ! |
---|
| 56 | ! 3773 2019-03-01 08:56:57Z maronga |
---|
[3773] | 57 | ! Added output of theta_2m*_xy_av |
---|
| 58 | ! |
---|
| 59 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
[3637] | 60 | ! Implementation of the PALM module interface |
---|
[3582] | 61 | ! |
---|
[4182] | 62 | ! Revision 1.1 2006/02/23 09:48:58 raasch |
---|
| 63 | ! Initial revision |
---|
| 64 | ! |
---|
| 65 | ! |
---|
[1] | 66 | ! Description: |
---|
| 67 | ! ------------ |
---|
[1682] | 68 | !> Time-averaging of 3d-data-arrays. |
---|
[4509] | 69 | !--------------------------------------------------------------------------------------------------! |
---|
[1682] | 70 | SUBROUTINE average_3d_data |
---|
| 71 | |
---|
[1] | 72 | |
---|
| 73 | USE averaging |
---|
| 74 | |
---|
[4509] | 75 | USE control_parameters, & |
---|
[3637] | 76 | ONLY: average_count_3d, doav, doav_n, varnamelength |
---|
[1320] | 77 | |
---|
[4509] | 78 | USE cpulog, & |
---|
[1320] | 79 | ONLY: cpu_log, log_point |
---|
| 80 | |
---|
[4509] | 81 | USE exchange_horiz_mod, & |
---|
[4457] | 82 | ONLY: exchange_horiz_2d |
---|
| 83 | |
---|
[4509] | 84 | USE indices, & |
---|
[4457] | 85 | ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
[1320] | 86 | |
---|
| 87 | USE kinds |
---|
| 88 | |
---|
[4509] | 89 | USE module_interface, & |
---|
[3637] | 90 | ONLY: module_interface_3d_data_averaging |
---|
[1320] | 91 | |
---|
[2696] | 92 | |
---|
[1691] | 93 | |
---|
[2007] | 94 | |
---|
[1] | 95 | IMPLICIT NONE |
---|
| 96 | |
---|
[3294] | 97 | INTEGER(iwp) :: i !< loop index |
---|
| 98 | INTEGER(iwp) :: ii !< loop index |
---|
| 99 | INTEGER(iwp) :: j !< loop index |
---|
| 100 | INTEGER(iwp) :: k !< loop index |
---|
[1] | 101 | |
---|
[2011] | 102 | CHARACTER (LEN=varnamelength) :: trimvar !< TRIM of output-variable string |
---|
[1] | 103 | |
---|
[2007] | 104 | |
---|
[1] | 105 | CALL cpu_log (log_point(35),'average_3d_data','start') |
---|
| 106 | |
---|
| 107 | ! |
---|
| 108 | !-- Check, if averaging is necessary |
---|
| 109 | IF ( average_count_3d <= 1 ) RETURN |
---|
| 110 | |
---|
| 111 | ! |
---|
| 112 | !-- Loop of all variables to be averaged. |
---|
| 113 | DO ii = 1, doav_n |
---|
| 114 | |
---|
[2007] | 115 | trimvar = TRIM( doav(ii) ) |
---|
| 116 | |
---|
| 117 | ! |
---|
[1] | 118 | !-- Store the array chosen on the temporary array. |
---|
[2007] | 119 | SELECT CASE ( trimvar ) |
---|
[1] | 120 | |
---|
| 121 | CASE ( 'e' ) |
---|
[4509] | 122 | IF ( ALLOCATED( e_av ) ) THEN |
---|
[3004] | 123 | DO i = nxlg, nxrg |
---|
| 124 | DO j = nysg, nyng |
---|
| 125 | DO k = nzb, nzt+1 |
---|
| 126 | e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 127 | ENDDO |
---|
[1] | 128 | ENDDO |
---|
| 129 | ENDDO |
---|
[3004] | 130 | ENDIF |
---|
[1] | 131 | |
---|
[2797] | 132 | CASE ( 'ghf*' ) |
---|
[4509] | 133 | IF ( ALLOCATED( ghf_av ) ) THEN |
---|
[3004] | 134 | DO i = nxl, nxr |
---|
| 135 | DO j = nys, nyn |
---|
[4509] | 136 | ghf_av(j,i) = ghf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[3004] | 137 | ENDDO |
---|
[2797] | 138 | ENDDO |
---|
[4457] | 139 | CALL exchange_horiz_2d( ghf_av ) |
---|
[3004] | 140 | ENDIF |
---|
[2797] | 141 | |
---|
[354] | 142 | CASE ( 'qsws*' ) |
---|
[4509] | 143 | IF ( ALLOCATED( qsws_av ) ) THEN |
---|
[3004] | 144 | DO i = nxlg, nxrg |
---|
| 145 | DO j = nysg, nyng |
---|
| 146 | qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 147 | ENDDO |
---|
[354] | 148 | ENDDO |
---|
[4457] | 149 | CALL exchange_horiz_2d( qsws_av ) |
---|
[3004] | 150 | ENDIF |
---|
[354] | 151 | |
---|
[3421] | 152 | CASE ( 'thetal' ) |
---|
[4509] | 153 | IF ( ALLOCATED( lpt_av ) ) THEN |
---|
[3004] | 154 | DO i = nxlg, nxrg |
---|
| 155 | DO j = nysg, nyng |
---|
| 156 | DO k = nzb, nzt+1 |
---|
| 157 | lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 158 | ENDDO |
---|
[771] | 159 | ENDDO |
---|
| 160 | ENDDO |
---|
[3004] | 161 | ENDIF |
---|
[771] | 162 | |
---|
[1] | 163 | CASE ( 'lwp*' ) |
---|
[4509] | 164 | IF ( ALLOCATED( lwp_av ) ) THEN |
---|
[3004] | 165 | DO i = nxlg, nxrg |
---|
| 166 | DO j = nysg, nyng |
---|
| 167 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 168 | ENDDO |
---|
[1] | 169 | ENDDO |
---|
[3004] | 170 | ENDIF |
---|
[1] | 171 | |
---|
[1691] | 172 | CASE ( 'ol*' ) |
---|
[4509] | 173 | IF ( ALLOCATED( ol_av ) ) THEN |
---|
[3004] | 174 | DO i = nxlg, nxrg |
---|
| 175 | DO j = nysg, nyng |
---|
| 176 | ol_av(j,i) = ol_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 177 | ENDDO |
---|
[1691] | 178 | ENDDO |
---|
[4457] | 179 | CALL exchange_horiz_2d( ol_av ) |
---|
[3004] | 180 | ENDIF |
---|
[1691] | 181 | |
---|
[1] | 182 | CASE ( 'p' ) |
---|
[4509] | 183 | IF ( ALLOCATED( p_av ) ) THEN |
---|
[3004] | 184 | DO i = nxlg, nxrg |
---|
| 185 | DO j = nysg, nyng |
---|
| 186 | DO k = nzb, nzt+1 |
---|
| 187 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 188 | ENDDO |
---|
[1] | 189 | ENDDO |
---|
| 190 | ENDDO |
---|
[3004] | 191 | ENDIF |
---|
[1] | 192 | |
---|
| 193 | CASE ( 'pc' ) |
---|
[4509] | 194 | IF ( ALLOCATED( pc_av ) ) THEN |
---|
[3004] | 195 | DO i = nxl, nxr |
---|
| 196 | DO j = nys, nyn |
---|
| 197 | DO k = nzb, nzt+1 |
---|
| 198 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 199 | ENDDO |
---|
[1] | 200 | ENDDO |
---|
| 201 | ENDDO |
---|
[3004] | 202 | ENDIF |
---|
[1] | 203 | |
---|
| 204 | CASE ( 'pr' ) |
---|
[4509] | 205 | IF ( ALLOCATED( pr_av ) ) THEN |
---|
[3004] | 206 | DO i = nxl, nxr |
---|
| 207 | DO j = nys, nyn |
---|
| 208 | DO k = nzb, nzt+1 |
---|
| 209 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 210 | ENDDO |
---|
[1] | 211 | ENDDO |
---|
| 212 | ENDDO |
---|
[3004] | 213 | ENDIF |
---|
[1] | 214 | |
---|
[3421] | 215 | CASE ( 'theta' ) |
---|
[4509] | 216 | IF ( ALLOCATED( pt_av ) ) THEN |
---|
[3004] | 217 | DO i = nxlg, nxrg |
---|
| 218 | DO j = nysg, nyng |
---|
| 219 | DO k = nzb, nzt+1 |
---|
| 220 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 221 | ENDDO |
---|
[1] | 222 | ENDDO |
---|
| 223 | ENDDO |
---|
[3004] | 224 | ENDIF |
---|
[1] | 225 | |
---|
| 226 | CASE ( 'q' ) |
---|
[4509] | 227 | IF ( ALLOCATED( q_av ) ) THEN |
---|
[3004] | 228 | DO i = nxlg, nxrg |
---|
| 229 | DO j = nysg, nyng |
---|
| 230 | DO k = nzb, nzt+1 |
---|
| 231 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 232 | ENDDO |
---|
[1] | 233 | ENDDO |
---|
| 234 | ENDDO |
---|
[3004] | 235 | ENDIF |
---|
[367] | 236 | |
---|
[1] | 237 | CASE ( 'ql' ) |
---|
[4509] | 238 | IF ( ALLOCATED( ql_av ) ) THEN |
---|
[3004] | 239 | DO i = nxlg, nxrg |
---|
| 240 | DO j = nysg, nyng |
---|
| 241 | DO k = nzb, nzt+1 |
---|
| 242 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 243 | ENDDO |
---|
[1] | 244 | ENDDO |
---|
| 245 | ENDDO |
---|
[3004] | 246 | ENDIF |
---|
[1] | 247 | |
---|
| 248 | CASE ( 'ql_c' ) |
---|
[4509] | 249 | IF ( ALLOCATED( ql_c_av ) ) THEN |
---|
[3004] | 250 | DO i = nxlg, nxrg |
---|
| 251 | DO j = nysg, nyng |
---|
| 252 | DO k = nzb, nzt+1 |
---|
| 253 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 254 | ENDDO |
---|
[1] | 255 | ENDDO |
---|
| 256 | ENDDO |
---|
[3004] | 257 | ENDIF |
---|
[1] | 258 | |
---|
| 259 | CASE ( 'ql_v' ) |
---|
[4509] | 260 | IF ( ALLOCATED( ql_v_av ) ) THEN |
---|
[3004] | 261 | DO i = nxlg, nxrg |
---|
| 262 | DO j = nysg, nyng |
---|
| 263 | DO k = nzb, nzt+1 |
---|
| 264 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 265 | ENDDO |
---|
[1] | 266 | ENDDO |
---|
| 267 | ENDDO |
---|
[3004] | 268 | ENDIF |
---|
[1] | 269 | |
---|
| 270 | CASE ( 'ql_vp' ) |
---|
[4509] | 271 | IF ( ALLOCATED( ql_vp_av ) ) THEN |
---|
[3004] | 272 | DO i = nxlg, nxrg |
---|
| 273 | DO j = nysg, nyng |
---|
| 274 | DO k = nzb, nzt+1 |
---|
[4509] | 275 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
[3004] | 276 | ENDDO |
---|
[1] | 277 | ENDDO |
---|
| 278 | ENDDO |
---|
[3004] | 279 | ENDIF |
---|
[1] | 280 | |
---|
| 281 | CASE ( 'qv' ) |
---|
[4509] | 282 | IF ( ALLOCATED( qv_av ) ) THEN |
---|
[3004] | 283 | DO i = nxlg, nxrg |
---|
| 284 | DO j = nysg, nyng |
---|
| 285 | DO k = nzb, nzt+1 |
---|
| 286 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 287 | ENDDO |
---|
[1] | 288 | ENDDO |
---|
| 289 | ENDDO |
---|
[3004] | 290 | ENDIF |
---|
[367] | 291 | |
---|
[4514] | 292 | CASE ( 'qsurf*' ) |
---|
| 293 | IF ( ALLOCATED( qsurf_av ) ) THEN |
---|
| 294 | DO i = nxlg, nxrg |
---|
| 295 | DO j = nysg, nyng |
---|
| 296 | qsurf_av(j,i) = qsurf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 297 | ENDDO |
---|
| 298 | ENDDO |
---|
| 299 | CALL exchange_horiz_2d( qsurf_av ) |
---|
| 300 | ENDIF |
---|
| 301 | |
---|
[2735] | 302 | CASE ( 'r_a*' ) |
---|
[4509] | 303 | IF ( ALLOCATED( r_a_av ) ) THEN |
---|
[3004] | 304 | DO i = nxlg, nxrg |
---|
| 305 | DO j = nysg, nyng |
---|
| 306 | r_a_av(j,i) = r_a_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 307 | ENDDO |
---|
[2735] | 308 | ENDDO |
---|
[4457] | 309 | CALL exchange_horiz_2d( r_a_av ) |
---|
[3004] | 310 | ENDIF |
---|
[2735] | 311 | |
---|
[1] | 312 | CASE ( 's' ) |
---|
[4509] | 313 | IF ( ALLOCATED( s_av ) ) THEN |
---|
[3004] | 314 | DO i = nxlg, nxrg |
---|
| 315 | DO j = nysg, nyng |
---|
| 316 | DO k = nzb, nzt+1 |
---|
| 317 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 318 | ENDDO |
---|
[1] | 319 | ENDDO |
---|
| 320 | ENDDO |
---|
[3004] | 321 | ENDIF |
---|
[367] | 322 | |
---|
[354] | 323 | CASE ( 'shf*' ) |
---|
[4509] | 324 | IF ( ALLOCATED( shf_av ) ) THEN |
---|
[3004] | 325 | DO i = nxlg, nxrg |
---|
| 326 | DO j = nysg, nyng |
---|
| 327 | shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 328 | ENDDO |
---|
[354] | 329 | ENDDO |
---|
[4457] | 330 | CALL exchange_horiz_2d( shf_av ) |
---|
[3004] | 331 | ENDIF |
---|
[367] | 332 | |
---|
[4514] | 333 | CASE ( 'ssurf*' ) |
---|
| 334 | IF ( ALLOCATED( ssurf_av ) ) THEN |
---|
| 335 | DO i = nxlg, nxrg |
---|
| 336 | DO j = nysg, nyng |
---|
| 337 | ssurf_av(j,i) = ssurf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 338 | ENDDO |
---|
| 339 | ENDDO |
---|
| 340 | CALL exchange_horiz_2d( ssurf_av ) |
---|
| 341 | ENDIF |
---|
| 342 | |
---|
[1960] | 343 | CASE ( 'ssws*' ) |
---|
[4509] | 344 | IF ( ALLOCATED( ssws_av ) ) THEN |
---|
[3004] | 345 | DO i = nxlg, nxrg |
---|
| 346 | DO j = nysg, nyng |
---|
| 347 | ssws_av(j,i) = ssws_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 348 | ENDDO |
---|
[1960] | 349 | ENDDO |
---|
[4457] | 350 | CALL exchange_horiz_2d( ssws_av ) |
---|
[3004] | 351 | ENDIF |
---|
[1960] | 352 | |
---|
[1] | 353 | CASE ( 't*' ) |
---|
[4509] | 354 | IF ( ALLOCATED( ts_av ) ) THEN |
---|
[3004] | 355 | DO i = nxlg, nxrg |
---|
| 356 | DO j = nysg, nyng |
---|
| 357 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 358 | ENDDO |
---|
[1] | 359 | ENDDO |
---|
[4457] | 360 | CALL exchange_horiz_2d( ts_av ) |
---|
[3004] | 361 | ENDIF |
---|
[1] | 362 | |
---|
[2742] | 363 | CASE ( 'tsurf*' ) |
---|
[4509] | 364 | IF ( ALLOCATED( tsurf_av ) ) THEN |
---|
[3004] | 365 | DO i = nxlg, nxrg |
---|
| 366 | DO j = nysg, nyng |
---|
| 367 | tsurf_av(j,i) = tsurf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 368 | ENDDO |
---|
[2742] | 369 | ENDDO |
---|
[4457] | 370 | CALL exchange_horiz_2d( tsurf_av ) |
---|
[3004] | 371 | ENDIF |
---|
[2742] | 372 | |
---|
[1] | 373 | CASE ( 'u' ) |
---|
[4509] | 374 | IF ( ALLOCATED( u_av ) ) THEN |
---|
[3004] | 375 | DO i = nxlg, nxrg |
---|
| 376 | DO j = nysg, nyng |
---|
| 377 | DO k = nzb, nzt+1 |
---|
| 378 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 379 | ENDDO |
---|
[1] | 380 | ENDDO |
---|
| 381 | ENDDO |
---|
[3004] | 382 | ENDIF |
---|
[1] | 383 | |
---|
[3421] | 384 | CASE ( 'us*' ) |
---|
[4509] | 385 | IF ( ALLOCATED( us_av ) ) THEN |
---|
[3004] | 386 | DO i = nxlg, nxrg |
---|
| 387 | DO j = nysg, nyng |
---|
| 388 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 389 | ENDDO |
---|
[1] | 390 | ENDDO |
---|
[4457] | 391 | CALL exchange_horiz_2d( us_av ) |
---|
[3004] | 392 | ENDIF |
---|
[1] | 393 | |
---|
| 394 | CASE ( 'v' ) |
---|
[4509] | 395 | IF ( ALLOCATED( v_av ) ) THEN |
---|
[3004] | 396 | DO i = nxlg, nxrg |
---|
| 397 | DO j = nysg, nyng |
---|
| 398 | DO k = nzb, nzt+1 |
---|
| 399 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 400 | ENDDO |
---|
[1] | 401 | ENDDO |
---|
| 402 | ENDDO |
---|
[3004] | 403 | ENDIF |
---|
[1] | 404 | |
---|
[3421] | 405 | CASE ( 'thetav' ) |
---|
[4509] | 406 | IF ( ALLOCATED( vpt_av ) ) THEN |
---|
[3004] | 407 | DO i = nxlg, nxrg |
---|
| 408 | DO j = nysg, nyng |
---|
| 409 | DO k = nzb, nzt+1 |
---|
| 410 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 411 | ENDDO |
---|
[1] | 412 | ENDDO |
---|
| 413 | ENDDO |
---|
[3004] | 414 | ENDIF |
---|
[1] | 415 | |
---|
| 416 | CASE ( 'w' ) |
---|
[4509] | 417 | IF ( ALLOCATED( w_av ) ) THEN |
---|
[3004] | 418 | DO i = nxlg, nxrg |
---|
| 419 | DO j = nysg, nyng |
---|
| 420 | DO k = nzb, nzt+1 |
---|
| 421 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 422 | ENDDO |
---|
[1] | 423 | ENDDO |
---|
| 424 | ENDDO |
---|
[3004] | 425 | ENDIF |
---|
[1] | 426 | |
---|
[72] | 427 | CASE ( 'z0*' ) |
---|
[4509] | 428 | IF ( ALLOCATED( z0_av ) ) THEN |
---|
[3004] | 429 | DO i = nxlg, nxrg |
---|
| 430 | DO j = nysg, nyng |
---|
| 431 | z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 432 | ENDDO |
---|
[72] | 433 | ENDDO |
---|
[4457] | 434 | CALL exchange_horiz_2d( z0_av ) |
---|
[3004] | 435 | ENDIF |
---|
[72] | 436 | |
---|
[978] | 437 | CASE ( 'z0h*' ) |
---|
[4509] | 438 | IF ( ALLOCATED( z0h_av ) ) THEN |
---|
[3004] | 439 | DO i = nxlg, nxrg |
---|
| 440 | DO j = nysg, nyng |
---|
| 441 | z0h_av(j,i) = z0h_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 442 | ENDDO |
---|
[978] | 443 | ENDDO |
---|
[4457] | 444 | CALL exchange_horiz_2d( z0h_av ) |
---|
[3004] | 445 | ENDIF |
---|
| 446 | |
---|
| 447 | CASE ( 'z0q*' ) |
---|
[4509] | 448 | IF ( ALLOCATED( z0q_av ) ) THEN |
---|
[3004] | 449 | DO i = nxlg, nxrg |
---|
| 450 | DO j = nysg, nyng |
---|
| 451 | z0q_av(j,i) = z0q_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 452 | ENDDO |
---|
| 453 | ENDDO |
---|
[4457] | 454 | CALL exchange_horiz_2d( z0q_av ) |
---|
[3004] | 455 | ENDIF |
---|
| 456 | |
---|
[1] | 457 | CASE DEFAULT |
---|
[1976] | 458 | ! |
---|
[3637] | 459 | !-- Averaging of data from all other modules |
---|
| 460 | CALL module_interface_3d_data_averaging( 'average', trimvar ) |
---|
[1] | 461 | |
---|
| 462 | END SELECT |
---|
| 463 | |
---|
| 464 | ENDDO |
---|
| 465 | |
---|
| 466 | ! |
---|
| 467 | !-- Reset the counter |
---|
[4558] | 468 | average_count_3d = 0_iwp |
---|
[1] | 469 | |
---|
[1318] | 470 | CALL cpu_log( log_point(35), 'average_3d_data', 'stop' ) |
---|
[1] | 471 | |
---|
| 472 | |
---|
| 473 | END SUBROUTINE average_3d_data |
---|