Index: palm/trunk/SOURCE/bulk_cloud_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/bulk_cloud_model_mod.f90	(revision 3885)
+++ palm/trunk/SOURCE/bulk_cloud_model_mod.f90	(revision 3887)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added bcm_exchange_horiz which is called after non_transport_physics
+! 
+! 3885 2019-04-11 11:29:34Z kanani
 ! Changes related to global restructuring of location messages and introduction 
 ! of additional debug messages
@@ -260,5 +263,5 @@
 
     USE indices,                                                               &
-        ONLY:  nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt,           &
+        ONLY:  nbgp, nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt,     &
                wall_flags_0
 
@@ -369,4 +372,5 @@
            bcm_actions, &
            bcm_non_transport_physics, &
+           bcm_exchange_horiz, &
            bcm_prognostic_equations, &
            bcm_3d_data_averaging, &
@@ -432,4 +436,8 @@
        MODULE PROCEDURE bcm_non_transport_physics_ij
     END INTERFACE bcm_non_transport_physics
+
+    INTERFACE bcm_exchange_horiz
+       MODULE PROCEDURE bcm_exchange_horiz
+    END INTERFACE bcm_exchange_horiz    
 
     INTERFACE bcm_prognostic_equations
@@ -1312,4 +1320,33 @@
 
     END SUBROUTINE bcm_non_transport_physics_ij
+    
+    
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Control of microphysics for all grid points
+!------------------------------------------------------------------------------!
+    SUBROUTINE bcm_exchange_horiz
+
+
+       IF ( .NOT. microphysics_sat_adjust  .AND.                                &
+            ( intermediate_timestep_count == 1  .OR.                            &
+              call_microphysics_at_all_substeps ) )                             &
+       THEN
+          IF ( microphysics_morrison )  THEN
+             CALL exchange_horiz( nc, nbgp )
+             CALL exchange_horiz( qc, nbgp )          
+          ENDIF
+          IF ( microphysics_seifert ) THEN
+             CALL exchange_horiz( qr, nbgp )
+             CALL exchange_horiz( nr, nbgp )
+          ENDIF
+          CALL exchange_horiz( q, nbgp )
+          CALL exchange_horiz( pt, nbgp )          
+       ENDIF
+
+
+    END SUBROUTINE bcm_exchange_horiz
+    
 
 
@@ -2898,6 +2935,6 @@
        CALL cpu_log( log_point_s(50), 'adjust_cloud', 'start' )
 
-       DO  i = nxlg, nxrg
-          DO  j = nysg, nyng
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
              DO  k = nzb+1, nzt
 !
@@ -3020,6 +3057,6 @@
        CALL cpu_log( log_point_s(65), 'activation', 'start' )
 
-       DO  i = nxlg, nxrg
-          DO  j = nysg, nyng
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
              DO  k = nzb+1, nzt
 !
@@ -3221,6 +3258,6 @@
        CALL cpu_log( log_point_s(66), 'condensation', 'start' )
 
-       DO  i = nxlg, nxrg
-          DO  j = nysg, nyng
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
              DO  k = nzb+1, nzt
 !
@@ -3381,6 +3418,6 @@
        CALL cpu_log( log_point_s(47), 'autoconversion', 'start' )
 
-       DO  i = nxlg, nxrg
-          DO  j = nysg, nyng
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
              DO  k = nzb+1, nzt
 !
@@ -3615,6 +3652,6 @@
        REAL(wp)    ::  flag        !< flag to mask topography grid points
 
-       DO  i = nxlg, nxrg
-          DO  j = nysg, nyng
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
 !
 !--          Determine vertical index of topography top
@@ -3716,6 +3753,6 @@
        CALL cpu_log( log_point_s(56), 'accretion', 'start' )
 
-       DO  i = nxlg, nxrg
-          DO  j = nysg, nyng
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
              DO  k = nzb+1, nzt
 !
@@ -3877,6 +3914,6 @@
        CALL cpu_log( log_point_s(57), 'selfcollection', 'start' )
 
-       DO  i = nxlg, nxrg
-          DO  j = nysg, nyng
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
              DO  k = nzb+1, nzt
 !
@@ -3994,6 +4031,6 @@
        CALL cpu_log( log_point_s(58), 'evaporation', 'start' )
 
-       DO  i = nxlg, nxrg
-          DO  j = nysg, nyng
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
              DO  k = nzb+1, nzt
 !
@@ -4230,6 +4267,6 @@
        sed_nc(nzt+1) = 0.0_wp
 
-       DO  i = nxlg, nxrg
-          DO  j = nysg, nyng
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
              DO  k = nzt, nzb+1, -1
 !
@@ -4430,6 +4467,6 @@
 !
 !--    Compute velocities
-       DO  i = nxlg, nxrg
-          DO  j = nysg, nyng
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
              DO  k = nzb+1, nzt
 !
