[1682] | 1 | !> @file sum_up_3d_data.f90 |
---|
[1036] | 2 | !--------------------------------------------------------------------------------! |
---|
| 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
| 5 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 6 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 7 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 8 | ! |
---|
| 9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 10 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 11 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 12 | ! |
---|
| 13 | ! You should have received a copy of the GNU General Public License along with |
---|
| 14 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 15 | ! |
---|
[1818] | 16 | ! Copyright 1997-2016 Leibniz Universitaet Hannover |
---|
[1036] | 17 | !--------------------------------------------------------------------------------! |
---|
| 18 | ! |
---|
[484] | 19 | ! Current revisions: |
---|
[1] | 20 | ! ----------------- |
---|
[1360] | 21 | ! |
---|
[1961] | 22 | ! |
---|
[1321] | 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: sum_up_3d_data.f90 1961 2016-07-12 16:37:58Z hellstea $ |
---|
| 26 | ! |
---|
[1961] | 27 | ! 1960 2016-07-12 16:34:24Z suehring |
---|
| 28 | ! Scalar surface flux added |
---|
| 29 | ! |
---|
[1950] | 30 | ! 1949 2016-06-17 07:19:16Z maronga |
---|
| 31 | ! Bugfix: calculation of lai_av, c_veg_av and c_liq_av. |
---|
| 32 | ! |
---|
[1851] | 33 | ! 1849 2016-04-08 11:33:18Z hoffmann |
---|
| 34 | ! precipitation_rate moved to arrays_3d |
---|
[1852] | 35 | ! |
---|
[1789] | 36 | ! 1788 2016-03-10 11:01:04Z maronga |
---|
| 37 | ! Added z0q and z0q_av |
---|
| 38 | ! |
---|
[1694] | 39 | ! 1693 2015-10-27 08:35:45Z maronga |
---|
| 40 | ! Last revision text corrected |
---|
| 41 | ! |
---|
[1692] | 42 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
| 43 | ! Added output of Obukhov length and radiative heating rates for RRTMG. |
---|
[1693] | 44 | ! Corrected output of liquid water path. |
---|
[1692] | 45 | ! |
---|
[1683] | 46 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 47 | ! Code annotations made doxygen readable |
---|
| 48 | ! |
---|
[1586] | 49 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
| 50 | ! Adapted for RRTMG |
---|
| 51 | ! |
---|
[1556] | 52 | ! 1555 2015-03-04 17:44:27Z maronga |
---|
| 53 | ! Added output of r_a and r_s |
---|
| 54 | ! |
---|
[1552] | 55 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
| 56 | ! Added support for land surface model and radiation model data. |
---|
| 57 | ! |
---|
[1360] | 58 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
| 59 | ! New particle structure integrated. |
---|
| 60 | ! |
---|
[1354] | 61 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 62 | ! REAL constants provided with KIND-attribute |
---|
| 63 | ! |
---|
[1321] | 64 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 65 | ! ONLY-attribute added to USE-statements, |
---|
| 66 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 67 | ! kinds are defined in new module kinds, |
---|
| 68 | ! old module precision_kind is removed, |
---|
| 69 | ! revision history before 2012 removed, |
---|
| 70 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 71 | ! all variable declaration statements |
---|
[1] | 72 | ! |
---|
[1319] | 73 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
| 74 | ! barrier argument removed from cpu_log, |
---|
| 75 | ! module interfaces removed |
---|
| 76 | ! |
---|
[1116] | 77 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 78 | ! ql is calculated by calc_liquid_water_content |
---|
| 79 | ! |
---|
[1054] | 80 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 81 | ! +nr, prr, qr |
---|
| 82 | ! |
---|
[1037] | 83 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 84 | ! code put under GPL (PALM 3.9) |
---|
| 85 | ! |
---|
[1008] | 86 | ! 1007 2012-09-19 14:30:36Z franke |
---|
| 87 | ! Bugfix in calculation of ql_vp |
---|
| 88 | ! |
---|
[979] | 89 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 90 | ! +z0h* |
---|
| 91 | ! |
---|
[1] | 92 | ! Revision 1.1 2006/02/23 12:55:23 raasch |
---|
| 93 | ! Initial revision |
---|
| 94 | ! |
---|
| 95 | ! |
---|
| 96 | ! Description: |
---|
| 97 | ! ------------ |
---|
[1682] | 98 | !> Sum-up the values of 3d-arrays. The real averaging is later done in routine |
---|
| 99 | !> average_3d_data. |
---|
[1] | 100 | !------------------------------------------------------------------------------! |
---|
[1682] | 101 | SUBROUTINE sum_up_3d_data |
---|
| 102 | |
---|
[1] | 103 | |
---|
[1320] | 104 | USE arrays_3d, & |
---|
[1849] | 105 | ONLY: dzw, e, nr, ol, p, pt, precipitation_rate, q, qc, ql, ql_c, & |
---|
[1960] | 106 | ql_v, qr, qsws, rho, sa, shf, ssws, ts, u, us, v, vpt, w, z0, & |
---|
| 107 | z0h, z0q |
---|
[1] | 108 | |
---|
[1320] | 109 | USE averaging, & |
---|
[1691] | 110 | ONLY: e_av, lpt_av, lwp_av, nr_av, ol_av, p_av, pc_av, pr_av, prr_av, & |
---|
[1320] | 111 | precipitation_rate_av, pt_av, q_av, qc_av, ql_av, ql_c_av, & |
---|
| 112 | ql_v_av, ql_vp_av, qr_av, qsws_av, qv_av, rho_av, s_av, sa_av, & |
---|
[1960] | 113 | shf_av, ssws_av, ts_av, u_av, us_av, v_av, vpt_av, w_av, z0_av, & |
---|
| 114 | z0h_av, z0q_av |
---|
[1320] | 115 | |
---|
| 116 | USE cloud_parameters, & |
---|
[1849] | 117 | ONLY: l_d_cp, pt_d_t |
---|
[1320] | 118 | |
---|
| 119 | USE control_parameters, & |
---|
[1691] | 120 | ONLY: average_count_3d, cloud_physics, doav, doav_n, rho_surface |
---|
[1320] | 121 | |
---|
| 122 | USE cpulog, & |
---|
| 123 | ONLY: cpu_log, log_point |
---|
| 124 | |
---|
| 125 | USE indices, & |
---|
| 126 | ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
| 127 | |
---|
| 128 | USE kinds |
---|
| 129 | |
---|
[1551] | 130 | USE land_surface_model_mod, & |
---|
| 131 | ONLY: c_liq, c_liq_av, c_soil_av, c_veg, c_veg_av, ghf_eb, & |
---|
| 132 | ghf_eb_av, lai, lai_av, m_liq_eb, m_liq_eb_av, m_soil, & |
---|
| 133 | m_soil_av, nzb_soil, nzt_soil, qsws_eb, qsws_eb_av, & |
---|
| 134 | qsws_liq_eb, qsws_liq_eb_av, qsws_soil_eb, qsws_soil_eb_av, & |
---|
[1555] | 135 | qsws_veg_eb, qsws_veg_eb_av, shf_eb, shf_eb_av, r_a, r_a_av, & |
---|
| 136 | r_s, r_s_av, t_soil, t_soil_av |
---|
[1551] | 137 | |
---|
[1320] | 138 | USE particle_attributes, & |
---|
[1359] | 139 | ONLY: grid_particles, number_of_particles, particles, prt_count |
---|
[1320] | 140 | |
---|
[1551] | 141 | USE radiation_model_mod, & |
---|
[1585] | 142 | ONLY: rad_net, rad_net_av, rad_sw_in, rad_sw_in_av, rad_sw_out, & |
---|
[1691] | 143 | rad_sw_out_av, rad_sw_cs_hr, rad_sw_cs_hr_av, rad_sw_hr, & |
---|
| 144 | rad_sw_hr_av, rad_lw_in, rad_lw_in_av, rad_lw_out, & |
---|
| 145 | rad_lw_out_av, rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr, & |
---|
| 146 | rad_lw_hr_av |
---|
[1551] | 147 | |
---|
[1691] | 148 | |
---|
[1] | 149 | IMPLICIT NONE |
---|
| 150 | |
---|
[1682] | 151 | INTEGER(iwp) :: i !< |
---|
| 152 | INTEGER(iwp) :: ii !< |
---|
| 153 | INTEGER(iwp) :: j !< |
---|
| 154 | INTEGER(iwp) :: k !< |
---|
| 155 | INTEGER(iwp) :: n !< |
---|
| 156 | INTEGER(iwp) :: psi !< |
---|
[1] | 157 | |
---|
[1682] | 158 | REAL(wp) :: mean_r !< |
---|
| 159 | REAL(wp) :: s_r2 !< |
---|
| 160 | REAL(wp) :: s_r3 !< |
---|
[1] | 161 | |
---|
| 162 | CALL cpu_log (log_point(34),'sum_up_3d_data','start') |
---|
| 163 | |
---|
| 164 | ! |
---|
| 165 | !-- Allocate and initialize the summation arrays if called for the very first |
---|
| 166 | !-- time or the first time after average_3d_data has been called |
---|
| 167 | !-- (some or all of the arrays may have been already allocated |
---|
| 168 | !-- in read_3d_binary) |
---|
| 169 | IF ( average_count_3d == 0 ) THEN |
---|
| 170 | |
---|
| 171 | DO ii = 1, doav_n |
---|
| 172 | |
---|
| 173 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
| 174 | |
---|
[1551] | 175 | CASE ( 'c_liq*' ) |
---|
| 176 | IF ( .NOT. ALLOCATED( c_liq_av ) ) THEN |
---|
| 177 | ALLOCATE( c_liq_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 178 | ENDIF |
---|
| 179 | c_liq_av = 0.0_wp |
---|
| 180 | |
---|
| 181 | CASE ( 'c_soil*' ) |
---|
| 182 | IF ( .NOT. ALLOCATED( c_soil_av ) ) THEN |
---|
| 183 | ALLOCATE( c_soil_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 184 | ENDIF |
---|
| 185 | c_soil_av = 0.0_wp |
---|
| 186 | |
---|
| 187 | CASE ( 'c_veg*' ) |
---|
| 188 | IF ( .NOT. ALLOCATED( c_veg_av ) ) THEN |
---|
| 189 | ALLOCATE( c_veg_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 190 | ENDIF |
---|
| 191 | c_veg_av = 0.0_wp |
---|
| 192 | |
---|
[1] | 193 | CASE ( 'e' ) |
---|
| 194 | IF ( .NOT. ALLOCATED( e_av ) ) THEN |
---|
[667] | 195 | ALLOCATE( e_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 196 | ENDIF |
---|
[1353] | 197 | e_av = 0.0_wp |
---|
[1] | 198 | |
---|
[1551] | 199 | CASE ( 'ghf_eb*' ) |
---|
| 200 | IF ( .NOT. ALLOCATED( ghf_eb_av ) ) THEN |
---|
| 201 | ALLOCATE( ghf_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 202 | ENDIF |
---|
| 203 | ghf_eb_av = 0.0_wp |
---|
| 204 | |
---|
| 205 | CASE ( 'lai*' ) |
---|
| 206 | IF ( .NOT. ALLOCATED( lai_av ) ) THEN |
---|
| 207 | ALLOCATE( lai_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 208 | ENDIF |
---|
| 209 | lai_av = 0.0_wp |
---|
| 210 | |
---|
[771] | 211 | CASE ( 'lpt' ) |
---|
| 212 | IF ( .NOT. ALLOCATED( lpt_av ) ) THEN |
---|
| 213 | ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 214 | ENDIF |
---|
[1353] | 215 | lpt_av = 0.0_wp |
---|
[771] | 216 | |
---|
[1] | 217 | CASE ( 'lwp*' ) |
---|
| 218 | IF ( .NOT. ALLOCATED( lwp_av ) ) THEN |
---|
[667] | 219 | ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 220 | ENDIF |
---|
[1353] | 221 | lwp_av = 0.0_wp |
---|
[1] | 222 | |
---|
[1551] | 223 | CASE ( 'm_liq_eb*' ) |
---|
| 224 | IF ( .NOT. ALLOCATED( m_liq_eb_av ) ) THEN |
---|
| 225 | ALLOCATE( m_liq_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 226 | ENDIF |
---|
| 227 | m_liq_eb_av = 0.0_wp |
---|
| 228 | |
---|
| 229 | CASE ( 'm_soil' ) |
---|
| 230 | IF ( .NOT. ALLOCATED( m_soil_av ) ) THEN |
---|
| 231 | ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) |
---|
| 232 | ENDIF |
---|
| 233 | m_soil_av = 0.0_wp |
---|
| 234 | |
---|
[1053] | 235 | CASE ( 'nr' ) |
---|
| 236 | IF ( .NOT. ALLOCATED( nr_av ) ) THEN |
---|
| 237 | ALLOCATE( nr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 238 | ENDIF |
---|
[1353] | 239 | nr_av = 0.0_wp |
---|
[1053] | 240 | |
---|
[1691] | 241 | CASE ( 'ol*' ) |
---|
| 242 | IF ( .NOT. ALLOCATED( ol_av ) ) THEN |
---|
| 243 | ALLOCATE( ol_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 244 | ENDIF |
---|
| 245 | ol_av = 0.0_wp |
---|
| 246 | |
---|
[1] | 247 | CASE ( 'p' ) |
---|
| 248 | IF ( .NOT. ALLOCATED( p_av ) ) THEN |
---|
[667] | 249 | ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 250 | ENDIF |
---|
[1353] | 251 | p_av = 0.0_wp |
---|
[1] | 252 | |
---|
| 253 | CASE ( 'pc' ) |
---|
| 254 | IF ( .NOT. ALLOCATED( pc_av ) ) THEN |
---|
[667] | 255 | ALLOCATE( pc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 256 | ENDIF |
---|
[1353] | 257 | pc_av = 0.0_wp |
---|
[1] | 258 | |
---|
| 259 | CASE ( 'pr' ) |
---|
| 260 | IF ( .NOT. ALLOCATED( pr_av ) ) THEN |
---|
[667] | 261 | ALLOCATE( pr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 262 | ENDIF |
---|
[1353] | 263 | pr_av = 0.0_wp |
---|
[1] | 264 | |
---|
[1053] | 265 | CASE ( 'prr' ) |
---|
| 266 | IF ( .NOT. ALLOCATED( prr_av ) ) THEN |
---|
| 267 | ALLOCATE( prr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 268 | ENDIF |
---|
[1353] | 269 | prr_av = 0.0_wp |
---|
[1053] | 270 | |
---|
[72] | 271 | CASE ( 'prr*' ) |
---|
| 272 | IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN |
---|
[667] | 273 | ALLOCATE( precipitation_rate_av(nysg:nyng,nxlg:nxrg) ) |
---|
[72] | 274 | ENDIF |
---|
[1353] | 275 | precipitation_rate_av = 0.0_wp |
---|
[72] | 276 | |
---|
[1] | 277 | CASE ( 'pt' ) |
---|
| 278 | IF ( .NOT. ALLOCATED( pt_av ) ) THEN |
---|
[667] | 279 | ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 280 | ENDIF |
---|
[1353] | 281 | pt_av = 0.0_wp |
---|
[1] | 282 | |
---|
| 283 | CASE ( 'q' ) |
---|
| 284 | IF ( .NOT. ALLOCATED( q_av ) ) THEN |
---|
[667] | 285 | ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 286 | ENDIF |
---|
[1353] | 287 | q_av = 0.0_wp |
---|
[1] | 288 | |
---|
[1115] | 289 | CASE ( 'qc' ) |
---|
| 290 | IF ( .NOT. ALLOCATED( qc_av ) ) THEN |
---|
| 291 | ALLOCATE( qc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 292 | ENDIF |
---|
[1353] | 293 | qc_av = 0.0_wp |
---|
[1115] | 294 | |
---|
[1] | 295 | CASE ( 'ql' ) |
---|
| 296 | IF ( .NOT. ALLOCATED( ql_av ) ) THEN |
---|
[667] | 297 | ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 298 | ENDIF |
---|
[1353] | 299 | ql_av = 0.0_wp |
---|
[1] | 300 | |
---|
| 301 | CASE ( 'ql_c' ) |
---|
| 302 | IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN |
---|
[667] | 303 | ALLOCATE( ql_c_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 304 | ENDIF |
---|
[1353] | 305 | ql_c_av = 0.0_wp |
---|
[1] | 306 | |
---|
| 307 | CASE ( 'ql_v' ) |
---|
| 308 | IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN |
---|
[667] | 309 | ALLOCATE( ql_v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 310 | ENDIF |
---|
[1353] | 311 | ql_v_av = 0.0_wp |
---|
[1] | 312 | |
---|
| 313 | CASE ( 'ql_vp' ) |
---|
| 314 | IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN |
---|
[667] | 315 | ALLOCATE( ql_vp_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 316 | ENDIF |
---|
[1353] | 317 | ql_vp_av = 0.0_wp |
---|
[1] | 318 | |
---|
[1053] | 319 | CASE ( 'qr' ) |
---|
| 320 | IF ( .NOT. ALLOCATED( qr_av ) ) THEN |
---|
| 321 | ALLOCATE( qr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 322 | ENDIF |
---|
[1353] | 323 | qr_av = 0.0_wp |
---|
[1053] | 324 | |
---|
[354] | 325 | CASE ( 'qsws*' ) |
---|
| 326 | IF ( .NOT. ALLOCATED( qsws_av ) ) THEN |
---|
[667] | 327 | ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 328 | ENDIF |
---|
[1353] | 329 | qsws_av = 0.0_wp |
---|
[354] | 330 | |
---|
[1551] | 331 | CASE ( 'qsws_eb*' ) |
---|
| 332 | IF ( .NOT. ALLOCATED( qsws_eb_av ) ) THEN |
---|
| 333 | ALLOCATE( qsws_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 334 | ENDIF |
---|
| 335 | qsws_eb_av = 0.0_wp |
---|
| 336 | |
---|
| 337 | CASE ( 'qsws_liq_eb*' ) |
---|
| 338 | IF ( .NOT. ALLOCATED( qsws_liq_eb_av ) ) THEN |
---|
| 339 | ALLOCATE( qsws_liq_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 340 | ENDIF |
---|
| 341 | qsws_liq_eb_av = 0.0_wp |
---|
| 342 | |
---|
| 343 | CASE ( 'qsws_soil_eb*' ) |
---|
| 344 | IF ( .NOT. ALLOCATED( qsws_soil_eb_av ) ) THEN |
---|
| 345 | ALLOCATE( qsws_soil_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 346 | ENDIF |
---|
| 347 | qsws_soil_eb_av = 0.0_wp |
---|
| 348 | |
---|
| 349 | CASE ( 'qsws_veg_eb*' ) |
---|
| 350 | IF ( .NOT. ALLOCATED( qsws_veg_eb_av ) ) THEN |
---|
| 351 | ALLOCATE( qsws_veg_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 352 | ENDIF |
---|
| 353 | qsws_veg_eb_av = 0.0_wp |
---|
| 354 | |
---|
[1] | 355 | CASE ( 'qv' ) |
---|
| 356 | IF ( .NOT. ALLOCATED( qv_av ) ) THEN |
---|
[667] | 357 | ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 358 | ENDIF |
---|
[1353] | 359 | qv_av = 0.0_wp |
---|
[1] | 360 | |
---|
[1551] | 361 | CASE ( 'rad_net*' ) |
---|
| 362 | IF ( .NOT. ALLOCATED( rad_net_av ) ) THEN |
---|
| 363 | ALLOCATE( rad_net_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 364 | ENDIF |
---|
| 365 | rad_net_av = 0.0_wp |
---|
| 366 | |
---|
[1585] | 367 | CASE ( 'rad_lw_in' ) |
---|
| 368 | IF ( .NOT. ALLOCATED( rad_lw_in_av ) ) THEN |
---|
| 369 | ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 370 | ENDIF |
---|
| 371 | rad_lw_in_av = 0.0_wp |
---|
| 372 | |
---|
| 373 | CASE ( 'rad_lw_out' ) |
---|
| 374 | IF ( .NOT. ALLOCATED( rad_lw_out_av ) ) THEN |
---|
| 375 | ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 376 | ENDIF |
---|
| 377 | rad_lw_out_av = 0.0_wp |
---|
| 378 | |
---|
[1691] | 379 | CASE ( 'rad_lw_cs_hr' ) |
---|
| 380 | IF ( .NOT. ALLOCATED( rad_lw_cs_hr_av ) ) THEN |
---|
| 381 | ALLOCATE( rad_lw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 382 | ENDIF |
---|
| 383 | rad_lw_cs_hr_av = 0.0_wp |
---|
| 384 | |
---|
| 385 | CASE ( 'rad_lw_hr' ) |
---|
| 386 | IF ( .NOT. ALLOCATED( rad_lw_hr_av ) ) THEN |
---|
| 387 | ALLOCATE( rad_lw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 388 | ENDIF |
---|
| 389 | rad_lw_hr_av = 0.0_wp |
---|
| 390 | |
---|
[1585] | 391 | CASE ( 'rad_sw_in' ) |
---|
[1551] | 392 | IF ( .NOT. ALLOCATED( rad_sw_in_av ) ) THEN |
---|
[1585] | 393 | ALLOCATE( rad_sw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1551] | 394 | ENDIF |
---|
| 395 | rad_sw_in_av = 0.0_wp |
---|
| 396 | |
---|
[1585] | 397 | CASE ( 'rad_sw_out' ) |
---|
| 398 | IF ( .NOT. ALLOCATED( rad_sw_out_av ) ) THEN |
---|
| 399 | ALLOCATE( rad_sw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 400 | ENDIF |
---|
| 401 | rad_sw_out_av = 0.0_wp |
---|
| 402 | |
---|
[1691] | 403 | CASE ( 'rad_sw_cs_hr' ) |
---|
| 404 | IF ( .NOT. ALLOCATED( rad_sw_cs_hr_av ) ) THEN |
---|
| 405 | ALLOCATE( rad_sw_cs_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 406 | ENDIF |
---|
| 407 | rad_sw_cs_hr_av = 0.0_wp |
---|
| 408 | |
---|
| 409 | CASE ( 'rad_sw_hr' ) |
---|
| 410 | IF ( .NOT. ALLOCATED( rad_sw_hr_av ) ) THEN |
---|
| 411 | ALLOCATE( rad_sw_hr_av(nzb+1:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 412 | ENDIF |
---|
| 413 | rad_sw_hr_av = 0.0_wp |
---|
| 414 | |
---|
[96] | 415 | CASE ( 'rho' ) |
---|
| 416 | IF ( .NOT. ALLOCATED( rho_av ) ) THEN |
---|
[667] | 417 | ALLOCATE( rho_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[96] | 418 | ENDIF |
---|
[1353] | 419 | rho_av = 0.0_wp |
---|
[96] | 420 | |
---|
[1555] | 421 | CASE ( 'r_a*' ) |
---|
| 422 | IF ( .NOT. ALLOCATED( r_a_av ) ) THEN |
---|
| 423 | ALLOCATE( r_a_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 424 | ENDIF |
---|
| 425 | r_a_av = 0.0_wp |
---|
| 426 | |
---|
| 427 | CASE ( 'r_s*' ) |
---|
| 428 | IF ( .NOT. ALLOCATED( r_s_av ) ) THEN |
---|
| 429 | ALLOCATE( r_s_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 430 | ENDIF |
---|
| 431 | r_s_av = 0.0_wp |
---|
| 432 | |
---|
[1] | 433 | CASE ( 's' ) |
---|
| 434 | IF ( .NOT. ALLOCATED( s_av ) ) THEN |
---|
[667] | 435 | ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 436 | ENDIF |
---|
[1353] | 437 | s_av = 0.0_wp |
---|
[1] | 438 | |
---|
[96] | 439 | CASE ( 'sa' ) |
---|
| 440 | IF ( .NOT. ALLOCATED( sa_av ) ) THEN |
---|
[667] | 441 | ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[96] | 442 | ENDIF |
---|
[1353] | 443 | sa_av = 0.0_wp |
---|
[96] | 444 | |
---|
[354] | 445 | CASE ( 'shf*' ) |
---|
| 446 | IF ( .NOT. ALLOCATED( shf_av ) ) THEN |
---|
[667] | 447 | ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 448 | ENDIF |
---|
[1353] | 449 | shf_av = 0.0_wp |
---|
[354] | 450 | |
---|
[1551] | 451 | CASE ( 'shf_eb*' ) |
---|
| 452 | IF ( .NOT. ALLOCATED( shf_eb_av ) ) THEN |
---|
| 453 | ALLOCATE( shf_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 454 | ENDIF |
---|
| 455 | shf_eb_av = 0.0_wp |
---|
| 456 | |
---|
| 457 | CASE ( 't_soil' ) |
---|
| 458 | IF ( .NOT. ALLOCATED( t_soil_av ) ) THEN |
---|
| 459 | ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) |
---|
| 460 | ENDIF |
---|
| 461 | t_soil_av = 0.0_wp |
---|
| 462 | |
---|
[1] | 463 | CASE ( 't*' ) |
---|
| 464 | IF ( .NOT. ALLOCATED( ts_av ) ) THEN |
---|
[667] | 465 | ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 466 | ENDIF |
---|
[1353] | 467 | ts_av = 0.0_wp |
---|
[1] | 468 | |
---|
| 469 | CASE ( 'u' ) |
---|
| 470 | IF ( .NOT. ALLOCATED( u_av ) ) THEN |
---|
[667] | 471 | ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 472 | ENDIF |
---|
[1353] | 473 | u_av = 0.0_wp |
---|
[1] | 474 | |
---|
| 475 | CASE ( 'u*' ) |
---|
| 476 | IF ( .NOT. ALLOCATED( us_av ) ) THEN |
---|
[667] | 477 | ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 478 | ENDIF |
---|
[1353] | 479 | us_av = 0.0_wp |
---|
[1] | 480 | |
---|
| 481 | CASE ( 'v' ) |
---|
| 482 | IF ( .NOT. ALLOCATED( v_av ) ) THEN |
---|
[667] | 483 | ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 484 | ENDIF |
---|
[1353] | 485 | v_av = 0.0_wp |
---|
[1] | 486 | |
---|
| 487 | CASE ( 'vpt' ) |
---|
| 488 | IF ( .NOT. ALLOCATED( vpt_av ) ) THEN |
---|
[667] | 489 | ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 490 | ENDIF |
---|
[1353] | 491 | vpt_av = 0.0_wp |
---|
[1] | 492 | |
---|
| 493 | CASE ( 'w' ) |
---|
| 494 | IF ( .NOT. ALLOCATED( w_av ) ) THEN |
---|
[667] | 495 | ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1] | 496 | ENDIF |
---|
[1353] | 497 | w_av = 0.0_wp |
---|
[1] | 498 | |
---|
[72] | 499 | CASE ( 'z0*' ) |
---|
| 500 | IF ( .NOT. ALLOCATED( z0_av ) ) THEN |
---|
[667] | 501 | ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) |
---|
[72] | 502 | ENDIF |
---|
[1353] | 503 | z0_av = 0.0_wp |
---|
[72] | 504 | |
---|
[978] | 505 | CASE ( 'z0h*' ) |
---|
| 506 | IF ( .NOT. ALLOCATED( z0h_av ) ) THEN |
---|
| 507 | ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 508 | ENDIF |
---|
[1353] | 509 | z0h_av = 0.0_wp |
---|
[978] | 510 | |
---|
[1788] | 511 | CASE ( 'z0q*' ) |
---|
| 512 | IF ( .NOT. ALLOCATED( z0q_av ) ) THEN |
---|
| 513 | ALLOCATE( z0q_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 514 | ENDIF |
---|
| 515 | z0q_av = 0.0_wp |
---|
| 516 | |
---|
[1] | 517 | CASE DEFAULT |
---|
| 518 | ! |
---|
| 519 | !-- User-defined quantity |
---|
| 520 | CALL user_3d_data_averaging( 'allocate', doav(ii) ) |
---|
| 521 | |
---|
| 522 | END SELECT |
---|
| 523 | |
---|
| 524 | ENDDO |
---|
| 525 | |
---|
| 526 | ENDIF |
---|
| 527 | |
---|
| 528 | ! |
---|
| 529 | !-- Loop of all variables to be averaged. |
---|
| 530 | DO ii = 1, doav_n |
---|
| 531 | |
---|
| 532 | ! |
---|
| 533 | !-- Store the array chosen on the temporary array. |
---|
| 534 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
| 535 | |
---|
[1551] | 536 | CASE ( 'c_liq*' ) |
---|
| 537 | DO i = nxlg, nxrg |
---|
| 538 | DO j = nysg, nyng |
---|
[1949] | 539 | c_liq_av(j,i) = c_liq_av(j,i) + c_liq(j,i) |
---|
[1551] | 540 | ENDDO |
---|
| 541 | ENDDO |
---|
| 542 | |
---|
| 543 | CASE ( 'c_soil*' ) |
---|
| 544 | DO i = nxlg, nxrg |
---|
| 545 | DO j = nysg, nyng |
---|
[1949] | 546 | c_soil_av(j,i) = c_soil_av(j,i) + (1.0 - c_veg(j,i)) |
---|
[1551] | 547 | ENDDO |
---|
| 548 | ENDDO |
---|
| 549 | |
---|
| 550 | CASE ( 'c_veg*' ) |
---|
| 551 | DO i = nxlg, nxrg |
---|
| 552 | DO j = nysg, nyng |
---|
[1949] | 553 | c_veg_av(j,i) = c_veg_av(j,i) + c_veg(j,i) |
---|
[1551] | 554 | ENDDO |
---|
| 555 | ENDDO |
---|
| 556 | |
---|
[1] | 557 | CASE ( 'e' ) |
---|
[667] | 558 | DO i = nxlg, nxrg |
---|
| 559 | DO j = nysg, nyng |
---|
[1] | 560 | DO k = nzb, nzt+1 |
---|
| 561 | e_av(k,j,i) = e_av(k,j,i) + e(k,j,i) |
---|
| 562 | ENDDO |
---|
| 563 | ENDDO |
---|
| 564 | ENDDO |
---|
| 565 | |
---|
[1551] | 566 | CASE ( 'ghf_eb*' ) |
---|
| 567 | DO i = nxlg, nxrg |
---|
| 568 | DO j = nysg, nyng |
---|
| 569 | ghf_eb_av(j,i) = ghf_eb_av(j,i) + ghf_eb(j,i) |
---|
| 570 | ENDDO |
---|
| 571 | ENDDO |
---|
| 572 | |
---|
| 573 | CASE ( 'lai*' ) |
---|
| 574 | DO i = nxlg, nxrg |
---|
| 575 | DO j = nysg, nyng |
---|
[1949] | 576 | lai_av(j,i) = lai_av(j,i) + lai(j,i) |
---|
[1551] | 577 | ENDDO |
---|
| 578 | ENDDO |
---|
| 579 | |
---|
[771] | 580 | CASE ( 'lpt' ) |
---|
| 581 | DO i = nxlg, nxrg |
---|
| 582 | DO j = nysg, nyng |
---|
| 583 | DO k = nzb, nzt+1 |
---|
| 584 | lpt_av(k,j,i) = lpt_av(k,j,i) + pt(k,j,i) |
---|
| 585 | ENDDO |
---|
| 586 | ENDDO |
---|
| 587 | ENDDO |
---|
| 588 | |
---|
[1] | 589 | CASE ( 'lwp*' ) |
---|
[667] | 590 | DO i = nxlg, nxrg |
---|
| 591 | DO j = nysg, nyng |
---|
[1691] | 592 | lwp_av(j,i) = lwp_av(j,i) + SUM( ql(nzb:nzt,j,i) & |
---|
| 593 | * dzw(1:nzt+1) ) * rho_surface |
---|
[1] | 594 | ENDDO |
---|
| 595 | ENDDO |
---|
| 596 | |
---|
[1551] | 597 | CASE ( 'm_liq_eb*' ) |
---|
| 598 | DO i = nxlg, nxrg |
---|
| 599 | DO j = nysg, nyng |
---|
| 600 | m_liq_eb_av(j,i) = m_liq_eb_av(j,i) + m_liq_eb(j,i) |
---|
| 601 | ENDDO |
---|
| 602 | ENDDO |
---|
| 603 | |
---|
| 604 | CASE ( 'm_soil' ) |
---|
| 605 | DO i = nxlg, nxrg |
---|
| 606 | DO j = nysg, nyng |
---|
| 607 | DO k = nzb_soil, nzt_soil |
---|
| 608 | m_soil_av(k,j,i) = m_soil_av(k,j,i) + m_soil(k,j,i) |
---|
| 609 | ENDDO |
---|
| 610 | ENDDO |
---|
| 611 | ENDDO |
---|
| 612 | |
---|
[1053] | 613 | CASE ( 'nr' ) |
---|
| 614 | DO i = nxlg, nxrg |
---|
| 615 | DO j = nysg, nyng |
---|
| 616 | DO k = nzb, nzt+1 |
---|
| 617 | nr_av(k,j,i) = nr_av(k,j,i) + nr(k,j,i) |
---|
| 618 | ENDDO |
---|
| 619 | ENDDO |
---|
| 620 | ENDDO |
---|
| 621 | |
---|
[1691] | 622 | CASE ( 'ol*' ) |
---|
| 623 | DO i = nxlg, nxrg |
---|
| 624 | DO j = nysg, nyng |
---|
| 625 | ol_av(j,i) = ol_av(j,i) + ol(j,i) |
---|
| 626 | ENDDO |
---|
| 627 | ENDDO |
---|
| 628 | |
---|
[1] | 629 | CASE ( 'p' ) |
---|
[667] | 630 | DO i = nxlg, nxrg |
---|
| 631 | DO j = nysg, nyng |
---|
[1] | 632 | DO k = nzb, nzt+1 |
---|
| 633 | p_av(k,j,i) = p_av(k,j,i) + p(k,j,i) |
---|
| 634 | ENDDO |
---|
| 635 | ENDDO |
---|
| 636 | ENDDO |
---|
| 637 | |
---|
| 638 | CASE ( 'pc' ) |
---|
| 639 | DO i = nxl, nxr |
---|
| 640 | DO j = nys, nyn |
---|
| 641 | DO k = nzb, nzt+1 |
---|
| 642 | pc_av(k,j,i) = pc_av(k,j,i) + prt_count(k,j,i) |
---|
| 643 | ENDDO |
---|
| 644 | ENDDO |
---|
| 645 | ENDDO |
---|
| 646 | |
---|
| 647 | CASE ( 'pr' ) |
---|
| 648 | DO i = nxl, nxr |
---|
| 649 | DO j = nys, nyn |
---|
| 650 | DO k = nzb, nzt+1 |
---|
[1359] | 651 | number_of_particles = prt_count(k,j,i) |
---|
| 652 | IF ( number_of_particles <= 0 ) CYCLE |
---|
| 653 | particles => grid_particles(k,j,i)%particles(1:number_of_particles) |
---|
| 654 | s_r2 = 0.0_wp |
---|
[1353] | 655 | s_r3 = 0.0_wp |
---|
[1359] | 656 | |
---|
| 657 | DO n = 1, number_of_particles |
---|
| 658 | IF ( particles(n)%particle_mask ) THEN |
---|
| 659 | s_r2 = s_r2 + particles(n)%radius**2 * & |
---|
| 660 | particles(n)%weight_factor |
---|
| 661 | s_r3 = s_r3 + particles(n)%radius**3 * & |
---|
| 662 | particles(n)%weight_factor |
---|
| 663 | ENDIF |
---|
[1] | 664 | ENDDO |
---|
[1359] | 665 | |
---|
| 666 | IF ( s_r2 > 0.0_wp ) THEN |
---|
| 667 | mean_r = s_r3 / s_r2 |
---|
[1] | 668 | ELSE |
---|
[1353] | 669 | mean_r = 0.0_wp |
---|
[1] | 670 | ENDIF |
---|
| 671 | pr_av(k,j,i) = pr_av(k,j,i) + mean_r |
---|
| 672 | ENDDO |
---|
| 673 | ENDDO |
---|
| 674 | ENDDO |
---|
| 675 | |
---|
[1359] | 676 | |
---|
[72] | 677 | CASE ( 'pr*' ) |
---|
[667] | 678 | DO i = nxlg, nxrg |
---|
| 679 | DO j = nysg, nyng |
---|
[72] | 680 | precipitation_rate_av(j,i) = precipitation_rate_av(j,i) + & |
---|
| 681 | precipitation_rate(j,i) |
---|
| 682 | ENDDO |
---|
| 683 | ENDDO |
---|
| 684 | |
---|
[1] | 685 | CASE ( 'pt' ) |
---|
| 686 | IF ( .NOT. cloud_physics ) THEN |
---|
[667] | 687 | DO i = nxlg, nxrg |
---|
| 688 | DO j = nysg, nyng |
---|
| 689 | DO k = nzb, nzt+1 |
---|
[1] | 690 | pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) |
---|
| 691 | ENDDO |
---|
| 692 | ENDDO |
---|
| 693 | ENDDO |
---|
| 694 | ELSE |
---|
[667] | 695 | DO i = nxlg, nxrg |
---|
| 696 | DO j = nysg, nyng |
---|
| 697 | DO k = nzb, nzt+1 |
---|
[1] | 698 | pt_av(k,j,i) = pt_av(k,j,i) + pt(k,j,i) + l_d_cp * & |
---|
| 699 | pt_d_t(k) * ql(k,j,i) |
---|
| 700 | ENDDO |
---|
| 701 | ENDDO |
---|
| 702 | ENDDO |
---|
| 703 | ENDIF |
---|
| 704 | |
---|
| 705 | CASE ( 'q' ) |
---|
[667] | 706 | DO i = nxlg, nxrg |
---|
| 707 | DO j = nysg, nyng |
---|
[1] | 708 | DO k = nzb, nzt+1 |
---|
| 709 | q_av(k,j,i) = q_av(k,j,i) + q(k,j,i) |
---|
| 710 | ENDDO |
---|
| 711 | ENDDO |
---|
| 712 | ENDDO |
---|
[402] | 713 | |
---|
[1115] | 714 | CASE ( 'qc' ) |
---|
| 715 | DO i = nxlg, nxrg |
---|
| 716 | DO j = nysg, nyng |
---|
| 717 | DO k = nzb, nzt+1 |
---|
| 718 | qc_av(k,j,i) = qc_av(k,j,i) + qc(k,j,i) |
---|
| 719 | ENDDO |
---|
| 720 | ENDDO |
---|
| 721 | ENDDO |
---|
| 722 | |
---|
[1] | 723 | CASE ( 'ql' ) |
---|
[667] | 724 | DO i = nxlg, nxrg |
---|
| 725 | DO j = nysg, nyng |
---|
[1] | 726 | DO k = nzb, nzt+1 |
---|
| 727 | ql_av(k,j,i) = ql_av(k,j,i) + ql(k,j,i) |
---|
| 728 | ENDDO |
---|
| 729 | ENDDO |
---|
| 730 | ENDDO |
---|
| 731 | |
---|
| 732 | CASE ( 'ql_c' ) |
---|
[667] | 733 | DO i = nxlg, nxrg |
---|
| 734 | DO j = nysg, nyng |
---|
[1] | 735 | DO k = nzb, nzt+1 |
---|
| 736 | ql_c_av(k,j,i) = ql_c_av(k,j,i) + ql_c(k,j,i) |
---|
| 737 | ENDDO |
---|
| 738 | ENDDO |
---|
| 739 | ENDDO |
---|
| 740 | |
---|
| 741 | CASE ( 'ql_v' ) |
---|
[667] | 742 | DO i = nxlg, nxrg |
---|
| 743 | DO j = nysg, nyng |
---|
[1] | 744 | DO k = nzb, nzt+1 |
---|
| 745 | ql_v_av(k,j,i) = ql_v_av(k,j,i) + ql_v(k,j,i) |
---|
| 746 | ENDDO |
---|
| 747 | ENDDO |
---|
| 748 | ENDDO |
---|
| 749 | |
---|
| 750 | CASE ( 'ql_vp' ) |
---|
[1007] | 751 | DO i = nxl, nxr |
---|
| 752 | DO j = nys, nyn |
---|
[1] | 753 | DO k = nzb, nzt+1 |
---|
[1359] | 754 | number_of_particles = prt_count(k,j,i) |
---|
| 755 | IF ( number_of_particles <= 0 ) CYCLE |
---|
| 756 | particles => grid_particles(k,j,i)%particles(1:number_of_particles) |
---|
| 757 | DO n = 1, number_of_particles |
---|
| 758 | IF ( particles(n)%particle_mask ) THEN |
---|
| 759 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) + & |
---|
| 760 | particles(n)%weight_factor / & |
---|
| 761 | number_of_particles |
---|
| 762 | ENDIF |
---|
[1007] | 763 | ENDDO |
---|
[1] | 764 | ENDDO |
---|
| 765 | ENDDO |
---|
| 766 | ENDDO |
---|
| 767 | |
---|
[1053] | 768 | CASE ( 'qr' ) |
---|
| 769 | DO i = nxlg, nxrg |
---|
| 770 | DO j = nysg, nyng |
---|
| 771 | DO k = nzb, nzt+1 |
---|
| 772 | qr_av(k,j,i) = qr_av(k,j,i) + qr(k,j,i) |
---|
| 773 | ENDDO |
---|
| 774 | ENDDO |
---|
| 775 | ENDDO |
---|
| 776 | |
---|
[402] | 777 | CASE ( 'qsws*' ) |
---|
[667] | 778 | DO i = nxlg, nxrg |
---|
| 779 | DO j = nysg, nyng |
---|
[402] | 780 | qsws_av(j,i) = qsws_av(j,i) + qsws(j,i) |
---|
| 781 | ENDDO |
---|
| 782 | ENDDO |
---|
| 783 | |
---|
[1551] | 784 | CASE ( 'qsws_eb*' ) |
---|
| 785 | DO i = nxlg, nxrg |
---|
| 786 | DO j = nysg, nyng |
---|
| 787 | qsws_eb_av(j,i) = qsws_eb_av(j,i) + qsws_eb(j,i) |
---|
| 788 | ENDDO |
---|
| 789 | ENDDO |
---|
| 790 | |
---|
| 791 | CASE ( 'qsws_liq_eb*' ) |
---|
| 792 | DO i = nxlg, nxrg |
---|
| 793 | DO j = nysg, nyng |
---|
| 794 | qsws_liq_eb_av(j,i) = qsws_liq_eb_av(j,i) + qsws_liq_eb(j,i) |
---|
| 795 | ENDDO |
---|
| 796 | ENDDO |
---|
| 797 | |
---|
| 798 | CASE ( 'qsws_soil_eb*' ) |
---|
| 799 | DO i = nxlg, nxrg |
---|
| 800 | DO j = nysg, nyng |
---|
| 801 | qsws_soil_eb_av(j,i) = qsws_soil_eb_av(j,i) + qsws_soil_eb(j,i) |
---|
| 802 | ENDDO |
---|
| 803 | ENDDO |
---|
| 804 | |
---|
| 805 | CASE ( 'qsws_veg_eb*' ) |
---|
| 806 | DO i = nxlg, nxrg |
---|
| 807 | DO j = nysg, nyng |
---|
| 808 | qsws_veg_eb_av(j,i) = qsws_veg_eb_av(j,i) + qsws_veg_eb(j,i) |
---|
| 809 | ENDDO |
---|
| 810 | ENDDO |
---|
| 811 | |
---|
[1] | 812 | CASE ( 'qv' ) |
---|
[667] | 813 | DO i = nxlg, nxrg |
---|
| 814 | DO j = nysg, nyng |
---|
[1] | 815 | DO k = nzb, nzt+1 |
---|
| 816 | qv_av(k,j,i) = qv_av(k,j,i) + q(k,j,i) - ql(k,j,i) |
---|
| 817 | ENDDO |
---|
| 818 | ENDDO |
---|
| 819 | ENDDO |
---|
| 820 | |
---|
[1551] | 821 | CASE ( 'rad_net*' ) |
---|
| 822 | DO i = nxlg, nxrg |
---|
| 823 | DO j = nysg, nyng |
---|
| 824 | rad_net_av(j,i) = rad_net_av(j,i) + rad_net(j,i) |
---|
| 825 | ENDDO |
---|
| 826 | ENDDO |
---|
| 827 | |
---|
[1585] | 828 | CASE ( 'rad_lw_in' ) |
---|
[1551] | 829 | DO i = nxlg, nxrg |
---|
| 830 | DO j = nysg, nyng |
---|
[1585] | 831 | DO k = nzb, nzt+1 |
---|
| 832 | rad_lw_in_av(k,j,i) = rad_lw_in_av(k,j,i) + rad_lw_in(k,j,i) |
---|
| 833 | ENDDO |
---|
[1551] | 834 | ENDDO |
---|
| 835 | ENDDO |
---|
| 836 | |
---|
[1585] | 837 | CASE ( 'rad_lw_out' ) |
---|
| 838 | DO i = nxlg, nxrg |
---|
| 839 | DO j = nysg, nyng |
---|
| 840 | DO k = nzb, nzt+1 |
---|
| 841 | rad_lw_out_av(k,j,i) = rad_lw_out_av(k,j,i) + rad_lw_out(k,j,i) |
---|
| 842 | ENDDO |
---|
| 843 | ENDDO |
---|
| 844 | ENDDO |
---|
| 845 | |
---|
[1691] | 846 | CASE ( 'rad_lw_cs_hr' ) |
---|
| 847 | DO i = nxlg, nxrg |
---|
| 848 | DO j = nysg, nyng |
---|
| 849 | DO k = nzb, nzt+1 |
---|
| 850 | rad_lw_cs_hr_av(k,j,i) = rad_lw_cs_hr_av(k,j,i) + rad_lw_cs_hr(k,j,i) |
---|
| 851 | ENDDO |
---|
| 852 | ENDDO |
---|
| 853 | ENDDO |
---|
[1585] | 854 | |
---|
[1691] | 855 | CASE ( 'rad_lw_hr' ) |
---|
| 856 | DO i = nxlg, nxrg |
---|
| 857 | DO j = nysg, nyng |
---|
| 858 | DO k = nzb, nzt+1 |
---|
| 859 | rad_lw_hr_av(k,j,i) = rad_lw_hr_av(k,j,i) + rad_lw_hr(k,j,i) |
---|
| 860 | ENDDO |
---|
| 861 | ENDDO |
---|
| 862 | ENDDO |
---|
| 863 | |
---|
[1585] | 864 | CASE ( 'rad_sw_in' ) |
---|
| 865 | DO i = nxlg, nxrg |
---|
| 866 | DO j = nysg, nyng |
---|
| 867 | DO k = nzb, nzt+1 |
---|
| 868 | rad_sw_in_av(k,j,i) = rad_sw_in_av(k,j,i) + rad_sw_in(k,j,i) |
---|
| 869 | ENDDO |
---|
| 870 | ENDDO |
---|
| 871 | ENDDO |
---|
| 872 | |
---|
| 873 | CASE ( 'rad_sw_out' ) |
---|
| 874 | DO i = nxlg, nxrg |
---|
| 875 | DO j = nysg, nyng |
---|
| 876 | DO k = nzb, nzt+1 |
---|
| 877 | rad_sw_out_av(k,j,i) = rad_sw_out_av(k,j,i) + rad_sw_out(k,j,i) |
---|
| 878 | ENDDO |
---|
| 879 | ENDDO |
---|
| 880 | ENDDO |
---|
| 881 | |
---|
[1691] | 882 | CASE ( 'rad_sw_cs_hr' ) |
---|
| 883 | DO i = nxlg, nxrg |
---|
| 884 | DO j = nysg, nyng |
---|
| 885 | DO k = nzb, nzt+1 |
---|
| 886 | rad_sw_cs_hr_av(k,j,i) = rad_sw_cs_hr_av(k,j,i) + rad_sw_cs_hr(k,j,i) |
---|
| 887 | ENDDO |
---|
| 888 | ENDDO |
---|
| 889 | ENDDO |
---|
| 890 | |
---|
| 891 | CASE ( 'rad_sw_hr' ) |
---|
| 892 | DO i = nxlg, nxrg |
---|
| 893 | DO j = nysg, nyng |
---|
| 894 | DO k = nzb, nzt+1 |
---|
| 895 | rad_sw_hr_av(k,j,i) = rad_sw_hr_av(k,j,i) + rad_sw_hr(k,j,i) |
---|
| 896 | ENDDO |
---|
| 897 | ENDDO |
---|
| 898 | ENDDO |
---|
| 899 | |
---|
[1555] | 900 | CASE ( 'r_a*' ) |
---|
| 901 | DO i = nxlg, nxrg |
---|
| 902 | DO j = nysg, nyng |
---|
| 903 | r_a_av(j,i) = r_a_av(j,i) + r_a(j,i) |
---|
| 904 | ENDDO |
---|
| 905 | ENDDO |
---|
| 906 | |
---|
| 907 | CASE ( 'r_s*' ) |
---|
| 908 | DO i = nxlg, nxrg |
---|
| 909 | DO j = nysg, nyng |
---|
| 910 | r_s_av(j,i) = r_s_av(j,i) + r_s(j,i) |
---|
| 911 | ENDDO |
---|
| 912 | ENDDO |
---|
| 913 | |
---|
[96] | 914 | CASE ( 'rho' ) |
---|
[667] | 915 | DO i = nxlg, nxrg |
---|
| 916 | DO j = nysg, nyng |
---|
[96] | 917 | DO k = nzb, nzt+1 |
---|
| 918 | rho_av(k,j,i) = rho_av(k,j,i) + rho(k,j,i) |
---|
| 919 | ENDDO |
---|
| 920 | ENDDO |
---|
| 921 | ENDDO |
---|
[402] | 922 | |
---|
[1] | 923 | CASE ( 's' ) |
---|
[667] | 924 | DO i = nxlg, nxrg |
---|
| 925 | DO j = nysg, nyng |
---|
[1] | 926 | DO k = nzb, nzt+1 |
---|
| 927 | s_av(k,j,i) = s_av(k,j,i) + q(k,j,i) |
---|
| 928 | ENDDO |
---|
| 929 | ENDDO |
---|
| 930 | ENDDO |
---|
[402] | 931 | |
---|
[96] | 932 | CASE ( 'sa' ) |
---|
[667] | 933 | DO i = nxlg, nxrg |
---|
| 934 | DO j = nysg, nyng |
---|
[96] | 935 | DO k = nzb, nzt+1 |
---|
| 936 | sa_av(k,j,i) = sa_av(k,j,i) + sa(k,j,i) |
---|
| 937 | ENDDO |
---|
| 938 | ENDDO |
---|
| 939 | ENDDO |
---|
[402] | 940 | |
---|
| 941 | CASE ( 'shf*' ) |
---|
[667] | 942 | DO i = nxlg, nxrg |
---|
| 943 | DO j = nysg, nyng |
---|
[402] | 944 | shf_av(j,i) = shf_av(j,i) + shf(j,i) |
---|
| 945 | ENDDO |
---|
| 946 | ENDDO |
---|
| 947 | |
---|
[1551] | 948 | CASE ( 'shf_eb*' ) |
---|
| 949 | DO i = nxlg, nxrg |
---|
| 950 | DO j = nysg, nyng |
---|
| 951 | shf_eb_av(j,i) = shf_eb_av(j,i) + shf_eb(j,i) |
---|
| 952 | ENDDO |
---|
| 953 | ENDDO |
---|
| 954 | |
---|
[1960] | 955 | CASE ( 'ssws*' ) |
---|
| 956 | DO i = nxlg, nxrg |
---|
| 957 | DO j = nysg, nyng |
---|
| 958 | ssws_av(j,i) = ssws_av(j,i) + ssws(j,i) |
---|
| 959 | ENDDO |
---|
| 960 | ENDDO |
---|
| 961 | |
---|
[1] | 962 | CASE ( 't*' ) |
---|
[667] | 963 | DO i = nxlg, nxrg |
---|
| 964 | DO j = nysg, nyng |
---|
[1] | 965 | ts_av(j,i) = ts_av(j,i) + ts(j,i) |
---|
| 966 | ENDDO |
---|
| 967 | ENDDO |
---|
| 968 | |
---|
[1551] | 969 | CASE ( 't_soil' ) |
---|
| 970 | DO i = nxlg, nxrg |
---|
| 971 | DO j = nysg, nyng |
---|
| 972 | DO k = nzb_soil, nzt_soil |
---|
| 973 | t_soil_av(k,j,i) = t_soil_av(k,j,i) + t_soil(k,j,i) |
---|
| 974 | ENDDO |
---|
| 975 | ENDDO |
---|
| 976 | ENDDO |
---|
| 977 | |
---|
[1] | 978 | CASE ( 'u' ) |
---|
[667] | 979 | DO i = nxlg, nxrg |
---|
| 980 | DO j = nysg, nyng |
---|
[1] | 981 | DO k = nzb, nzt+1 |
---|
| 982 | u_av(k,j,i) = u_av(k,j,i) + u(k,j,i) |
---|
| 983 | ENDDO |
---|
| 984 | ENDDO |
---|
| 985 | ENDDO |
---|
| 986 | |
---|
| 987 | CASE ( 'u*' ) |
---|
[667] | 988 | DO i = nxlg, nxrg |
---|
| 989 | DO j = nysg, nyng |
---|
[1] | 990 | us_av(j,i) = us_av(j,i) + us(j,i) |
---|
| 991 | ENDDO |
---|
| 992 | ENDDO |
---|
| 993 | |
---|
| 994 | CASE ( 'v' ) |
---|
[667] | 995 | DO i = nxlg, nxrg |
---|
| 996 | DO j = nysg, nyng |
---|
[1] | 997 | DO k = nzb, nzt+1 |
---|
| 998 | v_av(k,j,i) = v_av(k,j,i) + v(k,j,i) |
---|
| 999 | ENDDO |
---|
| 1000 | ENDDO |
---|
| 1001 | ENDDO |
---|
| 1002 | |
---|
| 1003 | CASE ( 'vpt' ) |
---|
[667] | 1004 | DO i = nxlg, nxrg |
---|
| 1005 | DO j = nysg, nyng |
---|
[1] | 1006 | DO k = nzb, nzt+1 |
---|
| 1007 | vpt_av(k,j,i) = vpt_av(k,j,i) + vpt(k,j,i) |
---|
| 1008 | ENDDO |
---|
| 1009 | ENDDO |
---|
| 1010 | ENDDO |
---|
| 1011 | |
---|
| 1012 | CASE ( 'w' ) |
---|
[667] | 1013 | DO i = nxlg, nxrg |
---|
| 1014 | DO j = nysg, nyng |
---|
[1] | 1015 | DO k = nzb, nzt+1 |
---|
| 1016 | w_av(k,j,i) = w_av(k,j,i) + w(k,j,i) |
---|
| 1017 | ENDDO |
---|
| 1018 | ENDDO |
---|
| 1019 | ENDDO |
---|
| 1020 | |
---|
[72] | 1021 | CASE ( 'z0*' ) |
---|
[667] | 1022 | DO i = nxlg, nxrg |
---|
| 1023 | DO j = nysg, nyng |
---|
[72] | 1024 | z0_av(j,i) = z0_av(j,i) + z0(j,i) |
---|
| 1025 | ENDDO |
---|
| 1026 | ENDDO |
---|
| 1027 | |
---|
[978] | 1028 | CASE ( 'z0h*' ) |
---|
| 1029 | DO i = nxlg, nxrg |
---|
| 1030 | DO j = nysg, nyng |
---|
| 1031 | z0h_av(j,i) = z0h_av(j,i) + z0h(j,i) |
---|
| 1032 | ENDDO |
---|
| 1033 | ENDDO |
---|
| 1034 | |
---|
[1788] | 1035 | CASE ( 'z0q*' ) |
---|
| 1036 | DO i = nxlg, nxrg |
---|
| 1037 | DO j = nysg, nyng |
---|
| 1038 | z0q_av(j,i) = z0q_av(j,i) + z0q(j,i) |
---|
| 1039 | ENDDO |
---|
| 1040 | ENDDO |
---|
| 1041 | |
---|
[1] | 1042 | CASE DEFAULT |
---|
| 1043 | ! |
---|
| 1044 | !-- User-defined quantity |
---|
| 1045 | CALL user_3d_data_averaging( 'sum', doav(ii) ) |
---|
| 1046 | |
---|
| 1047 | END SELECT |
---|
| 1048 | |
---|
| 1049 | ENDDO |
---|
| 1050 | |
---|
[1318] | 1051 | CALL cpu_log( log_point(34), 'sum_up_3d_data', 'stop' ) |
---|
[1] | 1052 | |
---|
| 1053 | |
---|
| 1054 | END SUBROUTINE sum_up_3d_data |
---|