Index: palm/trunk/SOURCE/pmc_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 4329)
+++ palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 4346)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Introduction of wall_flags_total_0, which currently sets bits based on static
+! topography information used in wall_flags_static_0
+! 
+! 4329 2019-12-10 15:46:36Z motisi
 ! Renamed wall_flags_0 to wall_flags_static_0
 ! 
@@ -208,5 +212,5 @@
     USE indices,                                                               &
         ONLY:  nbgp, nx, nxl, nxlg, nxlu, nxr, nxrg, ny, nyn, nyng, nys, nysg, &
-               nysv, nz, nzb, nzt, topo_top_ind, wall_flags_static_0
+               nysv, nz, nzb, nzt, topo_top_ind, wall_flags_total_0
 
     USE bulk_cloud_model_mod,                                                  &
@@ -1529,14 +1533,14 @@
        INTEGER(iwp) ::  istart    !<
        INTEGER(iwp) ::  ir        !<
-       INTEGER(iwp) ::  iw        !< Child-grid index limited to -1 <= iw <= nx+1 for wall_flags_static_0
+       INTEGER(iwp) ::  iw        !< Child-grid index limited to -1 <= iw <= nx+1 for wall_flags_total_0
        INTEGER(iwp) ::  j         !< Child-grid index in the y-direction
        INTEGER(iwp) ::  jj        !< Parent-grid index in the y-direction
        INTEGER(iwp) ::  jstart    !<
        INTEGER(iwp) ::  jr        !<
-       INTEGER(iwp) ::  jw        !< Child-grid index limited to -1 <= jw <= ny+1 for wall_flags_static_0
+       INTEGER(iwp) ::  jw        !< Child-grid index limited to -1 <= jw <= ny+1 for wall_flags_total_0
        INTEGER(iwp) ::  k         !< Child-grid index in the z-direction
        INTEGER(iwp) ::  kk        !< Parent-grid index in the z-direction
        INTEGER(iwp) ::  kstart    !<
-       INTEGER(iwp) ::  kw        !< Child-grid index limited to kw <= nzt+1 for wall_flags_static_0
+       INTEGER(iwp) ::  kw        !< Child-grid index limited to kw <= nzt+1 for wall_flags_total_0
 
        REAL(wp)     ::  tolex     !< Tolerance for grid-line matching in x-direction    
@@ -1779,5 +1783,5 @@
 !--    Note that ii, jj, and kk are parent-grid indices. 
 !--    This information is needed in the anterpolation. 
-!--    The indices for wall_flags_static_0 (kw,jw,iw) must be limited to the range 
+!--    The indices for wall_flags_total_0 (kw,jw,iw) must be limited to the range 
 !--    [-1,...,nx/ny/nzt+1] in order to avoid zero values on the outer ghost nodes.
        DO  ii = ipla, ipra
@@ -1793,5 +1797,5 @@
                          kw = MIN( k, nzt+1 )                
                          ijkfc_u(kk,jj,ii) = ijkfc_u(kk,jj,ii)                                      &
-                              + MERGE( 1, 0, BTEST( wall_flags_static_0(kw,jw,iw), 1 ) )
+                              + MERGE( 1, 0, BTEST( wall_flags_total_0(kw,jw,iw), 1 ) )
                       ENDDO
                    ENDDO
@@ -1806,5 +1810,5 @@
                          kw = MIN( k, nzt+1 )                                        
                          ijkfc_v(kk,jj,ii) = ijkfc_v(kk,jj,ii)                                      &
-                              + MERGE( 1, 0, BTEST( wall_flags_static_0(kw,jw,iw), 2 ) )
+                              + MERGE( 1, 0, BTEST( wall_flags_total_0(kw,jw,iw), 2 ) )
                       ENDDO
                    ENDDO
@@ -1819,5 +1823,5 @@
                          kw = MIN( k, nzt+1 )
                          ijkfc_s(kk,jj,ii) = ijkfc_s(kk,jj,ii)                                      &
-                              + MERGE( 1, 0, BTEST( wall_flags_static_0(kw,jw,iw), 0 ) )
+                              + MERGE( 1, 0, BTEST( wall_flags_total_0(kw,jw,iw), 0 ) )
                       ENDDO
                    ENDDO
@@ -1832,5 +1836,5 @@
                          kw = MIN( k, nzt+1 )
                          ijkfc_w(kk,jj,ii) = ijkfc_w(kk,jj,ii)                                      &
-                              + MERGE( 1, 0, BTEST( wall_flags_static_0(kw,jw,iw), 3 ) )
+                              + MERGE( 1, 0, BTEST( wall_flags_total_0(kw,jw,iw), 3 ) )
                       ENDDO
                    ENDDO
@@ -2753,10 +2757,10 @@
              DO  jc = nysg, nyng
                 DO  kc = nzb, nzt
-                   u(kc,jc,ic)   = MERGE( u(kc,jc,ic), 0.0_wp, BTEST( wall_flags_static_0(kc,jc,ic), 1 ) )
-                   v(kc,jc,ic)   = MERGE( v(kc,jc,ic), 0.0_wp, BTEST( wall_flags_static_0(kc,jc,ic), 2 ) )
-                   w(kc,jc,ic)   = MERGE( w(kc,jc,ic), 0.0_wp, BTEST( wall_flags_static_0(kc,jc,ic), 3 ) )
-                   u_p(kc,jc,ic) = MERGE( u_p(kc,jc,ic), 0.0_wp, BTEST( wall_flags_static_0(kc,jc,ic), 1 ) )
-                   v_p(kc,jc,ic) = MERGE( v_p(kc,jc,ic), 0.0_wp, BTEST( wall_flags_static_0(kc,jc,ic), 2 ) )
-                   w_p(kc,jc,ic) = MERGE( w_p(kc,jc,ic), 0.0_wp, BTEST( wall_flags_static_0(kc,jc,ic), 3 ) )
+                   u(kc,jc,ic)   = MERGE( u(kc,jc,ic), 0.0_wp, BTEST( wall_flags_total_0(kc,jc,ic), 1 ) )
+                   v(kc,jc,ic)   = MERGE( v(kc,jc,ic), 0.0_wp, BTEST( wall_flags_total_0(kc,jc,ic), 2 ) )
+                   w(kc,jc,ic)   = MERGE( w(kc,jc,ic), 0.0_wp, BTEST( wall_flags_total_0(kc,jc,ic), 3 ) )
+                   u_p(kc,jc,ic) = MERGE( u_p(kc,jc,ic), 0.0_wp, BTEST( wall_flags_total_0(kc,jc,ic), 1 ) )
+                   v_p(kc,jc,ic) = MERGE( v_p(kc,jc,ic), 0.0_wp, BTEST( wall_flags_total_0(kc,jc,ic), 2 ) )
+                   w_p(kc,jc,ic) = MERGE( w_p(kc,jc,ic), 0.0_wp, BTEST( wall_flags_total_0(kc,jc,ic), 3 ) )
                 ENDDO
              ENDDO
@@ -3271,7 +3275,7 @@
                 DO   j = nysg, nyng
                    DO  k = nzb, nzt+1
-                      u(k,j,i) = MERGE( u(k,j,i), 0.0_wp, BTEST( wall_flags_static_0(k,j,i), 1 ) )
-                      v(k,j,i) = MERGE( v(k,j,i), 0.0_wp, BTEST( wall_flags_static_0(k,j,i), 2 ) )
-                      w(k,j,i) = MERGE( w(k,j,i), 0.0_wp, BTEST( wall_flags_static_0(k,j,i), 3 ) )
+                      u(k,j,i) = MERGE( u(k,j,i), 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 1 ) )
+                      v(k,j,i) = MERGE( v(k,j,i), 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 2 ) )
+                      w(k,j,i) = MERGE( w(k,j,i), 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 3 ) )
 !
 !--                 TO_DO: zero setting of temperature within topography creates
@@ -4633,5 +4637,5 @@
                      DO  kc = kfl(kp), kfu(kp)
                         cellsum = cellsum + MERGE( child_array(kc,jc,ic), 0.0_wp,                   &
-                             BTEST( wall_flags_static_0(kc,jc,ic), var_flag ) )
+                             BTEST( wall_flags_total_0(kc,jc,ic), var_flag ) )
                      ENDDO
                   ENDDO
@@ -4924,5 +4928,5 @@
           DO   k = nzb+1, nzt
              sub_sum = sub_sum + innor * u(k,j,i) * dzw(k)                                          &
-                               * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_static_0(k,j,i), 1 ) )
+                               * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 1 ) )
           ENDDO
           volume_flux_local = volume_flux_local + sub_sum
@@ -4947,5 +4951,5 @@
           DO   k = nzb+1, nzt
              sub_sum = sub_sum + innor * u(k,j,i) * dzw(k)                                          &
-                               * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_static_0(k,j,i), 1 ) )
+                               * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 1 ) )
           ENDDO
           volume_flux_local = volume_flux_local + sub_sum
@@ -4970,5 +4974,5 @@
           DO   k = nzb+1, nzt
              sub_sum = sub_sum + innor * v(k,j,i) * dzw(k)                                          &
-                               * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_static_0(k,j,i), 2 ) )
+                               * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 2 ) )
           ENDDO
           volume_flux_local = volume_flux_local + sub_sum
@@ -4993,5 +4997,5 @@
           DO  k = nzb+1, nzt
              sub_sum = sub_sum + innor * v(k,j,i) * dzw(k)                                          &
-                               * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_static_0(k,j,i), 2 ) )
+                               * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 2 ) )
           ENDDO
           volume_flux_local = volume_flux_local + sub_sum
@@ -5063,5 +5067,5 @@
              DO  k = nzb + 1, nzt
                 u(k,j,i) = u(k,j,i) + u_corr_left                              &
-                     * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_static_0(k,j,i), 1 ) )
+                     * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 1 ) )
              ENDDO
           ENDDO
@@ -5075,5 +5079,5 @@
              DO  k = nzb + 1, nzt
                 u(k,j,i) = u(k,j,i) + u_corr_right                              &
-                      * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_static_0(k,j,i), 1 ) )
+                      * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 1 ) )
              ENDDO
           ENDDO
@@ -5087,5 +5091,5 @@
              DO  k = nzb + 1, nzt
                 v(k,j,i) = v(k,j,i) + v_corr_south                              &
-                      * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_static_0(k,j,i), 2 ) )
+                      * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 2 ) )
              ENDDO
           ENDDO
@@ -5099,5 +5103,5 @@
              DO  k = nzb + 1, nzt
                 v(k,j,i) = v(k,j,i) + v_corr_north                              &
-                      * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_static_0(k,j,i), 2 ) )
+                      * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 2 ) )
              ENDDO
           ENDDO
