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