Index: palm/trunk/SOURCE/coriolis.f90
===================================================================
--- palm/trunk/SOURCE/coriolis.f90	(revision 2119)
+++ palm/trunk/SOURCE/coriolis.f90	(revision 2232)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Adjustments to new topography concept
 ! 
 ! Former revisions:
@@ -102,6 +102,5 @@
            
        USE indices,                                                            &
-           ONLY:  nxl, nxlu, nxr, nyn, nys, nysv, nzb_u_inner, nzb_v_inner,    &
-                  nzb_w_inner, nzt
+           ONLY:  nxl, nxlu, nxr, nyn, nys, nysv, nzb, nzt, wall_flags_0
                    
        USE kinds
@@ -110,9 +109,9 @@
 
        INTEGER(iwp) ::  component  !< 
-       INTEGER(iwp) ::  i          !< 
-       INTEGER(iwp) ::  j          !< 
-       INTEGER(iwp) ::  k          !< 
-
-
+       INTEGER(iwp) ::  i          !< running index x direction 
+       INTEGER(iwp) ::  j          !< running index y direction 
+       INTEGER(iwp) ::  k          !< running index z direction 
+
+       REAL(wp)     ::  flag       !< flag to mask topography
 !
 !--    Compute Coriolis terms for the three velocity components
@@ -124,12 +123,17 @@
              DO  i = nxlu, nxr
                 DO  j = nys, nyn
-                   DO  k = nzb_u_inner(j,i)+1, nzt
+                   DO  k = nzb+1, nzt
+!
+!--                    Predetermine flag to mask topography
+                      flag = MERGE( 1.0_wp, 0.0_wp,                            &
+                                    BTEST( wall_flags_0(k,j,i), 1 ) )
+
                       tend(k,j,i) = tend(k,j,i) + f  *    ( 0.25_wp *          &
                                    ( v(k,j,i-1) + v(k,j,i) + v(k,j+1,i-1) +    &
-                                     v(k,j+1,i) ) - vg(k) )                    &
+                                     v(k,j+1,i) ) - vg(k)   ) * flag           &
                                                 - fs *    ( 0.25_wp *          &
                                    ( w(k-1,j,i-1) + w(k-1,j,i) + w(k,j,i-1) +  &
-                                     w(k,j,i)   ) &
-                                                          )
+                                     w(k,j,i)   )                              &
+                                                          )   * flag
                    ENDDO
                 ENDDO
@@ -141,8 +145,10 @@
              DO  i = nxl, nxr
                 DO  j = nysv, nyn
-                   DO  k = nzb_v_inner(j,i)+1, nzt
+                   DO  k = nzb+1, nzt
                       tend(k,j,i) = tend(k,j,i) - f *     ( 0.25_wp *          &
                                    ( u(k,j-1,i) + u(k,j,i) + u(k,j-1,i+1) +    &
-                                     u(k,j,i+1) ) - ug(k) )
+                                     u(k,j,i+1) ) - ug(k) ) *                  &
+                                      MERGE( 1.0_wp, 0.0_wp,                   &
+                                             BTEST( wall_flags_0(k,j,i), 2 ) )
                    ENDDO
                 ENDDO
@@ -154,8 +160,10 @@
              DO  i = nxl, nxr
                 DO  j = nys, nyn
-                   DO  k = nzb_w_inner(j,i)+1, nzt
+                   DO  k = nzb+1, nzt
                       tend(k,j,i) = tend(k,j,i) + fs * 0.25_wp *               &
                                    ( u(k,j,i) + u(k+1,j,i) + u(k,j,i+1) +      &
-                                     u(k+1,j,i+1) )
+                                     u(k+1,j,i+1) ) *                          &
+                                      MERGE( 1.0_wp, 0.0_wp,                   &
+                                             BTEST( wall_flags_0(k,j,i), 3 ) )
                    ENDDO
                 ENDDO
@@ -186,5 +194,5 @@
            
        USE indices,                                                            &
-           ONLY:  nzb_u_inner, nzb_v_inner, nzb_w_inner, nzt
+           ONLY:  nzb, nzt, wall_flags_0
            
        USE kinds
@@ -193,7 +201,9 @@
 
        INTEGER(iwp) ::  component  !< 
-       INTEGER(iwp) ::  i          !<
-       INTEGER(iwp) ::  j          !< 
-       INTEGER(iwp) ::  k          !<
+       INTEGER(iwp) ::  i          !< running index x direction 
+       INTEGER(iwp) ::  j          !< running index y direction 
+       INTEGER(iwp) ::  k          !< running index z direction 
+
+       REAL(wp)     ::  flag       !< flag to mask topography
 
 !
@@ -204,11 +214,15 @@
 !--       u-component
           CASE ( 1 )
-             DO  k = nzb_u_inner(j,i)+1, nzt
-                tend(k,j,i) = tend(k,j,i) + f  *    ( 0.25_wp *                &
+             DO  k = nzb+1, nzt
+!
+!--             Predetermine flag to mask topography
+                flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 1 ) )
+
+                tend(k,j,i) = tend(k,j,i) + f  *     ( 0.25_wp *               &
                                 ( v(k,j,i-1) + v(k,j,i) + v(k,j+1,i-1) +       &
-                                  v(k,j+1,i) ) - vg(k) )                       &
+                                  v(k,j+1,i) ) - vg(k) ) * flag                &
                                           - fs *    ( 0.25_wp *                &
                                 ( w(k-1,j,i-1) + w(k-1,j,i) + w(k,j,i-1) +     &
-                                  w(k,j,i)   ) )
+                                  w(k,j,i)   )      ) * flag
              ENDDO
 
@@ -216,8 +230,10 @@
 !--       v-component
           CASE ( 2 )
-             DO  k = nzb_v_inner(j,i)+1, nzt
-                tend(k,j,i) = tend(k,j,i) - f *     ( 0.25_wp *                &
+             DO  k = nzb+1, nzt
+                tend(k,j,i) = tend(k,j,i) - f *        ( 0.25_wp *             &
                                 ( u(k,j-1,i) + u(k,j,i) + u(k,j-1,i+1) +       &
-                                  u(k,j,i+1) ) - ug(k) )
+                                  u(k,j,i+1) ) - ug(k) ) *                     &
+                                      MERGE( 1.0_wp, 0.0_wp,                   &
+                                             BTEST( wall_flags_0(k,j,i), 2 ) )
              ENDDO
 
@@ -225,8 +241,10 @@
 !--       w-component
           CASE ( 3 )
-             DO  k = nzb_w_inner(j,i)+1, nzt
+             DO  k = nzb+1, nzt
                 tend(k,j,i) = tend(k,j,i) + fs * 0.25_wp *                     &
                                 ( u(k,j,i) + u(k+1,j,i) + u(k,j,i+1) +         &
-                                  u(k+1,j,i+1) )
+                                  u(k+1,j,i+1) ) *                             &
+                                      MERGE( 1.0_wp, 0.0_wp,                   &
+                                             BTEST( wall_flags_0(k,j,i), 3 ) )
              ENDDO
 
