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