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