[1873] | 1 | !> @file diffusion_v.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[1036] | 3 | ! This file is part of PALM. |
---|
| 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 | ! |
---|
[2101] | 17 | ! Copyright 1997-2017 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1341] | 22 | ! |
---|
[2119] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: diffusion_v.f90 2119 2017-01-17 16:51:50Z hoffmann $ |
---|
| 27 | ! |
---|
[2119] | 28 | ! 2118 2017-01-17 16:38:49Z raasch |
---|
| 29 | ! OpenACC version of subroutine removed |
---|
| 30 | ! |
---|
[2038] | 31 | ! 2037 2016-10-26 11:15:40Z knoop |
---|
| 32 | ! Anelastic approximation implemented |
---|
| 33 | ! |
---|
[2001] | 34 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 35 | ! Forced header and separation lines into 80 columns |
---|
| 36 | ! |
---|
[1874] | 37 | ! 1873 2016-04-18 14:50:06Z maronga |
---|
| 38 | ! Module renamed (removed _mod) |
---|
| 39 | ! |
---|
[1851] | 40 | ! 1850 2016-04-08 13:29:27Z maronga |
---|
| 41 | ! Module renamed |
---|
| 42 | ! |
---|
[1741] | 43 | ! 1740 2016-01-13 08:19:40Z raasch |
---|
| 44 | ! unnecessary calculations of kmzm and kmzp in wall bounded parts removed |
---|
| 45 | ! |
---|
[1683] | 46 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 47 | ! Code annotations made doxygen readable |
---|
| 48 | ! |
---|
[1341] | 49 | ! 1340 2014-03-25 19:45:13Z kanani |
---|
| 50 | ! REAL constants defined as wp-kind |
---|
| 51 | ! |
---|
[1321] | 52 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 53 | ! ONLY-attribute added to USE-statements, |
---|
| 54 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 55 | ! kinds are defined in new module kinds, |
---|
| 56 | ! revision history before 2012 removed, |
---|
| 57 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 58 | ! all variable declaration statements |
---|
[1321] | 59 | ! |
---|
[1258] | 60 | ! 1257 2013-11-08 15:18:40Z raasch |
---|
| 61 | ! openacc loop and loop vector clauses removed, declare create moved after |
---|
| 62 | ! the FORTRAN declaration statement |
---|
| 63 | ! |
---|
[1132] | 64 | ! 1128 2013-04-12 06:19:32Z raasch |
---|
| 65 | ! loop index bounds in accelerator version replaced by i_left, i_right, j_south, |
---|
| 66 | ! j_north |
---|
| 67 | ! |
---|
[1037] | 68 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 69 | ! code put under GPL (PALM 3.9) |
---|
| 70 | ! |
---|
[1017] | 71 | ! 1015 2012-09-27 09:23:24Z raasch |
---|
| 72 | ! accelerator version (*_acc) added |
---|
| 73 | ! |
---|
[1002] | 74 | ! 1001 2012-09-13 14:08:46Z raasch |
---|
| 75 | ! arrays comunicated by module instead of parameter list |
---|
| 76 | ! |
---|
[979] | 77 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 78 | ! outflow damping layer removed |
---|
| 79 | ! kmxm_x/_y and kmxp_x/_y change to kmxm and kmxp |
---|
| 80 | ! |
---|
[1] | 81 | ! Revision 1.1 1997/09/12 06:24:01 raasch |
---|
| 82 | ! Initial revision |
---|
| 83 | ! |
---|
| 84 | ! |
---|
| 85 | ! Description: |
---|
| 86 | ! ------------ |
---|
[1682] | 87 | !> Diffusion term of the v-component |
---|
[1] | 88 | !------------------------------------------------------------------------------! |
---|
[1682] | 89 | MODULE diffusion_v_mod |
---|
| 90 | |
---|
[1] | 91 | |
---|
[56] | 92 | USE wall_fluxes_mod |
---|
| 93 | |
---|
[1] | 94 | PRIVATE |
---|
[2118] | 95 | PUBLIC diffusion_v |
---|
[1] | 96 | |
---|
| 97 | INTERFACE diffusion_v |
---|
| 98 | MODULE PROCEDURE diffusion_v |
---|
| 99 | MODULE PROCEDURE diffusion_v_ij |
---|
| 100 | END INTERFACE diffusion_v |
---|
| 101 | |
---|
| 102 | CONTAINS |
---|
| 103 | |
---|
| 104 | |
---|
| 105 | !------------------------------------------------------------------------------! |
---|
[1682] | 106 | ! Description: |
---|
| 107 | ! ------------ |
---|
| 108 | !> Call for all grid points |
---|
[1] | 109 | !------------------------------------------------------------------------------! |
---|
[1001] | 110 | SUBROUTINE diffusion_v |
---|
[1] | 111 | |
---|
[1320] | 112 | USE arrays_3d, & |
---|
[2037] | 113 | ONLY: ddzu, ddzw, km, tend, u, v, vsws, vswst, w, & |
---|
| 114 | drho_air, rho_air_zw |
---|
[1320] | 115 | |
---|
| 116 | USE control_parameters, & |
---|
| 117 | ONLY: constant_top_momentumflux, topography, use_surface_fluxes, & |
---|
| 118 | use_top_fluxes |
---|
| 119 | |
---|
| 120 | USE grid_variables, & |
---|
| 121 | ONLY: ddx, ddy, ddy2, fxm, fxp, wall_v |
---|
| 122 | |
---|
| 123 | USE indices, & |
---|
| 124 | ONLY: nxl, nxr, nyn, nys, nysv, nzb, nzb_diff_v, nzb_v_inner, & |
---|
| 125 | nzb_v_outer, nzt, nzt_diff |
---|
| 126 | |
---|
| 127 | USE kinds |
---|
[1] | 128 | |
---|
| 129 | IMPLICIT NONE |
---|
| 130 | |
---|
[1682] | 131 | INTEGER(iwp) :: i !< |
---|
| 132 | INTEGER(iwp) :: j !< |
---|
| 133 | INTEGER(iwp) :: k !< |
---|
| 134 | REAL(wp) :: kmxm !< |
---|
| 135 | REAL(wp) :: kmxp !< |
---|
| 136 | REAL(wp) :: kmzm !< |
---|
| 137 | REAL(wp) :: kmzp !< |
---|
[1001] | 138 | |
---|
[1682] | 139 | REAL(wp), DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) :: vsus !< |
---|
[1] | 140 | |
---|
[56] | 141 | ! |
---|
| 142 | !-- First calculate horizontal momentum flux v'u' at vertical walls, |
---|
| 143 | !-- if neccessary |
---|
| 144 | IF ( topography /= 'flat' ) THEN |
---|
[1320] | 145 | CALL wall_fluxes( vsus, 0.0_wp, 1.0_wp, 0.0_wp, 0.0_wp, nzb_v_inner, & |
---|
[56] | 146 | nzb_v_outer, wall_v ) |
---|
| 147 | ENDIF |
---|
| 148 | |
---|
[1] | 149 | DO i = nxl, nxr |
---|
[106] | 150 | DO j = nysv, nyn |
---|
[1] | 151 | ! |
---|
| 152 | !-- Compute horizontal diffusion |
---|
| 153 | DO k = nzb_v_outer(j,i)+1, nzt |
---|
| 154 | ! |
---|
| 155 | !-- Interpolate eddy diffusivities on staggered gridpoints |
---|
[1340] | 156 | kmxp = 0.25_wp * & |
---|
[978] | 157 | ( km(k,j,i)+km(k,j,i+1)+km(k,j-1,i)+km(k,j-1,i+1) ) |
---|
[1340] | 158 | kmxm = 0.25_wp * & |
---|
[978] | 159 | ( km(k,j,i)+km(k,j,i-1)+km(k,j-1,i)+km(k,j-1,i-1) ) |
---|
[1] | 160 | |
---|
[1320] | 161 | tend(k,j,i) = tend(k,j,i) & |
---|
| 162 | & + ( kmxp * ( v(k,j,i+1) - v(k,j,i) ) * ddx & |
---|
| 163 | & + kmxp * ( u(k,j,i+1) - u(k,j-1,i+1) ) * ddy & |
---|
| 164 | & - kmxm * ( v(k,j,i) - v(k,j,i-1) ) * ddx & |
---|
| 165 | & - kmxm * ( u(k,j,i) - u(k,j-1,i) ) * ddy & |
---|
| 166 | & ) * ddx & |
---|
[1340] | 167 | & + 2.0_wp * ( & |
---|
[1320] | 168 | & km(k,j,i) * ( v(k,j+1,i) - v(k,j,i) ) & |
---|
| 169 | & - km(k,j-1,i) * ( v(k,j,i) - v(k,j-1,i) ) & |
---|
[1340] | 170 | & ) * ddy2 |
---|
[1] | 171 | ENDDO |
---|
| 172 | |
---|
| 173 | ! |
---|
| 174 | !-- Wall functions at the left and right walls, respectively |
---|
[1340] | 175 | IF ( wall_v(j,i) /= 0.0_wp ) THEN |
---|
[51] | 176 | |
---|
[1] | 177 | DO k = nzb_v_inner(j,i)+1, nzb_v_outer(j,i) |
---|
[1340] | 178 | kmxp = 0.25_wp * & |
---|
[978] | 179 | ( km(k,j,i)+km(k,j,i+1)+km(k,j-1,i)+km(k,j-1,i+1) ) |
---|
[1340] | 180 | kmxm = 0.25_wp * & |
---|
[978] | 181 | ( km(k,j,i)+km(k,j,i-1)+km(k,j-1,i)+km(k,j-1,i-1) ) |
---|
| 182 | |
---|
[1] | 183 | tend(k,j,i) = tend(k,j,i) & |
---|
[1340] | 184 | + 2.0_wp * ( & |
---|
[1] | 185 | km(k,j,i) * ( v(k,j+1,i) - v(k,j,i) ) & |
---|
| 186 | - km(k,j-1,i) * ( v(k,j,i) - v(k,j-1,i) ) & |
---|
[1340] | 187 | ) * ddy2 & |
---|
[1] | 188 | + ( fxp(j,i) * ( & |
---|
[978] | 189 | kmxp * ( v(k,j,i+1) - v(k,j,i) ) * ddx & |
---|
| 190 | + kmxp * ( u(k,j,i+1) - u(k,j-1,i+1) ) * ddy & |
---|
[1] | 191 | ) & |
---|
| 192 | - fxm(j,i) * ( & |
---|
[978] | 193 | kmxm * ( v(k,j,i) - v(k,j,i-1) ) * ddx & |
---|
| 194 | + kmxm * ( u(k,j,i) - u(k,j-1,i) ) * ddy & |
---|
[1] | 195 | ) & |
---|
[56] | 196 | + wall_v(j,i) * vsus(k,j,i) & |
---|
[1] | 197 | ) * ddx |
---|
| 198 | ENDDO |
---|
| 199 | ENDIF |
---|
| 200 | |
---|
| 201 | ! |
---|
| 202 | !-- Compute vertical diffusion. In case of simulating a Prandtl |
---|
| 203 | !-- layer, index k starts at nzb_v_inner+2. |
---|
[102] | 204 | DO k = nzb_diff_v(j,i), nzt_diff |
---|
[1] | 205 | ! |
---|
| 206 | !-- Interpolate eddy diffusivities on staggered gridpoints |
---|
[1340] | 207 | kmzp = 0.25_wp * & |
---|
[1] | 208 | ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) ) |
---|
[1340] | 209 | kmzm = 0.25_wp * & |
---|
[1] | 210 | ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) ) |
---|
| 211 | |
---|
[1320] | 212 | tend(k,j,i) = tend(k,j,i) & |
---|
| 213 | & + ( kmzp * ( ( v(k+1,j,i) - v(k,j,i) ) * ddzu(k+1) & |
---|
| 214 | & + ( w(k,j,i) - w(k,j-1,i) ) * ddy & |
---|
[2037] | 215 | & ) * rho_air_zw(k) & |
---|
[1320] | 216 | & - kmzm * ( ( v(k,j,i) - v(k-1,j,i) ) * ddzu(k) & |
---|
| 217 | & + ( w(k-1,j,i) - w(k-1,j-1,i) ) * ddy & |
---|
[2037] | 218 | & ) * rho_air_zw(k-1) & |
---|
| 219 | & ) * ddzw(k) * drho_air(k) |
---|
[1] | 220 | ENDDO |
---|
| 221 | |
---|
| 222 | ! |
---|
| 223 | !-- Vertical diffusion at the first grid point above the surface, |
---|
| 224 | !-- if the momentum flux at the bottom is given by the Prandtl law |
---|
| 225 | !-- or if it is prescribed by the user. |
---|
| 226 | !-- Difference quotient of the momentum flux is not formed over |
---|
| 227 | !-- half of the grid spacing (2.0*ddzw(k)) any more, since the |
---|
[1320] | 228 | !-- comparison with other (LES) models showed that the values of |
---|
[1] | 229 | !-- the momentum flux becomes too large in this case. |
---|
| 230 | !-- The term containing w(k-1,..) (see above equation) is removed here |
---|
| 231 | !-- because the vertical velocity is assumed to be zero at the surface. |
---|
| 232 | IF ( use_surface_fluxes ) THEN |
---|
| 233 | k = nzb_v_inner(j,i)+1 |
---|
| 234 | ! |
---|
| 235 | !-- Interpolate eddy diffusivities on staggered gridpoints |
---|
[1340] | 236 | kmzp = 0.25_wp * & |
---|
[1] | 237 | ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) ) |
---|
| 238 | |
---|
[1320] | 239 | tend(k,j,i) = tend(k,j,i) & |
---|
[2037] | 240 | & + ( kmzp * ( ( v(k+1,j,i) - v(k,j,i) ) * ddzu(k+1) & |
---|
| 241 | & + ( w(k,j,i) - w(k,j-1,i) ) * ddy & |
---|
| 242 | & ) * rho_air_zw(k) & |
---|
| 243 | & - ( -vsws(j,i) ) & |
---|
| 244 | & ) * ddzw(k) * drho_air(k) |
---|
[1] | 245 | ENDIF |
---|
| 246 | |
---|
[102] | 247 | ! |
---|
| 248 | !-- Vertical diffusion at the first gridpoint below the top boundary, |
---|
| 249 | !-- if the momentum flux at the top is prescribed by the user |
---|
[103] | 250 | IF ( use_top_fluxes .AND. constant_top_momentumflux ) THEN |
---|
[102] | 251 | k = nzt |
---|
| 252 | ! |
---|
| 253 | !-- Interpolate eddy diffusivities on staggered gridpoints |
---|
[1340] | 254 | kmzm = 0.25_wp * & |
---|
[102] | 255 | ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) ) |
---|
| 256 | |
---|
[1320] | 257 | tend(k,j,i) = tend(k,j,i) & |
---|
[2037] | 258 | & + ( ( -vswst(j,i) ) & |
---|
| 259 | & - kmzm * ( ( v(k,j,i) - v(k-1,j,i) ) * ddzu(k) & |
---|
| 260 | & + ( w(k-1,j,i) - w(k-1,j-1,i) ) * ddy & |
---|
| 261 | & ) * rho_air_zw(k-1) & |
---|
| 262 | & ) * ddzw(k) * drho_air(k) |
---|
[102] | 263 | ENDIF |
---|
| 264 | |
---|
[1] | 265 | ENDDO |
---|
| 266 | ENDDO |
---|
| 267 | |
---|
| 268 | END SUBROUTINE diffusion_v |
---|
| 269 | |
---|
| 270 | |
---|
| 271 | !------------------------------------------------------------------------------! |
---|
[1682] | 272 | ! Description: |
---|
| 273 | ! ------------ |
---|
| 274 | !> Call for grid point i,j |
---|
[1] | 275 | !------------------------------------------------------------------------------! |
---|
[1001] | 276 | SUBROUTINE diffusion_v_ij( i, j ) |
---|
[1] | 277 | |
---|
[1320] | 278 | USE arrays_3d, & |
---|
[2037] | 279 | ONLY: ddzu, ddzw, km, tend, u, v, vsws, vswst, w, & |
---|
| 280 | drho_air, rho_air_zw |
---|
[1320] | 281 | |
---|
| 282 | USE control_parameters, & |
---|
| 283 | ONLY: constant_top_momentumflux, use_surface_fluxes, use_top_fluxes |
---|
| 284 | |
---|
| 285 | USE grid_variables, & |
---|
| 286 | ONLY: ddx, ddy, ddy2, fxm, fxp, wall_v |
---|
| 287 | |
---|
| 288 | USE indices, & |
---|
| 289 | ONLY: nzb, nzb_diff_v, nzb_v_inner, nzb_v_outer, nzt, nzt_diff |
---|
| 290 | |
---|
| 291 | USE kinds |
---|
[1] | 292 | |
---|
| 293 | IMPLICIT NONE |
---|
| 294 | |
---|
[1682] | 295 | INTEGER(iwp) :: i !< |
---|
| 296 | INTEGER(iwp) :: j !< |
---|
| 297 | INTEGER(iwp) :: k !< |
---|
| 298 | REAL(wp) :: kmxm !< |
---|
| 299 | REAL(wp) :: kmxp !< |
---|
| 300 | REAL(wp) :: kmzm !< |
---|
| 301 | REAL(wp) :: kmzp !< |
---|
[1] | 302 | |
---|
[1682] | 303 | REAL(wp), DIMENSION(nzb:nzt+1) :: vsus !< |
---|
[1001] | 304 | |
---|
[1] | 305 | ! |
---|
| 306 | !-- Compute horizontal diffusion |
---|
| 307 | DO k = nzb_v_outer(j,i)+1, nzt |
---|
| 308 | ! |
---|
| 309 | !-- Interpolate eddy diffusivities on staggered gridpoints |
---|
[1340] | 310 | kmxp = 0.25_wp * ( km(k,j,i)+km(k,j,i+1)+km(k,j-1,i)+km(k,j-1,i+1) ) |
---|
| 311 | kmxm = 0.25_wp * ( km(k,j,i)+km(k,j,i-1)+km(k,j-1,i)+km(k,j-1,i-1) ) |
---|
[1] | 312 | |
---|
[1320] | 313 | tend(k,j,i) = tend(k,j,i) & |
---|
| 314 | & + ( kmxp * ( v(k,j,i+1) - v(k,j,i) ) * ddx & |
---|
| 315 | & + kmxp * ( u(k,j,i+1) - u(k,j-1,i+1) ) * ddy & |
---|
| 316 | & - kmxm * ( v(k,j,i) - v(k,j,i-1) ) * ddx & |
---|
| 317 | & - kmxm * ( u(k,j,i) - u(k,j-1,i) ) * ddy & |
---|
| 318 | & ) * ddx & |
---|
[1340] | 319 | & + 2.0_wp * ( & |
---|
[1320] | 320 | & km(k,j,i) * ( v(k,j+1,i) - v(k,j,i) ) & |
---|
| 321 | & - km(k,j-1,i) * ( v(k,j,i) - v(k,j-1,i) ) & |
---|
[1340] | 322 | & ) * ddy2 |
---|
[1] | 323 | ENDDO |
---|
| 324 | |
---|
| 325 | ! |
---|
| 326 | !-- Wall functions at the left and right walls, respectively |
---|
[1340] | 327 | IF ( wall_v(j,i) /= 0.0_wp ) THEN |
---|
[51] | 328 | |
---|
| 329 | ! |
---|
| 330 | !-- Calculate the horizontal momentum flux v'u' |
---|
[1320] | 331 | CALL wall_fluxes( i, j, nzb_v_inner(j,i)+1, nzb_v_outer(j,i), & |
---|
| 332 | vsus, 0.0_wp, 1.0_wp, 0.0_wp, 0.0_wp ) |
---|
[51] | 333 | |
---|
[1] | 334 | DO k = nzb_v_inner(j,i)+1, nzb_v_outer(j,i) |
---|
[1340] | 335 | kmxp = 0.25_wp * & |
---|
[978] | 336 | ( km(k,j,i)+km(k,j,i+1)+km(k,j-1,i)+km(k,j-1,i+1) ) |
---|
[1340] | 337 | kmxm = 0.25_wp * & |
---|
[978] | 338 | ( km(k,j,i)+km(k,j,i-1)+km(k,j-1,i)+km(k,j-1,i-1) ) |
---|
[1] | 339 | |
---|
| 340 | tend(k,j,i) = tend(k,j,i) & |
---|
[1340] | 341 | + 2.0_wp * ( & |
---|
[1] | 342 | km(k,j,i) * ( v(k,j+1,i) - v(k,j,i) ) & |
---|
| 343 | - km(k,j-1,i) * ( v(k,j,i) - v(k,j-1,i) ) & |
---|
[1340] | 344 | ) * ddy2 & |
---|
[1] | 345 | + ( fxp(j,i) * ( & |
---|
[978] | 346 | kmxp * ( v(k,j,i+1) - v(k,j,i) ) * ddx & |
---|
| 347 | + kmxp * ( u(k,j,i+1) - u(k,j-1,i+1) ) * ddy & |
---|
[1] | 348 | ) & |
---|
| 349 | - fxm(j,i) * ( & |
---|
[978] | 350 | kmxm * ( v(k,j,i) - v(k,j,i-1) ) * ddx & |
---|
| 351 | + kmxm * ( u(k,j,i) - u(k,j-1,i) ) * ddy & |
---|
[1] | 352 | ) & |
---|
[51] | 353 | + wall_v(j,i) * vsus(k) & |
---|
[1] | 354 | ) * ddx |
---|
| 355 | ENDDO |
---|
| 356 | ENDIF |
---|
| 357 | |
---|
| 358 | ! |
---|
| 359 | !-- Compute vertical diffusion. In case of simulating a Prandtl layer, |
---|
| 360 | !-- index k starts at nzb_v_inner+2. |
---|
[102] | 361 | DO k = nzb_diff_v(j,i), nzt_diff |
---|
[1] | 362 | ! |
---|
| 363 | !-- Interpolate eddy diffusivities on staggered gridpoints |
---|
[1340] | 364 | kmzp = 0.25_wp * ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) ) |
---|
| 365 | kmzm = 0.25_wp * ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) ) |
---|
[1] | 366 | |
---|
[1320] | 367 | tend(k,j,i) = tend(k,j,i) & |
---|
| 368 | & + ( kmzp * ( ( v(k+1,j,i) - v(k,j,i) ) * ddzu(k+1) & |
---|
| 369 | & + ( w(k,j,i) - w(k,j-1,i) ) * ddy & |
---|
[2037] | 370 | & ) * rho_air_zw(k) & |
---|
[1320] | 371 | & - kmzm * ( ( v(k,j,i) - v(k-1,j,i) ) * ddzu(k) & |
---|
| 372 | & + ( w(k-1,j,i) - w(k-1,j-1,i) ) * ddy & |
---|
[2037] | 373 | & ) * rho_air_zw(k-1) & |
---|
| 374 | & ) * ddzw(k) * drho_air(k) |
---|
[1] | 375 | ENDDO |
---|
| 376 | |
---|
| 377 | ! |
---|
| 378 | !-- Vertical diffusion at the first grid point above the surface, if the |
---|
| 379 | !-- momentum flux at the bottom is given by the Prandtl law or if it is |
---|
| 380 | !-- prescribed by the user. |
---|
| 381 | !-- Difference quotient of the momentum flux is not formed over half of |
---|
| 382 | !-- the grid spacing (2.0*ddzw(k)) any more, since the comparison with |
---|
[1320] | 383 | !-- other (LES) models showed that the values of the momentum flux becomes |
---|
[1] | 384 | !-- too large in this case. |
---|
| 385 | !-- The term containing w(k-1,..) (see above equation) is removed here |
---|
| 386 | !-- because the vertical velocity is assumed to be zero at the surface. |
---|
| 387 | IF ( use_surface_fluxes ) THEN |
---|
| 388 | k = nzb_v_inner(j,i)+1 |
---|
| 389 | ! |
---|
| 390 | !-- Interpolate eddy diffusivities on staggered gridpoints |
---|
[1340] | 391 | kmzp = 0.25_wp * ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) ) |
---|
[1] | 392 | |
---|
[1320] | 393 | tend(k,j,i) = tend(k,j,i) & |
---|
[2037] | 394 | & + ( kmzp * ( ( v(k+1,j,i) - v(k,j,i) ) * ddzu(k+1) & |
---|
| 395 | & + ( w(k,j,i) - w(k,j-1,i) ) * ddy & |
---|
| 396 | & ) * rho_air_zw(k) & |
---|
| 397 | & - ( -vsws(j,i) ) & |
---|
| 398 | & ) * ddzw(k) * drho_air(k) |
---|
[1] | 399 | ENDIF |
---|
| 400 | |
---|
[102] | 401 | ! |
---|
| 402 | !-- Vertical diffusion at the first gridpoint below the top boundary, |
---|
| 403 | !-- if the momentum flux at the top is prescribed by the user |
---|
[103] | 404 | IF ( use_top_fluxes .AND. constant_top_momentumflux ) THEN |
---|
[102] | 405 | k = nzt |
---|
| 406 | ! |
---|
| 407 | !-- Interpolate eddy diffusivities on staggered gridpoints |
---|
[2037] | 408 | kmzm = 0.25_wp * ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) ) |
---|
[102] | 409 | |
---|
[1320] | 410 | tend(k,j,i) = tend(k,j,i) & |
---|
[2037] | 411 | & + ( ( -vswst(j,i) ) & |
---|
| 412 | & - kmzm * ( ( v(k,j,i) - v(k-1,j,i) ) * ddzu(k) & |
---|
| 413 | & + ( w(k-1,j,i) - w(k-1,j-1,i) ) * ddy & |
---|
| 414 | & ) * rho_air_zw(k-1) & |
---|
| 415 | & ) * ddzw(k) * drho_air(k) |
---|
[102] | 416 | ENDIF |
---|
| 417 | |
---|
[1] | 418 | END SUBROUTINE diffusion_v_ij |
---|
| 419 | |
---|
[1321] | 420 | END MODULE diffusion_v_mod |
---|