Changeset 978 for palm/trunk/SOURCE/diffusion_u.f90
- Timestamp:
- Aug 9, 2012 8:28:32 AM (12 years ago)
- Location:
- palm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk
- Property svn:mergeinfo changed
/palm/branches/fricke (added) merged: 942-944,967-968,971-972,977
- Property svn:mergeinfo changed
-
palm/trunk/SOURCE
- Property svn:mergeinfo changed
/palm/branches/fricke/SOURCE (added) merged: 967-968,971-972,977
- Property svn:mergeinfo changed
-
palm/trunk/SOURCE/diffusion_u.f90
r668 r978 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! outflow damping layer removed 7 ! kmym_x/_y and kmyp_x/_y change to kmym and kmyp 6 8 ! 7 9 ! Former revisions: … … 63 65 ! Call for all grid points 64 66 !------------------------------------------------------------------------------! 65 SUBROUTINE diffusion_u( ddzu, ddzw, km, km_damp_y, tend, u, usws, uswst, & 66 v, w ) 67 SUBROUTINE diffusion_u( ddzu, ddzw, km, tend, u, usws, uswst, v, w ) 67 68 68 69 USE control_parameters … … 73 74 74 75 INTEGER :: i, j, k 75 REAL :: kmym _x, kmym_y, kmyp_x, kmyp_y, kmzm, kmzp76 REAL :: ddzu(1:nzt+1), ddzw(1:nzt+1) , km_damp_y(nysg:nyng)76 REAL :: kmym, kmyp, kmzm, kmzp 77 REAL :: ddzu(1:nzt+1), ddzw(1:nzt+1) 77 78 REAL :: tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg) 78 79 REAL, DIMENSION(:,:), POINTER :: usws, uswst … … 95 96 ! 96 97 !-- Interpolate eddy diffusivities on staggered gridpoints 97 kmyp_x = 0.25 * & 98 ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) ) 99 kmym_x = 0.25 * & 100 ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) ) 101 kmyp_y = kmyp_x 102 kmym_y = kmym_x 103 ! 104 !-- Increase diffusion at the outflow boundary in case of 105 !-- non-cyclic lateral boundaries. Damping is only needed for 106 !-- velocity components parallel to the outflow boundary in 107 !-- the direction normal to the outflow boundary. 108 IF ( .NOT. bc_ns_cyc ) THEN 109 kmyp_y = MAX( kmyp_y, km_damp_y(j) ) 110 kmym_y = MAX( kmym_y, km_damp_y(j) ) 111 ENDIF 98 kmyp = 0.25 * & 99 ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) ) 100 kmym = 0.25 * & 101 ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) ) 112 102 113 103 tend(k,j,i) = tend(k,j,i) & … … 116 106 & - km(k,j,i-1) * ( u(k,j,i) - u(k,j,i-1) ) & 117 107 & ) * ddx2 & 118 & + ( kmyp _y * ( u(k,j+1,i) - u(k,j,i) ) * ddy&119 & + kmyp _x * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx&120 & - kmym _y * ( u(k,j,i) - u(k,j-1,i) ) * ddy&121 & - kmym _x * ( v(k,j,i) - v(k,j,i-1) ) * ddx&108 & + ( kmyp * ( u(k,j+1,i) - u(k,j,i) ) * ddy & 109 & + kmyp * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx & 110 & - kmym * ( u(k,j,i) - u(k,j-1,i) ) * ddy & 111 & - kmym * ( v(k,j,i) - v(k,j,i-1) ) * ddx & 122 112 & ) * ddy 123 113 ENDDO … … 128 118 129 119 DO k = nzb_u_inner(j,i)+1, nzb_u_outer(j,i) 130 kmyp_x = 0.25 * & 131 ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) ) 132 kmym_x = 0.25 * & 133 ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) ) 134 kmyp_y = kmyp_x 135 kmym_y = kmym_x 136 ! 137 !-- Increase diffusion at the outflow boundary in case of 138 !-- non-cyclic lateral boundaries. Damping is only needed for 139 !-- velocity components parallel to the outflow boundary in 140 !-- the direction normal to the outflow boundary. 141 IF ( .NOT. bc_ns_cyc ) THEN 142 kmyp_y = MAX( kmyp_y, km_damp_y(j) ) 143 kmym_y = MAX( kmym_y, km_damp_y(j) ) 144 ENDIF 120 kmyp = 0.25 * & 121 ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) ) 122 kmym = 0.25 * & 123 ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) ) 145 124 146 125 tend(k,j,i) = tend(k,j,i) & … … 150 129 ) * ddx2 & 151 130 + ( fyp(j,i) * ( & 152 kmyp _y * ( u(k,j+1,i) - u(k,j,i) ) * ddy&153 + kmyp _x * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx&131 kmyp * ( u(k,j+1,i) - u(k,j,i) ) * ddy & 132 + kmyp * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx & 154 133 ) & 155 134 - fym(j,i) * ( & 156 kmym _y * ( u(k,j,i) - u(k,j-1,i) ) * ddy&157 + kmym _x * ( v(k,j,i) - v(k,j,i-1) ) * ddx&135 kmym * ( u(k,j,i) - u(k,j-1,i) ) * ddy & 136 + kmym * ( v(k,j,i) - v(k,j,i-1) ) * ddx & 158 137 ) & 159 138 + wall_u(j,i) * usvs(k,j,i) & … … 239 218 ! Call for grid point i,j 240 219 !------------------------------------------------------------------------------! 241 SUBROUTINE diffusion_u_ij( i, j, ddzu, ddzw, km, km_damp_y,tend, u, usws, &220 SUBROUTINE diffusion_u_ij( i, j, ddzu, ddzw, km, tend, u, usws, & 242 221 uswst, v, w ) 243 222 … … 249 228 250 229 INTEGER :: i, j, k 251 REAL :: kmym _x, kmym_y, kmyp_x, kmyp_y, kmzm, kmzp252 REAL :: ddzu(1:nzt+1), ddzw(1:nzt+1) , km_damp_y(nysg:nyng)230 REAL :: kmym, kmyp, kmzm, kmzp 231 REAL :: ddzu(1:nzt+1), ddzw(1:nzt+1) 253 232 REAL :: tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg) 254 233 REAL, DIMENSION(nzb:nzt+1) :: usvs … … 261 240 ! 262 241 !-- Interpolate eddy diffusivities on staggered gridpoints 263 kmyp_x = 0.25 * ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) ) 264 kmym_x = 0.25 * ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) ) 265 kmyp_y = kmyp_x 266 kmym_y = kmym_x 267 268 ! 269 !-- Increase diffusion at the outflow boundary in case of non-cyclic 270 !-- lateral boundaries. Damping is only needed for velocity components 271 !-- parallel to the outflow boundary in the direction normal to the 272 !-- outflow boundary. 273 IF ( .NOT. bc_ns_cyc ) THEN 274 kmyp_y = MAX( kmyp_y, km_damp_y(j) ) 275 kmym_y = MAX( kmym_y, km_damp_y(j) ) 276 ENDIF 242 kmyp = 0.25 * ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) ) 243 kmym = 0.25 * ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) ) 277 244 278 245 tend(k,j,i) = tend(k,j,i) & … … 281 248 & - km(k,j,i-1) * ( u(k,j,i) - u(k,j,i-1) ) & 282 249 & ) * ddx2 & 283 & + ( kmyp _y * ( u(k,j+1,i) - u(k,j,i) ) * ddy&284 & + kmyp _x * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx&285 & - kmym _y * ( u(k,j,i) - u(k,j-1,i) ) * ddy&286 & - kmym _x * ( v(k,j,i) - v(k,j,i-1) ) * ddx&250 & + ( kmyp * ( u(k,j+1,i) - u(k,j,i) ) * ddy & 251 & + kmyp * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx & 252 & - kmym * ( u(k,j,i) - u(k,j-1,i) ) * ddy & 253 & - kmym * ( v(k,j,i) - v(k,j,i-1) ) * ddx & 287 254 & ) * ddy 288 255 ENDDO … … 298 265 299 266 DO k = nzb_u_inner(j,i)+1, nzb_u_outer(j,i) 300 kmyp_x = 0.25 * ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) ) 301 kmym_x = 0.25 * ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) ) 302 kmyp_y = kmyp_x 303 kmym_y = kmym_x 304 ! 305 !-- Increase diffusion at the outflow boundary in case of 306 !-- non-cyclic lateral boundaries. Damping is only needed for 307 !-- velocity components parallel to the outflow boundary in 308 !-- the direction normal to the outflow boundary. 309 IF ( .NOT. bc_ns_cyc ) THEN 310 kmyp_y = MAX( kmyp_y, km_damp_y(j) ) 311 kmym_y = MAX( kmym_y, km_damp_y(j) ) 312 ENDIF 267 kmyp = 0.25 * ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) ) 268 kmym = 0.25 * ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) ) 313 269 314 270 tend(k,j,i) = tend(k,j,i) & … … 318 274 ) * ddx2 & 319 275 + ( fyp(j,i) * ( & 320 kmyp _y * ( u(k,j+1,i) - u(k,j,i) ) * ddy&321 + kmyp _x * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx&276 kmyp * ( u(k,j+1,i) - u(k,j,i) ) * ddy & 277 + kmyp * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx & 322 278 ) & 323 279 - fym(j,i) * ( & 324 kmym _y * ( u(k,j,i) - u(k,j-1,i) ) * ddy&325 + kmym _x * ( v(k,j,i) - v(k,j,i-1) ) * ddx&280 kmym * ( u(k,j,i) - u(k,j-1,i) ) * ddy & 281 + kmym * ( v(k,j,i) - v(k,j,i-1) ) * ddx & 326 282 ) & 327 283 + wall_u(j,i) * usvs(k) &
Note: See TracChangeset
for help on using the changeset viewer.