Index: palm/trunk/SOURCE/pmc_handle_communicator.f90
===================================================================
--- palm/trunk/SOURCE/pmc_handle_communicator.f90	(revision 1792)
+++ palm/trunk/SOURCE/pmc_handle_communicator.f90	(revision 1797)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-!
+! introduction of different datatransfer modes,
+! export of comm_world_nesting
 !
 ! Former revisions:
@@ -90,4 +91,5 @@
    ! Coupler Setup
 
+   INTEGER                                    :: m_world_comm !global nesting communicator
    INTEGER                                    :: m_my_CPL_id  !Coupler id of this model
    INTEGER                                    :: m_Parent_id  !Coupler id of parent of this model
@@ -125,5 +127,6 @@
  CONTAINS
 
-   SUBROUTINE pmc_init_model( comm, nesting_mode, pmc_status )
+   SUBROUTINE pmc_init_model( comm, nesting_datatransfer_mode, nesting_mode,   &
+                              pmc_status )
 
       USE control_parameters,                                                  &
@@ -136,4 +139,5 @@
 
       CHARACTER(LEN=7), INTENT(OUT) ::  nesting_mode
+      CHARACTER(LEN=7), INTENT(OUT) ::  nesting_datatransfer_mode
 
       INTEGER, INTENT(OUT)                ::  comm
@@ -148,4 +152,5 @@
       pmc_status   = pmc_status_ok
       comm         = -1
+      m_world_comm = MPI_COMM_WORLD
       m_my_cpl_id  = -1
       clientcount  =  0
@@ -159,5 +164,6 @@
       IF ( m_world_rank == 0 )  THEN
 
-         CALL read_coupling_layout( nesting_mode, pmc_status )
+         CALL read_coupling_layout( nesting_datatransfer_mode, nesting_mode,   &
+                                    pmc_status )
 
          IF ( pmc_status /= pmc_no_namelist_found  .AND.                       &
@@ -221,5 +227,7 @@
          CALL MPI_BCAST( m_couplers(i)%lower_left_x, 1, MPI_REAL,    0, MPI_COMM_WORLD, istat )
          CALL MPI_BCAST( m_couplers(i)%lower_left_y, 1, MPI_REAL,    0, MPI_COMM_WORLD, istat )
+!--      TO_DO: the next two calls can and should probably moved outside this loop
          CALL MPI_BCAST( nesting_mode, LEN( nesting_mode ), MPI_CHARACTER, 0, MPI_COMM_WORLD, istat )
+         CALL MPI_BCAST( nesting_datatransfer_mode, LEN(nesting_datatransfer_mode), MPI_CHARACTER, 0, MPI_COMM_WORLD, istat )
       ENDDO
 
@@ -329,7 +337,7 @@
 !
 !-- Provide module private variables of the pmc for PALM
-    SUBROUTINE pmc_get_model_info( cpl_id, cpl_name, cpl_parent_id,            &
-                                   lower_left_x, lower_left_y, ncpl, npe_total,&
-                                   request_for_cpl_id )
+    SUBROUTINE pmc_get_model_info( comm_world_nesting, cpl_id, cpl_name,       &
+                                   cpl_parent_id, lower_left_x, lower_left_y,  &
+                                   ncpl, npe_total, request_for_cpl_id )
 
       USE kinds
@@ -341,4 +349,5 @@
       INTEGER, INTENT(IN), OPTIONAL ::  request_for_cpl_id
 
+      INTEGER, INTENT(OUT), OPTIONAL ::  comm_world_nesting
       INTEGER, INTENT(OUT), OPTIONAL ::  cpl_id
       INTEGER, INTENT(OUT), OPTIONAL ::  cpl_parent_id
@@ -364,6 +373,9 @@
 !
 !--   Return the requested information
+      IF ( PRESENT( comm_world_nesting )  )  THEN
+         comm_world_nesting = m_world_comm
+      ENDIF
       IF ( PRESENT( cpl_id )        )  THEN
-         cpl_id        = requested_cpl_id
+         cpl_id = requested_cpl_id
       ENDIF
       IF ( PRESENT( cpl_parent_id ) )  THEN
@@ -371,17 +383,17 @@
       ENDIF
       IF ( PRESENT( cpl_name )      )  THEN
-         cpl_name      = m_couplers(requested_cpl_id)%name
+         cpl_name = m_couplers(requested_cpl_id)%name
       ENDIF
       IF ( PRESENT( ncpl )          )  THEN
-         ncpl          = m_ncpl
+         ncpl = m_ncpl
       ENDIF
       IF ( PRESENT( npe_total )     )  THEN
-         npe_total     = m_couplers(requested_cpl_id)%npe_total
+         npe_total = m_couplers(requested_cpl_id)%npe_total
       ENDIF
       IF ( PRESENT( lower_left_x )  )  THEN
-         lower_left_x  = m_couplers(requested_cpl_id)%lower_left_x
+         lower_left_x = m_couplers(requested_cpl_id)%lower_left_x
       ENDIF
       IF ( PRESENT( lower_left_y )  )  THEN
-         lower_left_y  = m_couplers(requested_cpl_id)%lower_left_y
+         lower_left_y = m_couplers(requested_cpl_id)%lower_left_y
       ENDIF
 
@@ -400,9 +412,11 @@
 
 
- SUBROUTINE read_coupling_layout( nesting_mode, pmc_status )
+ SUBROUTINE read_coupling_layout( nesting_datatransfer_mode, nesting_mode,     &
+                                  pmc_status )
 
     IMPLICIT NONE
 
-    CHARACTER(LEN=7) ::  nesting_mode
+    CHARACTER(LEN=7), INTENT(INOUT) ::  nesting_mode
+    CHARACTER(LEN=7), INTENT(INOUT) ::  nesting_datatransfer_mode
 
     INTEGER, INTENT(INOUT) ::  pmc_status
@@ -412,5 +426,5 @@
 
 
-    NAMELIST /nestpar/  domain_layouts, nesting_mode
+    NAMELIST /nestpar/  domain_layouts, nesting_datatransfer_mode, nesting_mode
 
 !
