Index: palm/trunk/SOURCE/advec_w_up.f90
===================================================================
--- palm/trunk/SOURCE/advec_w_up.f90	(revision 3255)
+++ palm/trunk/SOURCE/advec_w_up.f90	(revision 3538)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Remove unnecessary double-masking of topography
+! 
+! 3255 2018-09-17 11:57:36Z suehring
 ! Missing wall flags added
 ! 
@@ -107,5 +110,5 @@
 
        USE indices,                                                            &
-           ONLY:  nxl, nxr, nyn, nys, nzb, nzt, wall_flags_0
+           ONLY:  nxl, nxr, nyn, nys, nzb, nzt
 
        USE kinds
@@ -131,12 +134,8 @@
                 IF ( ukomp > 0.0_wp )  THEN
                    tend(k,j,i) = tend(k,j,i) - ukomp *                         &
-                                         ( w(k,j,i) - w(k,j,i-1) ) * ddx       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k,j,i) - w(k,j,i-1) ) * ddx
                 ELSE
                    tend(k,j,i) = tend(k,j,i) - ukomp *                         &
-                                         ( w(k,j,i+1) - w(k,j,i) ) * ddx       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k,j,i+1) - w(k,j,i) ) * ddx
                 ENDIF
 !
@@ -146,12 +145,8 @@
                 IF ( vkomp > 0.0_wp )  THEN
                    tend(k,j,i) = tend(k,j,i) - vkomp *                         &
-                                         ( w(k,j,i) - w(k,j-1,i) ) * ddy       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k,j,i) - w(k,j-1,i) ) * ddy
                 ELSE
                    tend(k,j,i) = tend(k,j,i) - vkomp *                         &
-                                         ( w(k,j+1,i) - w(k,j,i) ) * ddy       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k,j+1,i) - w(k,j,i) ) * ddy
                 ENDIF
 !
@@ -159,12 +154,8 @@
                 IF ( w(k,j,i) > 0.0_wp )  THEN
                    tend(k,j,i) = tend(k,j,i) - w(k,j,i) *                      &
-                                         ( w(k,j,i) - w(k-1,j,i) ) * ddzw(k)   &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k,j,i) - w(k-1,j,i) ) * ddzw(k)
                 ELSE
                    tend(k,j,i) = tend(k,j,i) - w(k,j,i) *                      &
-                                         ( w(k+1,j,i) - w(k,j,i) ) * ddzw(k+1) &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k+1,j,i) - w(k,j,i) ) * ddzw(k+1)
                 ENDIF
 
@@ -193,5 +184,5 @@
 
        USE indices,                                                            &
-           ONLY:  nzb, nzt, wall_flags_0
+           ONLY:  nzb, nzt
 
        USE kinds
@@ -215,12 +206,8 @@
           IF ( ukomp > 0.0_wp )  THEN
              tend(k,j,i) = tend(k,j,i) - ukomp *                               &
-                                         ( w(k,j,i) - w(k,j,i-1) ) * ddx       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k,j,i) - w(k,j,i-1) ) * ddx
           ELSE
              tend(k,j,i) = tend(k,j,i) - ukomp *                               &
-                                         ( w(k,j,i+1) - w(k,j,i) ) * ddx       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k,j,i+1) - w(k,j,i) ) * ddx
           ENDIF
 !
@@ -230,12 +217,8 @@
           IF ( vkomp > 0.0_wp )  THEN
              tend(k,j,i) = tend(k,j,i) - vkomp *                               &
-                                         ( w(k,j,i) - w(k,j-1,i) ) * ddy       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k,j,i) - w(k,j-1,i) ) * ddy
           ELSE
              tend(k,j,i) = tend(k,j,i) - vkomp *                               &
-                                         ( w(k,j+1,i) - w(k,j,i) ) * ddy       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k,j+1,i) - w(k,j,i) ) * ddy
           ENDIF
 !
@@ -243,12 +226,8 @@
           IF ( w(k,j,i) > 0.0_wp )  THEN
              tend(k,j,i) = tend(k,j,i) - w(k,j,i) *                            &
-                                         ( w(k,j,i) - w(k-1,j,i) ) * ddzw(k)   &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k,j,i) - w(k-1,j,i) ) * ddzw(k)
           ELSE
              tend(k,j,i) = tend(k,j,i) - w(k,j,i) *                            &
-                                         ( w(k+1,j,i) - w(k,j,i) ) * ddzw(k+1) &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 3 ) )
+                                         ( w(k+1,j,i) - w(k,j,i) ) * ddzw(k+1)
           ENDIF
 
