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