Index: /palm/trunk/SOURCE/palm.f90
===================================================================
--- /palm/trunk/SOURCE/palm.f90	(revision 1780)
+++ /palm/trunk/SOURCE/palm.f90	(revision 1781)
@@ -19,5 +19,5 @@
 ! Current revisions:
 ! -----------------
-!
+! pmc initialization moved from time_integration to here
 !
 ! Former revisions:
@@ -120,7 +120,8 @@
 
     USE control_parameters,                                                    &
-        ONLY:  coupling_char, coupling_mode, do2d_at_begin, do3d_at_begin,     &
-               io_blocks, io_group, large_scale_forcing, message_string,       &
-               nest_domain, nudging, simulated_time, simulated_time_chr,       &
+        ONLY:  constant_diffusion, coupling_char, coupling_mode,               &
+               do2d_at_begin, do3d_at_begin, humidity, io_blocks, io_group,    &
+               large_scale_forcing, message_string, nest_domain, nudging,      &
+               passive_scalar, simulated_time, simulated_time_chr,             &
                user_interface_current_revision,                                &
                user_interface_required_revision, version, wall_heatflux,       &
@@ -135,5 +136,5 @@
 
     USE indices,                                                               &
-        ONLY:  ngp_2dh, ngp_2dh_s_inner, nzb_diff_s_inner, nzb_diff_s_outer,   &
+        ONLY:  nbgp, ngp_2dh, ngp_2dh_s_inner, nzb_diff_s_inner, nzb_diff_s_outer,   &
                nzb_diff_u, nzb_diff_v, nzb_s_inner, nzb_s_outer, nzb_u_inner,  &
                nzb_u_outer, nzb_v_inner, nzb_v_outer, nzb_w_inner,             &
@@ -155,5 +156,6 @@
 
     USE pmc_interface,                                                         &
-        ONLY:  cpl_id, nested_run, pmci_init, pmci_modelconfiguration
+        ONLY:  cpl_id, nested_run, pmci_client_initialize, pmci_init,          &
+               pmci_modelconfiguration, pmci_server_initialize
 
     USE statistics,                                                            &
@@ -326,5 +328,27 @@
     IF ( nested_run )  THEN
        CALL pmci_modelconfiguration
-    ENDIF
+!
+!--    Receive and interpolate initial data on client.
+!--    Client initialization must be made first if the model is both client and
+!--    server
+       CALL pmci_client_initialize
+!
+!--    Send initial condition data from server to client
+       CALL pmci_server_initialize
+!
+!--    Exchange_horiz is needed after the nest initialization
+       IF ( nest_domain )  THEN
+          CALL exchange_horiz( u, nbgp )
+          CALL exchange_horiz( v, nbgp )
+          CALL exchange_horiz( w, nbgp )
+          CALL exchange_horiz( pt, nbgp )
+          IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e, nbgp )
+          IF (humidity  .OR.  passive_scalar)  THEN
+             CALL exchange_horiz( q, nbgp )
+          ENDIF
+       ENDIF
+
+    ENDIF
+
 
 !
Index: /palm/trunk/SOURCE/pmc_interface.f90
===================================================================
--- /palm/trunk/SOURCE/pmc_interface.f90	(revision 1780)
+++ /palm/trunk/SOURCE/pmc_interface.f90	(revision 1781)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-!
+! _p arrays are set zero within buildings too, t.._m arrays and respective
+! settings within buildings completely removed
 !
 ! Former revisions:
@@ -53,13 +54,12 @@
 
 #if defined( __nopointer )
-!-- TO_DO: is it really required to use arrays te_m, tu_m, etc. and to set them
-!--        to zero withi buildings?
     USE arrays_3d,                                                             &
-        ONLY:  dzu, dzw, e, e_p, pt, pt_p, q, q_p, te_m, tu_m, tv_m, tw_m, u,  &
-               u_p, v, v_p, w, w_p, zu, zw, z0
+        ONLY:  dzu, dzw, e, e_p, pt, pt_p, q, q_p, u, u_p, v, v_p, w, w_p, zu, &
+               zw, z0
 #else
    USE arrays_3d,                                                              &
-        ONLY:  dzu, dzw, e, e_p, e_1, e_2, pt, pt_p, pt_1, pt_2, q, q_p, q_1, q_2, te_m, tu_m, &
-               tv_m, tw_m, u, u_p, u_1, u_2, v, v_p, v_1, v_2, w, w_p, w_1, w_2, zu, zw, z0
+        ONLY:  dzu, dzw, e, e_p, e_1, e_2, pt, pt_p, pt_1, pt_2, q, q_p, q_1,  &
+               q_2, u, u_p, u_1, u_2, v, v_p, v_1, v_2, w, w_p, w_1, w_2, zu,  &
+               zw, z0
 #endif
 
@@ -2337,12 +2337,8 @@
              DO   i = nxlg, nxrg
                 DO   j = nysg, nyng
-                   u(nzb:nzb_u_inner(j,i),j,i)     = 0.0_wp
-                   v(nzb:nzb_v_inner(j,i),j,i)     = 0.0_wp
-                   w(nzb:nzb_w_inner(j,i),j,i)     = 0.0_wp
-                   e(nzb:nzb_w_inner(j,i),j,i)     = 0.0_wp
-                   tu_m(nzb:nzb_u_inner(j,i),j,i)  = 0.0_wp
-                   tv_m(nzb:nzb_v_inner(j,i),j,i)  = 0.0_wp
-                   tw_m(nzb:nzb_w_inner(j,i),j,i)  = 0.0_wp
-                   te_m(nzb:nzb_w_inner(j,i),j,i)  = 0.0_wp
+                   u(nzb:nzb_u_inner(j,i),j,i) = 0.0_wp
+                   v(nzb:nzb_v_inner(j,i),j,i) = 0.0_wp
+                   w(nzb:nzb_w_inner(j,i),j,i) = 0.0_wp
+                   e(nzb:nzb_w_inner(j,i),j,i) = 0.0_wp
                 ENDDO
              ENDDO
@@ -3621,12 +3617,12 @@
           DO   i = nxlg, nxrg
              DO   j = nysg, nyng
-                u(nzb:nzb_u_inner(j,i),j,i)     = 0.0_wp
-                v(nzb:nzb_v_inner(j,i),j,i)     = 0.0_wp
-                w(nzb:nzb_w_inner(j,i),j,i)     = 0.0_wp
-                e(nzb:nzb_w_inner(j,i),j,i)     = 0.0_wp              
-                tu_m(nzb:nzb_u_inner(j,i),j,i)  = 0.0_wp
-                tv_m(nzb:nzb_v_inner(j,i),j,i)  = 0.0_wp
-                tw_m(nzb:nzb_w_inner(j,i),j,i)  = 0.0_wp
-                te_m(nzb:nzb_w_inner(j,i),j,i)  = 0.0_wp
+                u(nzb:nzb_u_inner(j,i),j,i)   = 0.0_wp
+                v(nzb:nzb_v_inner(j,i),j,i)   = 0.0_wp
+                w(nzb:nzb_w_inner(j,i),j,i)   = 0.0_wp
+                e(nzb:nzb_s_inner(j,i),j,i)   = 0.0_wp
+                u_p(nzb:nzb_u_inner(j,i),j,i) = 0.0_wp
+                v_p(nzb:nzb_v_inner(j,i),j,i) = 0.0_wp
+                w_p(nzb:nzb_w_inner(j,i),j,i) = 0.0_wp
+                e_p(nzb:nzb_s_inner(j,i),j,i) = 0.0_wp
              ENDDO
           ENDDO
Index: /palm/trunk/SOURCE/time_integration.f90
===================================================================
--- /palm/trunk/SOURCE/time_integration.f90	(revision 1780)
+++ /palm/trunk/SOURCE/time_integration.f90	(revision 1781)
@@ -19,5 +19,6 @@
 ! Current revisions:
 ! ------------------
-!
+! some pmc calls removed at the beginning (before timeloop),
+! pmc initialization moved to the main program
 !
 ! Former revisions:
@@ -245,6 +246,5 @@
         ONLY:  client_to_server, nested_run, nesting_mode,                     &
                pmci_ensure_nest_mass_conservation, pmci_client_datatrans,      &
-               pmci_client_initialize, pmci_client_synchronize,                &
-               pmci_server_datatrans, pmci_server_initialize,                  &
+               pmci_client_synchronize, pmci_server_datatrans,                 &
                pmci_server_synchronize, pmci_update_new, server_to_client
 
@@ -309,50 +309,4 @@
           time_coupling = time_since_reference_point
        ENDIF
-    ENDIF
-
-    IF ( nested_run )  THEN
-!
-!--    TO_DO: try to give more meaningful comments here
-!--    Domain nesting: From server to client commmunication
-!--    ( direction=SERVER_TO_CLIENT )
-!--    Nest initial conditions
-!
-!--    Send initial condition data from server to client
-       CALL pmci_server_initialize
-!
-!--    Receive and interpolate initial data on client
-       CALL pmci_client_initialize
-!
-!--    TO_DO, maybe removed
-!--    Obs. Nesting may be unnecessary at this point.
-!
-!--    Nest boundary conditions
-       CALL pmci_server_datatrans( server_to_client )
-       CALL pmci_client_datatrans( server_to_client )
-
-       IF ( nesting_mode == 'two-way' )  THEN
-          CALL pmci_server_datatrans( client_to_server )
-          CALL pmci_client_datatrans( client_to_server )
-!
-!--       Exchange_horiz is needed for all server-domains after the anterpolation
-          CALL exchange_horiz( u, nbgp )
-          CALL exchange_horiz( v, nbgp )
-          CALL exchange_horiz( w, nbgp )
-          CALL exchange_horiz( pt, nbgp )
-          IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e, nbgp )
-          intermediate_timestep_count = 0
-          CALL pres
-       ENDIF
-!
-!--    Correct the w top-BC in nest domains to ensure mass conservation.
-!--    Copy the interpolated/anterpolated boundary values to the _p
-!--    arrays, too, to make sure the interpolated/anterpolated boundary
-!--    values are carried over from one RK inner step to another.
-!--    These actions must not be done for the root domain.
-       IF ( nest_domain )  THEN
-          CALL pmci_ensure_nest_mass_conservation
-          CALL pmci_update_new
-       ENDIF
-
     ENDIF
 
