Index: palm/trunk/SOURCE/diffusion_u.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_u.f90	(revision 668)
+++ palm/trunk/SOURCE/diffusion_u.f90	(revision 978)
@@ -4,4 +4,6 @@
 ! Current revisions:
 ! -----------------
+! outflow damping layer removed
+! kmym_x/_y and kmyp_x/_y change to kmym and kmyp
 !
 ! Former revisions:
@@ -63,6 +65,5 @@
 ! Call for all grid points
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_u( ddzu, ddzw, km, km_damp_y, tend, u, usws, uswst, &
-                            v, w )
+    SUBROUTINE diffusion_u( ddzu, ddzw, km, tend, u, usws, uswst, v, w )
 
        USE control_parameters
@@ -73,6 +74,6 @@
 
        INTEGER ::  i, j, k
-       REAL    ::  kmym_x, kmym_y, kmyp_x, kmyp_y, kmzm, kmzp
-       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1), km_damp_y(nysg:nyng)
+       REAL    ::  kmym, kmyp, kmzm, kmzp
+       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1)
        REAL    ::  tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg)
        REAL, DIMENSION(:,:),   POINTER ::  usws, uswst
@@ -95,19 +96,8 @@
 !
 !--             Interpolate eddy diffusivities on staggered gridpoints
-                kmyp_x = 0.25 * &
-                         ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) )
-                kmym_x = 0.25 * &
-                         ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) )
-                kmyp_y = kmyp_x
-                kmym_y = kmym_x
-!
-!--             Increase diffusion at the outflow boundary in case of
-!--             non-cyclic lateral boundaries. Damping is only needed for
-!--             velocity components parallel to the outflow boundary in
-!--             the direction normal to the outflow boundary.
-                IF ( .NOT. bc_ns_cyc )  THEN
-                   kmyp_y = MAX( kmyp_y, km_damp_y(j) )
-                   kmym_y = MAX( kmym_y, km_damp_y(j) )
-                ENDIF
+                kmyp = 0.25 * &
+                       ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) )
+                kmym = 0.25 * &
+                       ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) )
 
                 tend(k,j,i) = tend(k,j,i)                                    &
@@ -116,8 +106,8 @@
                       &         - km(k,j,i-1) * ( u(k,j,i)   - u(k,j,i-1) )  &
                       &         ) * ddx2                                     &
-                      & + ( kmyp_y * ( u(k,j+1,i) - u(k,j,i)     ) * ddy     &
-                      &   + kmyp_x * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx     &
-                      &   - kmym_y * ( u(k,j,i) - u(k,j-1,i) ) * ddy         &
-                      &   - kmym_x * ( v(k,j,i) - v(k,j,i-1) ) * ddx         &
+                      & + ( kmyp * ( u(k,j+1,i) - u(k,j,i)     ) * ddy       &
+                      &   + kmyp * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx       &
+                      &   - kmym * ( u(k,j,i) - u(k,j-1,i) ) * ddy           &
+                      &   - kmym * ( v(k,j,i) - v(k,j,i-1) ) * ddx           &
                       &   ) * ddy
              ENDDO
@@ -128,19 +118,8 @@
 
                 DO  k = nzb_u_inner(j,i)+1, nzb_u_outer(j,i)
-                   kmyp_x = 0.25 * &
-                            ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) )
-                   kmym_x = 0.25 * &
-                            ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) )
-                   kmyp_y = kmyp_x
-                   kmym_y = kmym_x
-!
-!--                Increase diffusion at the outflow boundary in case of
-!--                non-cyclic lateral boundaries. Damping is only needed for
-!--                velocity components parallel to the outflow boundary in
-!--                the direction normal to the outflow boundary.
-                   IF ( .NOT. bc_ns_cyc )  THEN
-                      kmyp_y = MAX( kmyp_y, km_damp_y(j) )
-                      kmym_y = MAX( kmym_y, km_damp_y(j) )
-                   ENDIF
+                   kmyp = 0.25 * &
+                          ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) )
+                   kmym = 0.25 * &
+                          ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) )
 
                    tend(k,j,i) = tend(k,j,i)                                   &
@@ -150,10 +129,10 @@
                                          ) * ddx2                              &
                                  + (   fyp(j,i) * (                            &
-                                  kmyp_y * ( u(k,j+1,i) - u(k,j,i)     ) * ddy &
-                                + kmyp_x * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx &
+                                  kmyp * ( u(k,j+1,i) - u(k,j,i)     ) * ddy   &
+                                + kmyp * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx   &
                                                   )                            &
                                      - fym(j,i) * (                            &
-                                  kmym_y * ( u(k,j,i) - u(k,j-1,i) ) * ddy     &
-                                + kmym_x * ( v(k,j,i) - v(k,j,i-1) ) * ddx     &
+                                  kmym * ( u(k,j,i) - u(k,j-1,i) ) * ddy       &
+                                + kmym * ( v(k,j,i) - v(k,j,i-1) ) * ddx       &
                                                   )                            &
                                      + wall_u(j,i) * usvs(k,j,i)               &
@@ -239,5 +218,5 @@
 ! Call for grid point i,j
 !------------------------------------------------------------------------------!
-    SUBROUTINE diffusion_u_ij( i, j, ddzu, ddzw, km, km_damp_y, tend, u, usws, &
+    SUBROUTINE diffusion_u_ij( i, j, ddzu, ddzw, km, tend, u, usws, &
                                uswst, v, w )
 
@@ -249,6 +228,6 @@
 
        INTEGER ::  i, j, k
-       REAL    ::  kmym_x, kmym_y, kmyp_x, kmyp_y, kmzm, kmzp
-       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1), km_damp_y(nysg:nyng)
+       REAL    ::  kmym, kmyp, kmzm, kmzp
+       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1)
        REAL    ::  tend(nzb:nzt+1,nysg:nyng,nxlg:nxrg)
        REAL, DIMENSION(nzb:nzt+1)      ::  usvs
@@ -261,18 +240,6 @@
 !
 !--       Interpolate eddy diffusivities on staggered gridpoints
-          kmyp_x = 0.25 * ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) )
-          kmym_x = 0.25 * ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) )
-          kmyp_y = kmyp_x
-          kmym_y = kmym_x
-
-!
-!--       Increase diffusion at the outflow boundary in case of non-cyclic
-!--       lateral boundaries. Damping is only needed for velocity components
-!--       parallel to the outflow boundary in the direction normal to the
-!--       outflow boundary.
-          IF ( .NOT. bc_ns_cyc )  THEN
-             kmyp_y = MAX( kmyp_y, km_damp_y(j) )
-             kmym_y = MAX( kmym_y, km_damp_y(j) )
-          ENDIF
+          kmyp = 0.25 * ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) )
+          kmym = 0.25 * ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) )
 
           tend(k,j,i) = tend(k,j,i)                                          &
@@ -281,8 +248,8 @@
                       &         - km(k,j,i-1) * ( u(k,j,i)   - u(k,j,i-1) )  &
                       &         ) * ddx2                                     &
-                      & + ( kmyp_y * ( u(k,j+1,i) - u(k,j,i)     ) * ddy     &
-                      &   + kmyp_x * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx     &
-                      &   - kmym_y * ( u(k,j,i) - u(k,j-1,i) ) * ddy         &
-                      &   - kmym_x * ( v(k,j,i) - v(k,j,i-1) ) * ddx         &
+                      & + ( kmyp * ( u(k,j+1,i) - u(k,j,i)     ) * ddy       &
+                      &   + kmyp * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx       &
+                      &   - kmym * ( u(k,j,i) - u(k,j-1,i) ) * ddy           &
+                      &   - kmym * ( v(k,j,i) - v(k,j,i-1) ) * ddx           &
                       &   ) * ddy
        ENDDO
@@ -298,17 +265,6 @@
 
           DO  k = nzb_u_inner(j,i)+1, nzb_u_outer(j,i)
-             kmyp_x = 0.25 * ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) )
-             kmym_x = 0.25 * ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) )
-             kmyp_y = kmyp_x
-             kmym_y = kmym_x
-!
-!--          Increase diffusion at the outflow boundary in case of
-!--          non-cyclic lateral boundaries. Damping is only needed for
-!--          velocity components parallel to the outflow boundary in
-!--          the direction normal to the outflow boundary.
-             IF ( .NOT. bc_ns_cyc )  THEN
-                kmyp_y = MAX( kmyp_y, km_damp_y(j) )
-                kmym_y = MAX( kmym_y, km_damp_y(j) )
-             ENDIF
+             kmyp = 0.25 * ( km(k,j,i)+km(k,j+1,i)+km(k,j,i-1)+km(k,j+1,i-1) )
+             kmym = 0.25 * ( km(k,j,i)+km(k,j-1,i)+km(k,j,i-1)+km(k,j-1,i-1) )
 
              tend(k,j,i) = tend(k,j,i)                                         &
@@ -318,10 +274,10 @@
                                          ) * ddx2                              &
                                  + (   fyp(j,i) * (                            &
-                                  kmyp_y * ( u(k,j+1,i) - u(k,j,i)     ) * ddy &
-                                + kmyp_x * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx &
+                                  kmyp * ( u(k,j+1,i) - u(k,j,i)     ) * ddy   &
+                                + kmyp * ( v(k,j+1,i) - v(k,j+1,i-1) ) * ddx   &
                                                   )                            &
                                      - fym(j,i) * (                            &
-                                  kmym_y * ( u(k,j,i) - u(k,j-1,i) ) * ddy     &
-                                + kmym_x * ( v(k,j,i) - v(k,j,i-1) ) * ddx     &
+                                  kmym * ( u(k,j,i) - u(k,j-1,i) ) * ddy       &
+                                + kmym * ( v(k,j,i) - v(k,j,i-1) ) * ddx       &
                                                   )                            &
                                      + wall_u(j,i) * usvs(k)                   &
