Index: palm/trunk/SOURCE/header.f90
===================================================================
--- palm/trunk/SOURCE/header.f90	(revision 926)
+++ palm/trunk/SOURCE/header.f90	(revision 927)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! output of masking_method for mg-solver
 ! 
 ! Former revisions:
@@ -270,4 +270,5 @@
                              nzt_mg(1)
        ENDIF
+       IF ( masking_method )  WRITE ( io, 144 )
     ENDIF
     IF ( call_psolver_at_all_substeps  .AND. timestep_scheme(1:5) == 'runge' ) &
@@ -1701,4 +1702,5 @@
 143 FORMAT ('     Euler/upstream scheme is used for the SGS turbulent ', &
                   'kinetic energy')
+144 FORMAT ('     masking method is used')
 150 FORMAT (' --> Volume flow at the right and north boundary will be ', &
                   'conserved'/ &
Index: palm/trunk/SOURCE/init_grid.f90
===================================================================
--- palm/trunk/SOURCE/init_grid.f90	(revision 926)
+++ palm/trunk/SOURCE/init_grid.f90	(revision 927)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! Wall flags are not set for multigrid method in case of masking method
 !
 ! Former revisions:
@@ -11,6 +11,6 @@
 !
 ! 864 2012-03-27 15:10:33Z gryschka 
-! In case of ocean and dirichlet bc for u and v at the ground
-! dzu_mg and ddzu_pres where not defined correctly for k=1.
+! In case of ocean and Dirichlet bottom bc for u and v dzu_mg and ddzu_pres
+! were not correctly defined for k=1.
 !
 ! 861 2012-03-26 14:18:34Z suehring
@@ -992,47 +992,54 @@
           flags = 0
 
-          DO  i = nxl_l-1, nxr_l+1
-             DO  j = nys_l-1, nyn_l+1
-                DO  k = nzb, nzt_l+1
+!
+!--       In case of masking method, flags are not set and multigrid method
+!--       works like FFT-solver
+          IF ( .NOT. masking_method )  THEN
+
+             DO  i = nxl_l-1, nxr_l+1
+                DO  j = nys_l-1, nyn_l+1
+                   DO  k = nzb, nzt_l+1
                          
 !
-!--                Inside/outside building (inside building does not need
-!--                further tests for walls)
-                   IF ( k*inc <= nzb_local(j*inc,i*inc) )  THEN
-
-                      flags(k,j,i) = IBSET( flags(k,j,i), 6 )
-
-                   ELSE
-!
-!--                   Bottom wall
-                      IF ( (k-1)*inc <= nzb_local(j*inc,i*inc) )  THEN
-                         flags(k,j,i) = IBSET( flags(k,j,i), 0 )
+!--                   Inside/outside building (inside building does not need
+!--                   further tests for walls)
+                      IF ( k*inc <= nzb_local(j*inc,i*inc) )  THEN
+
+                         flags(k,j,i) = IBSET( flags(k,j,i), 6 )
+
+                      ELSE
+!
+!--                      Bottom wall
+                         IF ( (k-1)*inc <= nzb_local(j*inc,i*inc) )  THEN
+                            flags(k,j,i) = IBSET( flags(k,j,i), 0 )
+                         ENDIF
+!
+!--                      South wall
+                         IF ( k*inc <= nzb_local((j-1)*inc,i*inc) )  THEN
+                            flags(k,j,i) = IBSET( flags(k,j,i), 2 )
+                         ENDIF
+!
+!--                      North wall
+                         IF ( k*inc <= nzb_local((j+1)*inc,i*inc) )  THEN
+                            flags(k,j,i) = IBSET( flags(k,j,i), 3 )
+                         ENDIF
+!
+!--                      Left wall
+                         IF ( k*inc <= nzb_local(j*inc,(i-1)*inc) )  THEN
+                            flags(k,j,i) = IBSET( flags(k,j,i), 4 )
+                         ENDIF
+!
+!--                      Right wall
+                         IF ( k*inc <= nzb_local(j*inc,(i+1)*inc) )  THEN
+                            flags(k,j,i) = IBSET( flags(k,j,i), 5 )
+                         ENDIF
+
                       ENDIF
-!
-!--                   South wall
-                      IF ( k*inc <= nzb_local((j-1)*inc,i*inc) )  THEN
-                         flags(k,j,i) = IBSET( flags(k,j,i), 2 )
-                      ENDIF
-!
-!--                   North wall
-                      IF ( k*inc <= nzb_local((j+1)*inc,i*inc) )  THEN
-                         flags(k,j,i) = IBSET( flags(k,j,i), 3 )
-                      ENDIF
-!
-!--                   Left wall
-                      IF ( k*inc <= nzb_local(j*inc,(i-1)*inc) )  THEN
-                         flags(k,j,i) = IBSET( flags(k,j,i), 4 )
-                      ENDIF
-!
-!--                   Right wall
-                      IF ( k*inc <= nzb_local(j*inc,(i+1)*inc) )  THEN
-                         flags(k,j,i) = IBSET( flags(k,j,i), 5 )
-                      ENDIF
-
-                   ENDIF
                             
+                   ENDDO
                 ENDDO
              ENDDO
-          ENDDO
+
+          ENDIF
 
 !
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 926)
+++ palm/trunk/SOURCE/modules.f90	(revision 927)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! +masking_method
 !
 ! Former revisions:
@@ -587,5 +587,5 @@
                 inflow_r = .FALSE., inflow_s = .FALSE., &
                 iso2d_output = .FALSE., large_scale_subsidence = .FALSE., &
-                mg_switch_to_pe0 = .FALSE., &
+                masking_method = .FALSE., mg_switch_to_pe0 = .FALSE., &
                 netcdf_output = .FALSE., ocean = .FALSE., &
                 outflow_l = .FALSE., outflow_n = .FALSE., outflow_r = .FALSE., &
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 926)
+++ palm/trunk/SOURCE/parin.f90	(revision 927)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! +masking_method in inipar
 !
 ! Former revisions:
@@ -161,5 +161,6 @@
              lad_vertical_gradient, lad_vertical_gradient_level, &
              leaf_surface_concentration, long_filter_factor, &
-             loop_optimization, mg_cycles, mg_switch_to_pe0_level, &
+             loop_optimization, masking_method, mg_cycles, &
+             mg_switch_to_pe0_level, &
              mixing_length_1d, momentum_advec, netcdf_precision, ngsrb, nsor, &
              nsor_ini, nx, ny, nz, ocean, omega, omega_sor, &
Index: palm/trunk/SOURCE/read_var_list.f90
===================================================================
--- palm/trunk/SOURCE/read_var_list.f90	(revision 926)
+++ palm/trunk/SOURCE/read_var_list.f90	(revision 927)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! +masking_method
 !
 ! Former revisions:
@@ -401,4 +401,6 @@
           CASE ( 'loop_optimization' )
              READ ( 13 )  loop_optimization
+          CASE ( 'masking_method' )
+             READ ( 13 )  masking_method
           CASE ( 'mean_inflow_profiles' )
              IF ( .NOT. ALLOCATED( mean_inflow_profiles ) )  THEN
Index: palm/trunk/SOURCE/write_var_list.f90
===================================================================
--- palm/trunk/SOURCE/write_var_list.f90	(revision 926)
+++ palm/trunk/SOURCE/write_var_list.f90	(revision 927)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! +masking_method
 !
 ! Former revisions:
@@ -316,4 +316,6 @@
     WRITE ( 14 )  'loop_optimization             '
     WRITE ( 14 )  loop_optimization
+    WRITE ( 14 )  'masking_method                '
+    WRITE ( 14 )  masking_method
     IF ( ALLOCATED( mean_inflow_profiles ) )  THEN
        WRITE ( 14 )  'mean_inflow_profiles          '
