[1682] | 1 | !> @file average_3d_data.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[2696] | 3 | ! This file is part of the PALM model system. |
---|
[1036] | 4 | ! |
---|
[2000] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
| 6 | ! terms of the GNU General Public License as published by the Free Software |
---|
| 7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
| 8 | ! version. |
---|
[1036] | 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 | ! |
---|
[2718] | 17 | ! Copyright 1997-2018 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1552] | 22 | ! |
---|
[2233] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: average_3d_data.f90 3467 2018-10-30 19:05:21Z suehring $ |
---|
[3467] | 27 | ! Implementation of a new aerosol module salsa. |
---|
| 28 | ! |
---|
| 29 | ! 3448 2018-10-29 18:14:31Z kanani |
---|
[3448] | 30 | ! Adjustment of biometeorology calls |
---|
| 31 | ! |
---|
| 32 | ! 3421 2018-10-24 18:39:32Z gronemeier |
---|
[3421] | 33 | ! Renamed output variables |
---|
| 34 | ! |
---|
| 35 | ! 3419 2018-10-24 17:27:31Z gronemeier |
---|
[3337] | 36 | ! (from resler branch) |
---|
| 37 | ! Add biometeorology output, |
---|
| 38 | ! fix for chemistry output, |
---|
| 39 | ! move of urban surface output |
---|
| 40 | ! |
---|
| 41 | ! 3294 2018-10-01 02:37:10Z raasch |
---|
[3294] | 42 | ! changes concerning modularization of ocean option |
---|
| 43 | ! |
---|
| 44 | ! 3274 2018-09-24 15:42:55Z knoop |
---|
[3274] | 45 | ! Modularization of all bulk cloud physics code components |
---|
| 46 | ! |
---|
| 47 | ! 3004 2018-04-27 12:33:25Z Giersch |
---|
[3004] | 48 | ! Further allocation checks implemented, case z0q* added |
---|
| 49 | ! |
---|
| 50 | ! 2885 2018-03-14 11:02:46Z Giersch |
---|
[2817] | 51 | ! Preliminary gust module interface implemented |
---|
| 52 | ! |
---|
| 53 | ! 2797 2018-02-08 13:24:35Z suehring |
---|
[2797] | 54 | ! Enable output of ground-heat flux also at urban surfaces. |
---|
| 55 | ! |
---|
| 56 | ! 2766 2018-01-22 17:17:47Z kanani |
---|
[2766] | 57 | ! Removed preprocessor directive __chem |
---|
| 58 | ! |
---|
| 59 | ! 2742 2018-01-12 14:59:47Z suehring |
---|
[2742] | 60 | ! Enable output of surface temperature |
---|
| 61 | ! |
---|
| 62 | ! 2735 2018-01-11 12:01:27Z suehring |
---|
[2735] | 63 | ! output of r_a moved from land-surface to consider also urban-type surfaces |
---|
| 64 | ! |
---|
| 65 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
[2716] | 66 | ! Corrected "Former revisions" section |
---|
| 67 | ! |
---|
| 68 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
| 69 | ! Change in file header (GPL part) |
---|
[2696] | 70 | ! Implement call for turbulence_closure_mod (TG) |
---|
| 71 | ! Implementation of chemistry module (FK) |
---|
| 72 | ! |
---|
| 73 | ! 2292 2017-06-20 09:51:42Z schwenkel |
---|
[2292] | 74 | ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' |
---|
| 75 | ! includes two more prognostic equations for cloud drop concentration (nc) |
---|
[3467] | 76 | ! and cloud water content (qc). |
---|
[2292] | 77 | ! |
---|
| 78 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
[1321] | 79 | ! |
---|
[2233] | 80 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
| 81 | ! Adjustments to new surface concept - additional ghost point exchange |
---|
| 82 | ! of surface variable required |
---|
| 83 | ! |
---|
[2032] | 84 | ! 2031 2016-10-21 15:11:58Z knoop |
---|
| 85 | ! renamed variable rho to rho_ocean and rho_av to rho_ocean_av |
---|
| 86 | ! |
---|
[2012] | 87 | ! 2011 2016-09-19 17:29:57Z kanani |
---|
| 88 | ! Flag urban_surface is now defined in module control_parameters, |
---|
| 89 | ! changed prefix for urban surface model output to "usm_", |
---|
| 90 | ! introduced control parameter varnamelength for LEN of trimvar. |
---|
| 91 | ! |
---|
[2008] | 92 | ! 2007 2016-08-24 15:47:17Z kanani |
---|
| 93 | ! Added support for new urban surface model (temporary modifications of |
---|
| 94 | ! SELECT CASE ( ) necessary, see variable trimvar), |
---|
| 95 | ! added comments in variable declaration section |
---|
| 96 | ! |
---|
[2001] | 97 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 98 | ! Forced header and separation lines into 80 columns |
---|
| 99 | ! |
---|
[1973] | 100 | ! 1972 2016-07-26 07:52:02Z maronga |
---|
| 101 | ! Output of land surface quantities is now done directly in the respective module |
---|
| 102 | ! |
---|
[1961] | 103 | ! 1960 2016-07-12 16:34:24Z suehring |
---|
| 104 | ! Treat humidity and passive scalar separately |
---|
| 105 | ! |
---|
[1692] | 106 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
| 107 | ! Added output of Obukhov length and radiative heating rates for RRTMG. |
---|
| 108 | ! |
---|
[1683] | 109 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 110 | ! Code annotations made doxygen readable |
---|
| 111 | ! |
---|
[1586] | 112 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
| 113 | ! Adapted for RRTMG |
---|
| 114 | ! |
---|
[1556] | 115 | ! 1555 2015-03-04 17:44:27Z maronga |
---|
| 116 | ! Added output of r_a and r_s |
---|
| 117 | ! |
---|
[1552] | 118 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
| 119 | ! Added support for land surface and radiation model parameters. |
---|
| 120 | ! |
---|
[1323] | 121 | ! 1322 2014-03-20 16:38:49Z raasch |
---|
| 122 | ! REAL functions provided with KIND-attribute |
---|
| 123 | ! |
---|
[1321] | 124 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 125 | ! ONLY-attribute added to USE-statements, |
---|
| 126 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 127 | ! kinds are defined in new module kinds, |
---|
| 128 | ! revision history before 2012 removed, |
---|
| 129 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 130 | ! all variable declaration statements |
---|
[772] | 131 | ! |
---|
[1319] | 132 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
| 133 | ! barrier argument removed from cpu_log, |
---|
| 134 | ! module interfaces removed |
---|
| 135 | ! |
---|
[1116] | 136 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 137 | ! +qc |
---|
| 138 | ! |
---|
[1054] | 139 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 140 | ! averaging of nr, qr added |
---|
| 141 | ! |
---|
[1037] | 142 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 143 | ! code put under GPL (PALM 3.9) |
---|
| 144 | ! |
---|
[979] | 145 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 146 | ! +z0h_av |
---|
[77] | 147 | ! |
---|
[1] | 148 | ! Revision 1.1 2006/02/23 09:48:58 raasch |
---|
| 149 | ! Initial revision |
---|
| 150 | ! |
---|
| 151 | ! |
---|
| 152 | ! Description: |
---|
| 153 | ! ------------ |
---|
[1682] | 154 | !> Time-averaging of 3d-data-arrays. |
---|
[1] | 155 | !------------------------------------------------------------------------------! |
---|
[1682] | 156 | SUBROUTINE average_3d_data |
---|
| 157 | |
---|
[1] | 158 | |
---|
| 159 | USE averaging |
---|
| 160 | |
---|
[3448] | 161 | USE biometeorology_mod, & |
---|
| 162 | ONLY: biom_3d_data_averaging |
---|
| 163 | |
---|
[3274] | 164 | USE bulk_cloud_model_mod, & |
---|
| 165 | ONLY: bulk_cloud_model, bcm_3d_data_averaging |
---|
| 166 | |
---|
[2696] | 167 | USE chemistry_model_mod, & |
---|
| 168 | ONLY: chem_3d_data_averaging |
---|
| 169 | |
---|
[1320] | 170 | USE control_parameters, & |
---|
[3448] | 171 | ONLY: air_chemistry, average_count_3d, biometeorology, doav, doav_n, & |
---|
| 172 | land_surface, ocean_mode, urban_surface, varnamelength |
---|
[1320] | 173 | |
---|
| 174 | USE cpulog, & |
---|
| 175 | ONLY: cpu_log, log_point |
---|
| 176 | |
---|
[2817] | 177 | USE gust_mod, & |
---|
| 178 | ONLY: gust_3d_data_averaging, gust_module_enabled |
---|
| 179 | |
---|
[1320] | 180 | USE indices, & |
---|
[2232] | 181 | ONLY: nbgp, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
[1320] | 182 | |
---|
| 183 | USE kinds |
---|
| 184 | |
---|
[1551] | 185 | USE land_surface_model_mod, & |
---|
[2232] | 186 | ONLY: lsm_3d_data_averaging |
---|
[1320] | 187 | |
---|
[3294] | 188 | USE ocean_mod, & |
---|
| 189 | ONLY: ocean_3d_data_averaging |
---|
| 190 | |
---|
[1551] | 191 | USE radiation_model_mod, & |
---|
[1976] | 192 | ONLY: radiation, radiation_3d_data_averaging |
---|
[3467] | 193 | |
---|
| 194 | USE salsa_mod, & |
---|
| 195 | ONLY: salsa, salsa_3d_data_averaging |
---|
[1551] | 196 | |
---|
[2696] | 197 | USE turbulence_closure_mod, & |
---|
| 198 | ONLY: tcm_3d_data_averaging |
---|
| 199 | |
---|
[2007] | 200 | USE urban_surface_mod, & |
---|
[2011] | 201 | ONLY: usm_average_3d_data |
---|
[1691] | 202 | |
---|
[2007] | 203 | |
---|
[2696] | 204 | |
---|
| 205 | |
---|
[1] | 206 | IMPLICIT NONE |
---|
| 207 | |
---|
[3294] | 208 | INTEGER(iwp) :: i !< loop index |
---|
| 209 | INTEGER(iwp) :: ii !< loop index |
---|
| 210 | INTEGER(iwp) :: j !< loop index |
---|
| 211 | INTEGER(iwp) :: k !< loop index |
---|
[1] | 212 | |
---|
[2011] | 213 | CHARACTER (LEN=varnamelength) :: trimvar !< TRIM of output-variable string |
---|
[1] | 214 | |
---|
[2007] | 215 | |
---|
[1] | 216 | CALL cpu_log (log_point(35),'average_3d_data','start') |
---|
| 217 | |
---|
| 218 | ! |
---|
| 219 | !-- Check, if averaging is necessary |
---|
| 220 | IF ( average_count_3d <= 1 ) RETURN |
---|
| 221 | |
---|
| 222 | ! |
---|
| 223 | !-- Loop of all variables to be averaged. |
---|
| 224 | DO ii = 1, doav_n |
---|
| 225 | |
---|
[2007] | 226 | trimvar = TRIM( doav(ii) ) |
---|
| 227 | |
---|
| 228 | ! |
---|
[1] | 229 | !-- Store the array chosen on the temporary array. |
---|
[2007] | 230 | SELECT CASE ( trimvar ) |
---|
[1] | 231 | |
---|
| 232 | CASE ( 'e' ) |
---|
[3004] | 233 | IF ( ALLOCATED( e_av ) ) THEN |
---|
| 234 | DO i = nxlg, nxrg |
---|
| 235 | DO j = nysg, nyng |
---|
| 236 | DO k = nzb, nzt+1 |
---|
| 237 | e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 238 | ENDDO |
---|
[1] | 239 | ENDDO |
---|
| 240 | ENDDO |
---|
[3004] | 241 | ENDIF |
---|
[1] | 242 | |
---|
[2797] | 243 | CASE ( 'ghf*' ) |
---|
[3004] | 244 | IF ( ALLOCATED( ghf_av ) ) THEN |
---|
| 245 | DO i = nxl, nxr |
---|
| 246 | DO j = nys, nyn |
---|
| 247 | ghf_av(j,i) = ghf_av(j,i) & |
---|
| 248 | / REAL( average_count_3d, KIND=wp ) |
---|
| 249 | ENDDO |
---|
[2797] | 250 | ENDDO |
---|
[3004] | 251 | CALL exchange_horiz_2d( ghf_av, nbgp ) |
---|
| 252 | ENDIF |
---|
[2797] | 253 | |
---|
[354] | 254 | CASE ( 'qsws*' ) |
---|
[3004] | 255 | IF ( ALLOCATED( qsws_av ) ) THEN |
---|
| 256 | DO i = nxlg, nxrg |
---|
| 257 | DO j = nysg, nyng |
---|
| 258 | qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 259 | ENDDO |
---|
[354] | 260 | ENDDO |
---|
[3004] | 261 | CALL exchange_horiz_2d( qsws_av, nbgp ) |
---|
| 262 | ENDIF |
---|
[354] | 263 | |
---|
[3421] | 264 | CASE ( 'thetal' ) |
---|
[3004] | 265 | IF ( ALLOCATED( lpt_av ) ) THEN |
---|
| 266 | DO i = nxlg, nxrg |
---|
| 267 | DO j = nysg, nyng |
---|
| 268 | DO k = nzb, nzt+1 |
---|
| 269 | lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 270 | ENDDO |
---|
[771] | 271 | ENDDO |
---|
| 272 | ENDDO |
---|
[3004] | 273 | ENDIF |
---|
[771] | 274 | |
---|
[1] | 275 | CASE ( 'lwp*' ) |
---|
[3004] | 276 | IF ( ALLOCATED( lwp_av ) ) THEN |
---|
| 277 | DO i = nxlg, nxrg |
---|
| 278 | DO j = nysg, nyng |
---|
| 279 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 280 | ENDDO |
---|
[1] | 281 | ENDDO |
---|
[3004] | 282 | ENDIF |
---|
[1] | 283 | |
---|
[1691] | 284 | CASE ( 'ol*' ) |
---|
[3004] | 285 | IF ( ALLOCATED( ol_av ) ) THEN |
---|
| 286 | DO i = nxlg, nxrg |
---|
| 287 | DO j = nysg, nyng |
---|
| 288 | ol_av(j,i) = ol_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 289 | ENDDO |
---|
[1691] | 290 | ENDDO |
---|
[3004] | 291 | CALL exchange_horiz_2d( ol_av, nbgp ) |
---|
| 292 | ENDIF |
---|
[1691] | 293 | |
---|
[1] | 294 | CASE ( 'p' ) |
---|
[3004] | 295 | IF ( ALLOCATED( p_av ) ) THEN |
---|
| 296 | DO i = nxlg, nxrg |
---|
| 297 | DO j = nysg, nyng |
---|
| 298 | DO k = nzb, nzt+1 |
---|
| 299 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 300 | ENDDO |
---|
[1] | 301 | ENDDO |
---|
| 302 | ENDDO |
---|
[3004] | 303 | ENDIF |
---|
[1] | 304 | |
---|
| 305 | CASE ( 'pc' ) |
---|
[3004] | 306 | IF ( ALLOCATED( pc_av ) ) THEN |
---|
| 307 | DO i = nxl, nxr |
---|
| 308 | DO j = nys, nyn |
---|
| 309 | DO k = nzb, nzt+1 |
---|
| 310 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 311 | ENDDO |
---|
[1] | 312 | ENDDO |
---|
| 313 | ENDDO |
---|
[3004] | 314 | ENDIF |
---|
[1] | 315 | |
---|
| 316 | CASE ( 'pr' ) |
---|
[3004] | 317 | IF ( ALLOCATED( pr_av ) ) THEN |
---|
| 318 | DO i = nxl, nxr |
---|
| 319 | DO j = nys, nyn |
---|
| 320 | DO k = nzb, nzt+1 |
---|
| 321 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 322 | ENDDO |
---|
[1] | 323 | ENDDO |
---|
| 324 | ENDDO |
---|
[3004] | 325 | ENDIF |
---|
[1] | 326 | |
---|
[3421] | 327 | CASE ( 'theta' ) |
---|
[3004] | 328 | IF ( ALLOCATED( pt_av ) ) THEN |
---|
| 329 | DO i = nxlg, nxrg |
---|
| 330 | DO j = nysg, nyng |
---|
| 331 | DO k = nzb, nzt+1 |
---|
| 332 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 333 | ENDDO |
---|
[1] | 334 | ENDDO |
---|
| 335 | ENDDO |
---|
[3004] | 336 | ENDIF |
---|
[1] | 337 | |
---|
| 338 | CASE ( 'q' ) |
---|
[3004] | 339 | IF ( ALLOCATED( q_av ) ) THEN |
---|
| 340 | DO i = nxlg, nxrg |
---|
| 341 | DO j = nysg, nyng |
---|
| 342 | DO k = nzb, nzt+1 |
---|
| 343 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 344 | ENDDO |
---|
[1] | 345 | ENDDO |
---|
| 346 | ENDDO |
---|
[3004] | 347 | ENDIF |
---|
[367] | 348 | |
---|
[1] | 349 | CASE ( 'ql' ) |
---|
[3004] | 350 | IF ( ALLOCATED( ql_av ) ) THEN |
---|
| 351 | DO i = nxlg, nxrg |
---|
| 352 | DO j = nysg, nyng |
---|
| 353 | DO k = nzb, nzt+1 |
---|
| 354 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 355 | ENDDO |
---|
[1] | 356 | ENDDO |
---|
| 357 | ENDDO |
---|
[3004] | 358 | ENDIF |
---|
[1] | 359 | |
---|
| 360 | CASE ( 'ql_c' ) |
---|
[3004] | 361 | IF ( ALLOCATED( ql_c_av ) ) THEN |
---|
| 362 | DO i = nxlg, nxrg |
---|
| 363 | DO j = nysg, nyng |
---|
| 364 | DO k = nzb, nzt+1 |
---|
| 365 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 366 | ENDDO |
---|
[1] | 367 | ENDDO |
---|
| 368 | ENDDO |
---|
[3004] | 369 | ENDIF |
---|
[1] | 370 | |
---|
| 371 | CASE ( 'ql_v' ) |
---|
[3004] | 372 | IF ( ALLOCATED( ql_v_av ) ) THEN |
---|
| 373 | DO i = nxlg, nxrg |
---|
| 374 | DO j = nysg, nyng |
---|
| 375 | DO k = nzb, nzt+1 |
---|
| 376 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 377 | ENDDO |
---|
[1] | 378 | ENDDO |
---|
| 379 | ENDDO |
---|
[3004] | 380 | ENDIF |
---|
[1] | 381 | |
---|
| 382 | CASE ( 'ql_vp' ) |
---|
[3004] | 383 | IF ( ALLOCATED( ql_vp_av ) ) THEN |
---|
| 384 | DO i = nxlg, nxrg |
---|
| 385 | DO j = nysg, nyng |
---|
| 386 | DO k = nzb, nzt+1 |
---|
| 387 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & |
---|
| 388 | REAL( average_count_3d, KIND=wp ) |
---|
| 389 | ENDDO |
---|
[1] | 390 | ENDDO |
---|
| 391 | ENDDO |
---|
[3004] | 392 | ENDIF |
---|
[1] | 393 | |
---|
| 394 | CASE ( 'qv' ) |
---|
[3004] | 395 | IF ( ALLOCATED( qv_av ) ) THEN |
---|
| 396 | DO i = nxlg, nxrg |
---|
| 397 | DO j = nysg, nyng |
---|
| 398 | DO k = nzb, nzt+1 |
---|
| 399 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 400 | ENDDO |
---|
[1] | 401 | ENDDO |
---|
| 402 | ENDDO |
---|
[3004] | 403 | ENDIF |
---|
[367] | 404 | |
---|
[2735] | 405 | CASE ( 'r_a*' ) |
---|
[3004] | 406 | IF ( ALLOCATED( r_a_av ) ) THEN |
---|
| 407 | DO i = nxlg, nxrg |
---|
| 408 | DO j = nysg, nyng |
---|
| 409 | r_a_av(j,i) = r_a_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 410 | ENDDO |
---|
[2735] | 411 | ENDDO |
---|
[3004] | 412 | CALL exchange_horiz_2d( r_a_av, nbgp ) |
---|
| 413 | ENDIF |
---|
[2735] | 414 | |
---|
[1] | 415 | CASE ( 's' ) |
---|
[3004] | 416 | IF ( ALLOCATED( s_av ) ) THEN |
---|
| 417 | DO i = nxlg, nxrg |
---|
| 418 | DO j = nysg, nyng |
---|
| 419 | DO k = nzb, nzt+1 |
---|
| 420 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 421 | ENDDO |
---|
[1] | 422 | ENDDO |
---|
| 423 | ENDDO |
---|
[3004] | 424 | ENDIF |
---|
[367] | 425 | |
---|
[354] | 426 | CASE ( 'shf*' ) |
---|
[3004] | 427 | IF ( ALLOCATED( shf_av ) ) THEN |
---|
| 428 | DO i = nxlg, nxrg |
---|
| 429 | DO j = nysg, nyng |
---|
| 430 | shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 431 | ENDDO |
---|
[354] | 432 | ENDDO |
---|
[3004] | 433 | CALL exchange_horiz_2d( shf_av, nbgp ) |
---|
| 434 | ENDIF |
---|
[367] | 435 | |
---|
[1960] | 436 | CASE ( 'ssws*' ) |
---|
[3004] | 437 | IF ( ALLOCATED( ssws_av ) ) THEN |
---|
| 438 | DO i = nxlg, nxrg |
---|
| 439 | DO j = nysg, nyng |
---|
| 440 | ssws_av(j,i) = ssws_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 441 | ENDDO |
---|
[1960] | 442 | ENDDO |
---|
[3004] | 443 | CALL exchange_horiz_2d( ssws_av, nbgp ) |
---|
| 444 | ENDIF |
---|
[1960] | 445 | |
---|
[1] | 446 | CASE ( 't*' ) |
---|
[3004] | 447 | IF ( ALLOCATED( ts_av ) ) THEN |
---|
| 448 | DO i = nxlg, nxrg |
---|
| 449 | DO j = nysg, nyng |
---|
| 450 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 451 | ENDDO |
---|
[1] | 452 | ENDDO |
---|
[3004] | 453 | CALL exchange_horiz_2d( ts_av, nbgp ) |
---|
| 454 | ENDIF |
---|
[1] | 455 | |
---|
[2742] | 456 | CASE ( 'tsurf*' ) |
---|
[3004] | 457 | IF ( ALLOCATED( tsurf_av ) ) THEN |
---|
| 458 | DO i = nxlg, nxrg |
---|
| 459 | DO j = nysg, nyng |
---|
| 460 | tsurf_av(j,i) = tsurf_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 461 | ENDDO |
---|
[2742] | 462 | ENDDO |
---|
[3004] | 463 | CALL exchange_horiz_2d( tsurf_av, nbgp ) |
---|
| 464 | ENDIF |
---|
[2742] | 465 | |
---|
[1] | 466 | CASE ( 'u' ) |
---|
[3004] | 467 | IF ( ALLOCATED( u_av ) ) THEN |
---|
| 468 | DO i = nxlg, nxrg |
---|
| 469 | DO j = nysg, nyng |
---|
| 470 | DO k = nzb, nzt+1 |
---|
| 471 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 472 | ENDDO |
---|
[1] | 473 | ENDDO |
---|
| 474 | ENDDO |
---|
[3004] | 475 | ENDIF |
---|
[1] | 476 | |
---|
[3421] | 477 | CASE ( 'us*' ) |
---|
[3004] | 478 | IF ( ALLOCATED( us_av ) ) THEN |
---|
| 479 | DO i = nxlg, nxrg |
---|
| 480 | DO j = nysg, nyng |
---|
| 481 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 482 | ENDDO |
---|
[1] | 483 | ENDDO |
---|
[3004] | 484 | CALL exchange_horiz_2d( us_av, nbgp ) |
---|
| 485 | ENDIF |
---|
[1] | 486 | |
---|
| 487 | CASE ( 'v' ) |
---|
[3004] | 488 | IF ( ALLOCATED( v_av ) ) THEN |
---|
| 489 | DO i = nxlg, nxrg |
---|
| 490 | DO j = nysg, nyng |
---|
| 491 | DO k = nzb, nzt+1 |
---|
| 492 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 493 | ENDDO |
---|
[1] | 494 | ENDDO |
---|
| 495 | ENDDO |
---|
[3004] | 496 | ENDIF |
---|
[1] | 497 | |
---|
[3421] | 498 | CASE ( 'thetav' ) |
---|
[3004] | 499 | IF ( ALLOCATED( vpt_av ) ) THEN |
---|
| 500 | DO i = nxlg, nxrg |
---|
| 501 | DO j = nysg, nyng |
---|
| 502 | DO k = nzb, nzt+1 |
---|
| 503 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 504 | ENDDO |
---|
[1] | 505 | ENDDO |
---|
| 506 | ENDDO |
---|
[3004] | 507 | ENDIF |
---|
[1] | 508 | |
---|
| 509 | CASE ( 'w' ) |
---|
[3004] | 510 | IF ( ALLOCATED( w_av ) ) THEN |
---|
| 511 | DO i = nxlg, nxrg |
---|
| 512 | DO j = nysg, nyng |
---|
| 513 | DO k = nzb, nzt+1 |
---|
| 514 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 515 | ENDDO |
---|
[1] | 516 | ENDDO |
---|
| 517 | ENDDO |
---|
[3004] | 518 | ENDIF |
---|
[1] | 519 | |
---|
[72] | 520 | CASE ( 'z0*' ) |
---|
[3004] | 521 | IF ( ALLOCATED( z0_av ) ) THEN |
---|
| 522 | DO i = nxlg, nxrg |
---|
| 523 | DO j = nysg, nyng |
---|
| 524 | z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 525 | ENDDO |
---|
[72] | 526 | ENDDO |
---|
[3004] | 527 | CALL exchange_horiz_2d( z0_av, nbgp ) |
---|
| 528 | ENDIF |
---|
[72] | 529 | |
---|
[978] | 530 | CASE ( 'z0h*' ) |
---|
[3004] | 531 | IF ( ALLOCATED( z0h_av ) ) THEN |
---|
| 532 | DO i = nxlg, nxrg |
---|
| 533 | DO j = nysg, nyng |
---|
| 534 | z0h_av(j,i) = z0h_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 535 | ENDDO |
---|
[978] | 536 | ENDDO |
---|
[3004] | 537 | CALL exchange_horiz_2d( z0h_av, nbgp ) |
---|
| 538 | ENDIF |
---|
| 539 | |
---|
| 540 | CASE ( 'z0q*' ) |
---|
| 541 | IF ( ALLOCATED( z0q_av ) ) THEN |
---|
| 542 | DO i = nxlg, nxrg |
---|
| 543 | DO j = nysg, nyng |
---|
| 544 | z0q_av(j,i) = z0q_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
| 545 | ENDDO |
---|
| 546 | ENDDO |
---|
| 547 | CALL exchange_horiz_2d( z0q_av, nbgp ) |
---|
| 548 | ENDIF |
---|
| 549 | |
---|
[1] | 550 | CASE DEFAULT |
---|
| 551 | ! |
---|
[3294] | 552 | !-- Averaging of data from other modules |
---|
[3337] | 553 | IF ( air_chemistry .AND. & |
---|
| 554 | (trimvar(1:3) == 'kc_' .OR. trimvar(1:3) == 'em_') ) THEN |
---|
[3294] | 555 | CALL chem_3d_data_averaging( 'average', doav(ii) ) |
---|
| 556 | ENDIF |
---|
| 557 | |
---|
[3274] | 558 | IF ( bulk_cloud_model ) THEN |
---|
| 559 | CALL bcm_3d_data_averaging( 'average', doav(ii) ) |
---|
| 560 | ENDIF |
---|
[3294] | 561 | |
---|
| 562 | IF ( gust_module_enabled ) THEN |
---|
| 563 | CALL gust_3d_data_averaging( 'average', doav(ii) ) |
---|
| 564 | ENDIF |
---|
| 565 | |
---|
[1972] | 566 | IF ( land_surface ) THEN |
---|
| 567 | CALL lsm_3d_data_averaging( 'average', doav(ii) ) |
---|
| 568 | ENDIF |
---|
[3294] | 569 | |
---|
| 570 | IF ( ocean_mode ) THEN |
---|
| 571 | CALL ocean_3d_data_averaging( 'average', doav(ii) ) |
---|
| 572 | ENDIF |
---|
| 573 | |
---|
[1976] | 574 | IF ( radiation ) THEN |
---|
| 575 | CALL radiation_3d_data_averaging( 'average', doav(ii) ) |
---|
| 576 | ENDIF |
---|
[3467] | 577 | |
---|
| 578 | IF ( salsa ) THEN |
---|
| 579 | CALL salsa_3d_data_averaging( 'average', doav(ii) ) |
---|
| 580 | ENDIF |
---|
[3294] | 581 | |
---|
[3448] | 582 | IF ( biometeorology ) THEN |
---|
| 583 | CALL biom_3d_data_averaging( 'average', doav(ii) ) |
---|
[3337] | 584 | ENDIF |
---|
| 585 | |
---|
[3294] | 586 | CALL tcm_3d_data_averaging( 'average', doav(ii) ) |
---|
[3337] | 587 | |
---|
| 588 | IF ( urban_surface .AND. trimvar(1:4) == 'usm_' ) THEN |
---|
| 589 | CALL usm_average_3d_data( 'average', doav(ii) ) |
---|
| 590 | ENDIF |
---|
| 591 | |
---|
[1976] | 592 | ! |
---|
[3294] | 593 | !-- User-defined quantities |
---|
[1] | 594 | CALL user_3d_data_averaging( 'average', doav(ii) ) |
---|
| 595 | |
---|
| 596 | END SELECT |
---|
| 597 | |
---|
| 598 | ENDDO |
---|
| 599 | |
---|
| 600 | ! |
---|
| 601 | !-- Reset the counter |
---|
| 602 | average_count_3d = 0.0 |
---|
| 603 | |
---|
[1318] | 604 | CALL cpu_log( log_point(35), 'average_3d_data', 'stop' ) |
---|
[1] | 605 | |
---|
| 606 | |
---|
| 607 | END SUBROUTINE average_3d_data |
---|