[1] | 1 | SUBROUTINE average_3d_data |
---|
| 2 | |
---|
[1036] | 3 | !--------------------------------------------------------------------------------! |
---|
| 4 | ! This file is part of PALM. |
---|
| 5 | ! |
---|
| 6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 8 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 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 | ! |
---|
[1310] | 17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[772] | 22 | ! |
---|
[1116] | 23 | ! |
---|
[1] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
[3] | 26 | ! $Id: average_3d_data.f90 1310 2014-03-14 08:01:56Z heinze $ |
---|
[1054] | 27 | ! |
---|
[1116] | 28 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 29 | ! +qc |
---|
| 30 | ! |
---|
[1054] | 31 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 32 | ! averaging of nr, qr added |
---|
| 33 | ! |
---|
[1037] | 34 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 35 | ! code put under GPL (PALM 3.9) |
---|
| 36 | ! |
---|
[979] | 37 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 38 | ! +z0h_av |
---|
[77] | 39 | ! |
---|
[772] | 40 | ! 771 2011-10-27 10:56:21Z heinze |
---|
| 41 | ! +lpt_av |
---|
| 42 | ! |
---|
[668] | 43 | ! 667 2010-12-23 12:06:00Z suehring/gryschka |
---|
| 44 | ! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng |
---|
| 45 | ! |
---|
[392] | 46 | ! 367 2009-08-25 08:35:52Z maronga |
---|
| 47 | ! Added calculation of shf* and qsws* |
---|
| 48 | ! |
---|
[98] | 49 | ! 96 2007-06-04 08:07:41Z raasch |
---|
| 50 | ! Averaging of density and salinity |
---|
| 51 | ! |
---|
[77] | 52 | ! 72 2007-03-19 08:20:46Z raasch |
---|
| 53 | ! Averaging the precipitation rate and roughness length (prr*, z0*) |
---|
| 54 | ! |
---|
[3] | 55 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 56 | ! |
---|
[1] | 57 | ! Revision 1.1 2006/02/23 09:48:58 raasch |
---|
| 58 | ! Initial revision |
---|
| 59 | ! |
---|
| 60 | ! |
---|
| 61 | ! Description: |
---|
| 62 | ! ------------ |
---|
| 63 | ! Time-averaging of 3d-data-arrays. |
---|
| 64 | !------------------------------------------------------------------------------! |
---|
| 65 | |
---|
| 66 | USE arrays_3d |
---|
| 67 | USE averaging |
---|
| 68 | USE cloud_parameters |
---|
| 69 | USE control_parameters |
---|
| 70 | USE cpulog |
---|
| 71 | USE indices |
---|
| 72 | USE interfaces |
---|
| 73 | |
---|
| 74 | IMPLICIT NONE |
---|
| 75 | |
---|
| 76 | INTEGER :: i, ii, j, k |
---|
| 77 | |
---|
| 78 | |
---|
| 79 | CALL cpu_log (log_point(35),'average_3d_data','start') |
---|
| 80 | |
---|
| 81 | ! |
---|
| 82 | !-- Check, if averaging is necessary |
---|
| 83 | IF ( average_count_3d <= 1 ) RETURN |
---|
| 84 | |
---|
| 85 | ! |
---|
| 86 | !-- Loop of all variables to be averaged. |
---|
| 87 | DO ii = 1, doav_n |
---|
| 88 | |
---|
| 89 | ! |
---|
| 90 | !-- Store the array chosen on the temporary array. |
---|
| 91 | SELECT CASE ( TRIM( doav(ii) ) ) |
---|
| 92 | |
---|
| 93 | CASE ( 'e' ) |
---|
[667] | 94 | DO i = nxlg, nxrg |
---|
| 95 | DO j = nysg, nyng |
---|
[1] | 96 | DO k = nzb, nzt+1 |
---|
| 97 | e_av(k,j,i) = e_av(k,j,i) / REAL( average_count_3d ) |
---|
| 98 | ENDDO |
---|
| 99 | ENDDO |
---|
| 100 | ENDDO |
---|
| 101 | |
---|
[354] | 102 | CASE ( 'qsws*' ) |
---|
[667] | 103 | DO i = nxlg, nxrg |
---|
| 104 | DO j = nysg, nyng |
---|
[354] | 105 | qsws_av(j,i) = qsws_av(j,i) / REAL( average_count_3d ) |
---|
| 106 | ENDDO |
---|
| 107 | ENDDO |
---|
| 108 | |
---|
[771] | 109 | CASE ( 'lpt' ) |
---|
| 110 | DO i = nxlg, nxrg |
---|
| 111 | DO j = nysg, nyng |
---|
| 112 | DO k = nzb, nzt+1 |
---|
| 113 | lpt_av(k,j,i) = lpt_av(k,j,i) / REAL( average_count_3d ) |
---|
| 114 | ENDDO |
---|
| 115 | ENDDO |
---|
| 116 | ENDDO |
---|
| 117 | |
---|
[1] | 118 | CASE ( 'lwp*' ) |
---|
[667] | 119 | DO i = nxlg, nxrg |
---|
| 120 | DO j = nysg, nyng |
---|
[1] | 121 | lwp_av(j,i) = lwp_av(j,i) / REAL( average_count_3d ) |
---|
| 122 | ENDDO |
---|
| 123 | ENDDO |
---|
| 124 | |
---|
[1053] | 125 | CASE ( 'nr' ) |
---|
| 126 | DO i = nxlg, nxrg |
---|
| 127 | DO j = nysg, nyng |
---|
| 128 | DO k = nzb, nzt+1 |
---|
| 129 | nr_av(k,j,i) = nr_av(k,j,i) / REAL( average_count_3d ) |
---|
| 130 | ENDDO |
---|
| 131 | ENDDO |
---|
| 132 | ENDDO |
---|
| 133 | |
---|
[1] | 134 | CASE ( 'p' ) |
---|
[667] | 135 | DO i = nxlg, nxrg |
---|
| 136 | DO j = nysg, nyng |
---|
[1] | 137 | DO k = nzb, nzt+1 |
---|
| 138 | p_av(k,j,i) = p_av(k,j,i) / REAL( average_count_3d ) |
---|
| 139 | ENDDO |
---|
| 140 | ENDDO |
---|
| 141 | ENDDO |
---|
| 142 | |
---|
| 143 | CASE ( 'pc' ) |
---|
| 144 | DO i = nxl, nxr |
---|
| 145 | DO j = nys, nyn |
---|
| 146 | DO k = nzb, nzt+1 |
---|
| 147 | pc_av(k,j,i) = pc_av(k,j,i) / REAL( average_count_3d ) |
---|
| 148 | ENDDO |
---|
| 149 | ENDDO |
---|
| 150 | ENDDO |
---|
| 151 | |
---|
| 152 | CASE ( 'pr' ) |
---|
| 153 | DO i = nxl, nxr |
---|
| 154 | DO j = nys, nyn |
---|
| 155 | DO k = nzb, nzt+1 |
---|
| 156 | pr_av(k,j,i) = pr_av(k,j,i) / REAL( average_count_3d ) |
---|
| 157 | ENDDO |
---|
| 158 | ENDDO |
---|
| 159 | ENDDO |
---|
| 160 | |
---|
[72] | 161 | CASE ( 'prr*' ) |
---|
[667] | 162 | DO i = nxlg, nxrg |
---|
| 163 | DO j = nysg, nyng |
---|
[72] | 164 | precipitation_rate_av(j,i) = precipitation_rate_av(j,i) / & |
---|
| 165 | REAL( average_count_3d ) |
---|
| 166 | ENDDO |
---|
| 167 | ENDDO |
---|
| 168 | |
---|
[1] | 169 | CASE ( 'pt' ) |
---|
[667] | 170 | DO i = nxlg, nxrg |
---|
| 171 | DO j = nysg, nyng |
---|
[1] | 172 | DO k = nzb, nzt+1 |
---|
| 173 | pt_av(k,j,i) = pt_av(k,j,i) / REAL( average_count_3d ) |
---|
| 174 | ENDDO |
---|
| 175 | ENDDO |
---|
| 176 | ENDDO |
---|
| 177 | |
---|
| 178 | CASE ( 'q' ) |
---|
[667] | 179 | DO i = nxlg, nxrg |
---|
| 180 | DO j = nysg, nyng |
---|
[1] | 181 | DO k = nzb, nzt+1 |
---|
| 182 | q_av(k,j,i) = q_av(k,j,i) / REAL( average_count_3d ) |
---|
| 183 | ENDDO |
---|
| 184 | ENDDO |
---|
| 185 | ENDDO |
---|
[367] | 186 | |
---|
[1115] | 187 | CASE ( 'qc' ) |
---|
| 188 | DO i = nxlg, nxrg |
---|
| 189 | DO j = nysg, nyng |
---|
| 190 | DO k = nzb, nzt+1 |
---|
| 191 | qc_av(k,j,i) = qc_av(k,j,i) / REAL( average_count_3d ) |
---|
| 192 | ENDDO |
---|
| 193 | ENDDO |
---|
| 194 | ENDDO |
---|
| 195 | |
---|
[1] | 196 | CASE ( 'ql' ) |
---|
[667] | 197 | DO i = nxlg, nxrg |
---|
| 198 | DO j = nysg, nyng |
---|
[1] | 199 | DO k = nzb, nzt+1 |
---|
| 200 | ql_av(k,j,i) = ql_av(k,j,i) / REAL( average_count_3d ) |
---|
| 201 | ENDDO |
---|
| 202 | ENDDO |
---|
| 203 | ENDDO |
---|
| 204 | |
---|
| 205 | CASE ( 'ql_c' ) |
---|
[667] | 206 | DO i = nxlg, nxrg |
---|
| 207 | DO j = nysg, nyng |
---|
[1] | 208 | DO k = nzb, nzt+1 |
---|
| 209 | ql_c_av(k,j,i) = ql_c_av(k,j,i) / REAL( average_count_3d ) |
---|
| 210 | ENDDO |
---|
| 211 | ENDDO |
---|
| 212 | ENDDO |
---|
| 213 | |
---|
| 214 | CASE ( 'ql_v' ) |
---|
[667] | 215 | DO i = nxlg, nxrg |
---|
| 216 | DO j = nysg, nyng |
---|
[1] | 217 | DO k = nzb, nzt+1 |
---|
| 218 | ql_v_av(k,j,i) = ql_v_av(k,j,i) / REAL( average_count_3d ) |
---|
| 219 | ENDDO |
---|
| 220 | ENDDO |
---|
| 221 | ENDDO |
---|
| 222 | |
---|
| 223 | CASE ( 'ql_vp' ) |
---|
[667] | 224 | DO i = nxlg, nxrg |
---|
| 225 | DO j = nysg, nyng |
---|
[1] | 226 | DO k = nzb, nzt+1 |
---|
| 227 | ql_vp_av(k,j,i) = ql_vp_av(k,j,i) / & |
---|
| 228 | REAL( average_count_3d ) |
---|
| 229 | ENDDO |
---|
| 230 | ENDDO |
---|
| 231 | ENDDO |
---|
| 232 | |
---|
[1053] | 233 | CASE ( 'qr' ) |
---|
| 234 | DO i = nxlg, nxrg |
---|
| 235 | DO j = nysg, nyng |
---|
| 236 | DO k = nzb, nzt+1 |
---|
| 237 | qr_av(k,j,i) = qr_av(k,j,i) / REAL( average_count_3d ) |
---|
| 238 | ENDDO |
---|
| 239 | ENDDO |
---|
| 240 | ENDDO |
---|
| 241 | |
---|
[1] | 242 | CASE ( 'qv' ) |
---|
[667] | 243 | DO i = nxlg, nxrg |
---|
| 244 | DO j = nysg, nyng |
---|
[1] | 245 | DO k = nzb, nzt+1 |
---|
| 246 | qv_av(k,j,i) = qv_av(k,j,i) / REAL( average_count_3d ) |
---|
| 247 | ENDDO |
---|
| 248 | ENDDO |
---|
| 249 | ENDDO |
---|
[367] | 250 | |
---|
[96] | 251 | CASE ( 'rho' ) |
---|
[667] | 252 | DO i = nxlg, nxrg |
---|
| 253 | DO j = nysg, nyng |
---|
[96] | 254 | DO k = nzb, nzt+1 |
---|
| 255 | rho_av(k,j,i) = rho_av(k,j,i) / REAL( average_count_3d ) |
---|
| 256 | ENDDO |
---|
| 257 | ENDDO |
---|
| 258 | ENDDO |
---|
[367] | 259 | |
---|
[1] | 260 | CASE ( 's' ) |
---|
[667] | 261 | DO i = nxlg, nxrg |
---|
| 262 | DO j = nysg, nyng |
---|
[1] | 263 | DO k = nzb, nzt+1 |
---|
| 264 | s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d ) |
---|
| 265 | ENDDO |
---|
| 266 | ENDDO |
---|
| 267 | ENDDO |
---|
[367] | 268 | |
---|
[96] | 269 | CASE ( 'sa' ) |
---|
[667] | 270 | DO i = nxlg, nxrg |
---|
| 271 | DO j = nysg, nyng |
---|
[96] | 272 | DO k = nzb, nzt+1 |
---|
| 273 | sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d ) |
---|
| 274 | ENDDO |
---|
| 275 | ENDDO |
---|
| 276 | ENDDO |
---|
[367] | 277 | |
---|
[354] | 278 | CASE ( 'shf*' ) |
---|
[667] | 279 | DO i = nxlg, nxrg |
---|
| 280 | DO j = nysg, nyng |
---|
[354] | 281 | shf_av(j,i) = shf_av(j,i) / REAL( average_count_3d ) |
---|
| 282 | ENDDO |
---|
| 283 | ENDDO |
---|
[367] | 284 | |
---|
[1] | 285 | CASE ( 't*' ) |
---|
[667] | 286 | DO i = nxlg, nxrg |
---|
| 287 | DO j = nysg, nyng |
---|
[1] | 288 | ts_av(j,i) = ts_av(j,i) / REAL( average_count_3d ) |
---|
| 289 | ENDDO |
---|
| 290 | ENDDO |
---|
| 291 | |
---|
| 292 | CASE ( 'u' ) |
---|
[667] | 293 | DO i = nxlg, nxrg |
---|
| 294 | DO j = nysg, nyng |
---|
[1] | 295 | DO k = nzb, nzt+1 |
---|
| 296 | u_av(k,j,i) = u_av(k,j,i) / REAL( average_count_3d ) |
---|
| 297 | ENDDO |
---|
| 298 | ENDDO |
---|
| 299 | ENDDO |
---|
| 300 | |
---|
| 301 | CASE ( 'u*' ) |
---|
[667] | 302 | DO i = nxlg, nxrg |
---|
| 303 | DO j = nysg, nyng |
---|
[1] | 304 | us_av(j,i) = us_av(j,i) / REAL( average_count_3d ) |
---|
| 305 | ENDDO |
---|
| 306 | ENDDO |
---|
| 307 | |
---|
| 308 | CASE ( 'v' ) |
---|
[667] | 309 | DO i = nxlg, nxrg |
---|
| 310 | DO j = nysg, nyng |
---|
[1] | 311 | DO k = nzb, nzt+1 |
---|
| 312 | v_av(k,j,i) = v_av(k,j,i) / REAL( average_count_3d ) |
---|
| 313 | ENDDO |
---|
| 314 | ENDDO |
---|
| 315 | ENDDO |
---|
| 316 | |
---|
| 317 | CASE ( 'vpt' ) |
---|
[667] | 318 | DO i = nxlg, nxrg |
---|
| 319 | DO j = nysg, nyng |
---|
[1] | 320 | DO k = nzb, nzt+1 |
---|
| 321 | vpt_av(k,j,i) = vpt_av(k,j,i) / REAL( average_count_3d ) |
---|
| 322 | ENDDO |
---|
| 323 | ENDDO |
---|
| 324 | ENDDO |
---|
| 325 | |
---|
| 326 | CASE ( 'w' ) |
---|
[667] | 327 | DO i = nxlg, nxrg |
---|
| 328 | DO j = nysg, nyng |
---|
[1] | 329 | DO k = nzb, nzt+1 |
---|
| 330 | w_av(k,j,i) = w_av(k,j,i) / REAL( average_count_3d ) |
---|
| 331 | ENDDO |
---|
| 332 | ENDDO |
---|
| 333 | ENDDO |
---|
| 334 | |
---|
[72] | 335 | CASE ( 'z0*' ) |
---|
[667] | 336 | DO i = nxlg, nxrg |
---|
| 337 | DO j = nysg, nyng |
---|
[72] | 338 | z0_av(j,i) = z0_av(j,i) / REAL( average_count_3d ) |
---|
| 339 | ENDDO |
---|
| 340 | ENDDO |
---|
| 341 | |
---|
[978] | 342 | CASE ( 'z0h*' ) |
---|
| 343 | DO i = nxlg, nxrg |
---|
| 344 | DO j = nysg, nyng |
---|
| 345 | z0h_av(j,i) = z0h_av(j,i) / REAL( average_count_3d ) |
---|
| 346 | ENDDO |
---|
| 347 | ENDDO |
---|
| 348 | |
---|
[1] | 349 | CASE DEFAULT |
---|
| 350 | ! |
---|
| 351 | !-- User-defined quantity |
---|
| 352 | CALL user_3d_data_averaging( 'average', doav(ii) ) |
---|
| 353 | |
---|
| 354 | END SELECT |
---|
| 355 | |
---|
| 356 | ENDDO |
---|
| 357 | |
---|
| 358 | ! |
---|
| 359 | !-- Reset the counter |
---|
| 360 | average_count_3d = 0.0 |
---|
| 361 | |
---|
| 362 | CALL cpu_log (log_point(35),'average_3d_data','stop','nobarrier') |
---|
| 363 | |
---|
| 364 | |
---|
| 365 | END SUBROUTINE average_3d_data |
---|