Index: palm/trunk/SOURCE/dynamics_mod.f90
===================================================================
--- palm/trunk/SOURCE/dynamics_mod.f90	(revision 4627)
+++ palm/trunk/SOURCE/dynamics_mod.f90	(revision 4731)
@@ -24,4 +24,7 @@
 ! -----------------
 ! $Id$
+! Move exchange_horiz from time_integration to modules
+!
+! 4627 2020-07-26 10:14:44Z raasch
 ! bugfix for r4626
 !
@@ -67,5 +70,9 @@
     USE arrays_3d,                                                                                 &
         ONLY:  c_u, c_u_m, c_u_m_l, c_v, c_v_m, c_v_m_l, c_w, c_w_m, c_w_m_l,                      &
+               diss,                                                                               &
+               diss_p,                                                                             &
                dzu,                                                                                &
+               e,                                                                                  &
+               e_p,                                                                                &
                exner,                                                                              &
                hyp,                                                                                &
@@ -94,4 +101,5 @@
                child_domain,                                                                       &
                coupling_mode,                                                                      &
+               constant_diffusion,                                                                 &
                dt_3d,                                                                              &
                humidity,                                                                           &
@@ -113,6 +121,12 @@
                passive_scalar,                                                                     &
                restart_string,                                                                     &
+               rans_mode,                                                                          &
+               rans_tke_e,                                                                         &
                tsc,                                                                                &
                use_cmax
+
+    USE exchange_horiz_mod,                                                                        &
+        ONLY:  exchange_horiz
+
 
     USE grid_variables,                                                                            &
@@ -764,7 +778,37 @@
 !> Perform module-specific horizontal boundary exchange
 !--------------------------------------------------------------------------------------------------!
- SUBROUTINE dynamics_exchange_horiz
-
-
+ SUBROUTINE dynamics_exchange_horiz( location )
+
+       CHARACTER (LEN=*), INTENT(IN) ::  location !< call location string
+
+       SELECT CASE ( location )
+
+          CASE ( 'before_prognostic_equation' )
+
+          CASE ( 'after_prognostic_equation' )
+
+             CALL exchange_horiz( u_p, nbgp )
+             CALL exchange_horiz( v_p, nbgp )
+             CALL exchange_horiz( w_p, nbgp )
+             CALL exchange_horiz( pt_p, nbgp )
+             IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e_p, nbgp )
+             IF ( rans_tke_e  )               CALL exchange_horiz( diss_p, nbgp )
+             IF ( humidity )                  CALL exchange_horiz( q_p, nbgp )
+             IF ( passive_scalar )            CALL exchange_horiz( s_p, nbgp )
+
+          CASE ( 'after_anterpolation' )
+
+             CALL exchange_horiz( u, nbgp )
+             CALL exchange_horiz( v, nbgp )
+             CALL exchange_horiz( w, nbgp )
+             IF ( .NOT. neutral )             CALL exchange_horiz( pt, nbgp )
+             IF ( humidity )                  CALL exchange_horiz( q, nbgp )
+             IF ( passive_scalar )            CALL exchange_horiz( s, nbgp )
+             IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e, nbgp )
+             IF ( .NOT. constant_diffusion  .AND.  rans_mode  .AND.  rans_tke_e )  THEN
+                CALL exchange_horiz( diss, nbgp )
+             ENDIF
+
+       END SELECT
 
  END SUBROUTINE dynamics_exchange_horiz
