Index: palm/trunk/SOURCE/bulk_cloud_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/bulk_cloud_model_mod.f90	(revision 4027)
+++ palm/trunk/SOURCE/bulk_cloud_model_mod.f90	(revision 4109)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-! 
+! Pass integer flag array as well as boundary flags to WS scalar advection 
+! routine
 ! 
 ! Former revisions:
@@ -249,5 +250,13 @@
 
     USE control_parameters,                                                    &
-        ONLY:  debug_output,                                                   &
+        ONLY:  bc_dirichlet_l,                                                 &
+               bc_dirichlet_n,                                                 &
+               bc_dirichlet_r,                                                 &
+               bc_dirichlet_s,                                                 &
+               bc_radiation_l,                                                 &
+               bc_radiation_n,                                                 &
+               bc_radiation_r,                                                 &
+               bc_radiation_s,                                                 &                                                                
+               debug_output,                                                   &
                dt_3d, dt_do2d_xy, intermediate_timestep_count,                 &
                intermediate_timestep_count_max, large_scale_forcing,           &
@@ -266,5 +275,6 @@
 
     USE indices,                                                               &
-        ONLY:  nbgp, nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt,     &
+        ONLY:  advc_flags_s,                                                   &
+               nbgp, nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt,     &
                wall_flags_0
 
@@ -1483,5 +1493,9 @@
              IF ( timestep_scheme(1:5) == 'runge' )  THEN
                 IF ( ws_scheme_sca )  THEN
-                   CALL advec_s_ws( qc, 'qc' )
+                   CALL advec_s_ws( advc_flags_s, qc, 'qc',                    &
+                                    bc_dirichlet_l  .OR.  bc_radiation_l,      &
+                                    bc_dirichlet_n  .OR.  bc_radiation_n,      &
+                                    bc_dirichlet_r  .OR.  bc_radiation_r,      &
+                                    bc_dirichlet_s  .OR.  bc_radiation_s )
                 ELSE
                    CALL advec_s_pw( qc )
@@ -1569,5 +1583,9 @@
              IF ( timestep_scheme(1:5) == 'runge' )  THEN
                 IF ( ws_scheme_sca )  THEN
-                   CALL advec_s_ws( nc, 'nc' )
+                   CALL advec_s_ws( advc_flags_s, nc, 'nc',                    &
+                                    bc_dirichlet_l  .OR.  bc_radiation_l,      &
+                                    bc_dirichlet_n  .OR.  bc_radiation_n,      &
+                                    bc_dirichlet_r  .OR.  bc_radiation_r,      &
+                                    bc_dirichlet_s  .OR.  bc_radiation_s )
                 ELSE
                    CALL advec_s_pw( nc )
@@ -1662,5 +1680,9 @@
              IF ( timestep_scheme(1:5) == 'runge' )  THEN
                 IF ( ws_scheme_sca )  THEN
-                   CALL advec_s_ws( qr, 'qr' )
+                   CALL advec_s_ws( advc_flags_s, qr, 'qr',                    &
+                                    bc_dirichlet_l  .OR.  bc_radiation_l,      &
+                                    bc_dirichlet_n  .OR.  bc_radiation_n,      &
+                                    bc_dirichlet_r  .OR.  bc_radiation_r,      &
+                                    bc_dirichlet_s  .OR.  bc_radiation_s )
                 ELSE
                    CALL advec_s_pw( qr )
@@ -1748,5 +1770,9 @@
              IF ( timestep_scheme(1:5) == 'runge' )  THEN
                 IF ( ws_scheme_sca )  THEN
-                   CALL advec_s_ws( nr, 'nr' )
+                   CALL advec_s_ws( advc_flags_s, nr, 'nr',                    &
+                                    bc_dirichlet_l  .OR.  bc_radiation_l,      &
+                                    bc_dirichlet_n  .OR.  bc_radiation_n,      &
+                                    bc_dirichlet_r  .OR.  bc_radiation_r,      &
+                                    bc_dirichlet_s  .OR.  bc_radiation_s )
                 ELSE
                    CALL advec_s_pw( nr )
@@ -1842,7 +1868,11 @@
           THEN
              IF ( ws_scheme_sca )  THEN
-                CALL advec_s_ws( i, j, qc, 'qc', flux_s_qc,       &
-                                 diss_s_qc, flux_l_qc, diss_l_qc, &
-                                 i_omp_start, tn )
+                CALL advec_s_ws( advc_flags_s, i, j, qc, 'qc', flux_s_qc,      &
+                                 diss_s_qc, flux_l_qc, diss_l_qc,              &
+                                 i_omp_start, tn,                              &
+                                 bc_dirichlet_l  .OR.  bc_radiation_l,         &
+                                 bc_dirichlet_n  .OR.  bc_radiation_n,         &
+                                 bc_dirichlet_r  .OR.  bc_radiation_r,         &
+                                 bc_dirichlet_s  .OR.  bc_radiation_s )
              ELSE
                 CALL advec_s_pw( i, j, qc )
@@ -1897,7 +1927,11 @@
           IF ( timestep_scheme(1:5) == 'runge' )  THEN
              IF ( ws_scheme_sca )  THEN
-                CALL advec_s_ws( i, j, nc, 'nc', flux_s_nc,    &
-                              diss_s_nc, flux_l_nc, diss_l_nc, &
-                              i_omp_start, tn )
+                CALL advec_s_ws( advc_flags_s, i, j, nc, 'nc', flux_s_nc,      &
+                                 diss_s_nc, flux_l_nc, diss_l_nc,              &
+                                 i_omp_start, tn,                              &
+                                 bc_dirichlet_l  .OR.  bc_radiation_l,         &
+                                 bc_dirichlet_n  .OR.  bc_radiation_n,         &
+                                 bc_dirichlet_r  .OR.  bc_radiation_r,         &
+                                 bc_dirichlet_s  .OR.  bc_radiation_s )
              ELSE
                 CALL advec_s_pw( i, j, nc )
@@ -1958,7 +1992,11 @@
           THEN
              IF ( ws_scheme_sca )  THEN
-                CALL advec_s_ws( i, j, qr, 'qr', flux_s_qr,       &
-                                 diss_s_qr, flux_l_qr, diss_l_qr, &
-                                 i_omp_start, tn )
+                CALL advec_s_ws( advc_flags_s, i, j, qr, 'qr', flux_s_qr,      &
+                                 diss_s_qr, flux_l_qr, diss_l_qr,              &
+                                 i_omp_start, tn,                              &
+                                 bc_dirichlet_l  .OR.  bc_radiation_l,         &
+                                 bc_dirichlet_n  .OR.  bc_radiation_n,         &
+                                 bc_dirichlet_r  .OR.  bc_radiation_r,         &
+                                 bc_dirichlet_s  .OR.  bc_radiation_s )
              ELSE
                 CALL advec_s_pw( i, j, qr )
@@ -2013,7 +2051,11 @@
           IF ( timestep_scheme(1:5) == 'runge' )  THEN
              IF ( ws_scheme_sca )  THEN
-                CALL advec_s_ws( i, j, nr, 'nr', flux_s_nr,    &
-                              diss_s_nr, flux_l_nr, diss_l_nr, &
-                              i_omp_start, tn )
+                CALL advec_s_ws( advc_flags_s, i, j, nr, 'nr', flux_s_nr,      &
+                                 diss_s_nr, flux_l_nr, diss_l_nr,              &
+                                 i_omp_start, tn,                              &
+                                 bc_dirichlet_l  .OR.  bc_radiation_l,         &
+                                 bc_dirichlet_n  .OR.  bc_radiation_n,         &
+                                 bc_dirichlet_r  .OR.  bc_radiation_r,         &
+                                 bc_dirichlet_s  .OR.  bc_radiation_s )
              ELSE
                 CALL advec_s_pw( i, j, nr )
