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