Index: palm/trunk/SOURCE/advec_u_up.f90
===================================================================
--- palm/trunk/SOURCE/advec_u_up.f90	(revision 2718)
+++ palm/trunk/SOURCE/advec_u_up.f90	(revision 3538)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Remove unnecessary double-masking of topography
+! 
+! 2718 2018-01-02 08:49:38Z maronga
 ! Corrected "Former revisions" section
 ! 
@@ -104,5 +107,5 @@
 
        USE indices,                                                            &
-           ONLY:  nxlu, nxr, nyn, nys, nzb, nzt, wall_flags_0
+           ONLY:  nxlu, nxr, nyn, nys, nzb, nzt
 
        USE kinds
@@ -128,12 +131,8 @@
                 IF ( ukomp > 0.0_wp )  THEN
                    tend(k,j,i) = tend(k,j,i) - ukomp *                         &
-                                         ( u(k,j,i) - u(k,j,i-1) ) * ddx       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                         ( u(k,j,i) - u(k,j,i-1) ) * ddx
                 ELSE
                    tend(k,j,i) = tend(k,j,i) - ukomp *                         &
-                                          ( u(k,j,i+1) - u(k,j,i) ) * ddx      &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                          ( u(k,j,i+1) - u(k,j,i) ) * ddx
                 ENDIF
 !
@@ -143,12 +142,8 @@
                 IF ( vkomp > 0.0_wp )  THEN
                    tend(k,j,i) = tend(k,j,i) - vkomp *                         &
-                                         ( u(k,j,i) - u(k,j-1,i) ) * ddy       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                         ( u(k,j,i) - u(k,j-1,i) ) * ddy
                 ELSE
                    tend(k,j,i) = tend(k,j,i) - vkomp *                         &
-                                         ( u(k,j+1,i) - u(k,j,i) ) * ddy       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                         ( u(k,j+1,i) - u(k,j,i) ) * ddy
                 ENDIF
 !
@@ -158,12 +153,8 @@
                 IF ( wkomp > 0.0_wp )  THEN
                    tend(k,j,i) = tend(k,j,i) - wkomp *                         &
-                                         ( u(k,j,i) - u(k-1,j,i) ) * ddzu(k)   &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                         ( u(k,j,i) - u(k-1,j,i) ) * ddzu(k)
                 ELSE
                    tend(k,j,i) = tend(k,j,i) - wkomp *                         &
-                                         ( u(k+1,j,i) - u(k,j,i) ) * ddzu(k+1) &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                         ( u(k+1,j,i) - u(k,j,i) ) * ddzu(k+1)
                 ENDIF
 
@@ -192,5 +183,5 @@
 
        USE indices,                                                            &
-           ONLY:  nzb, nzt, wall_flags_0
+           ONLY:  nzb, nzt
 
        USE kinds
@@ -214,12 +205,8 @@
           IF ( ukomp > 0.0_wp )  THEN
              tend(k,j,i) = tend(k,j,i) - ukomp *                               &
-                                         ( u(k,j,i) - u(k,j,i-1) ) * ddx       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                         ( u(k,j,i) - u(k,j,i-1) ) * ddx
           ELSE
              tend(k,j,i) = tend(k,j,i) - ukomp *                               &
-                                         ( u(k,j,i+1) - u(k,j,i) ) * ddx       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                         ( u(k,j,i+1) - u(k,j,i) ) * ddx
           ENDIF
 !
@@ -229,12 +216,8 @@
           IF ( vkomp > 0.0_wp )  THEN
              tend(k,j,i) = tend(k,j,i) - vkomp *                               &
-                                         ( u(k,j,i) - u(k,j-1,i) ) * ddy       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                         ( u(k,j,i) - u(k,j-1,i) ) * ddy
           ELSE
              tend(k,j,i) = tend(k,j,i) - vkomp *                               &
-                                         ( u(k,j+1,i) - u(k,j,i) ) * ddy       &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                         ( u(k,j+1,i) - u(k,j,i) ) * ddy
           ENDIF
 !
@@ -243,12 +226,8 @@
           IF ( wkomp > 0.0_wp )  THEN
              tend(k,j,i) = tend(k,j,i) - wkomp *                               &
-                                         ( u(k,j,i) - u(k-1,j,i) ) * ddzu(k)   &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                         ( u(k,j,i) - u(k-1,j,i) ) * ddzu(k)
           ELSE
              tend(k,j,i) = tend(k,j,i) - wkomp *                               &
-                                         ( u(k+1,j,i) - u(k,j,i) ) * ddzu(k+1) &
-                                      * MERGE( 1.0_wp, 0.0_wp,                 &
-                                               BTEST( wall_flags_0(k,j,i), 1 ) )
+                                         ( u(k+1,j,i) - u(k,j,i) ) * ddzu(k+1)
           ENDIF
 
