Index: palm/trunk/SOURCE/pmc_mpi_wrapper_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_mpi_wrapper_mod.f90	(revision 1901)
+++ palm/trunk/SOURCE/pmc_mpi_wrapper_mod.f90	(revision 1933)
@@ -1,5 +1,5 @@
  MODULE pmc_mpi_wrapper
 
-!--------------------------------------------------------------------------------!
+!-------------------------------------------------------------------------------!
 ! This file is part of PALM.
 !
@@ -16,14 +16,17 @@
 !
 ! Copyright 1997-2016 Leibniz Universitaet Hannover
-!--------------------------------------------------------------------------------!
+!-------------------------------------------------------------------------------!
 !
 ! Current revisions:
 ! ------------------
 ! 
-!
+! 
 ! Former revisions:
 ! -----------------
 ! $Id$
 !
+! 1901 2016-05-04 15:39:38Z raasch
+! Code clean up. The words server/client changed to parent/child. 
+!
 ! 1900 2016-05-04 15:27:53Z raasch
 ! re-formatted to match PALM style
@@ -50,5 +53,5 @@
 !
 ! MPI Wrapper of Palm Model Coupler
-!------------------------------------------------------------------------------!
+!-------------------------------------------------------------------------------!
 
 #if defined( __parallel )
@@ -62,6 +65,6 @@
 
     USE kinds
-    USE pmc_handle_communicator,                                               &
-        ONLY: m_model_comm, m_model_rank, m_to_server_comm, m_to_client_comm
+    USE pmc_handle_communicator,                                                &
+        ONLY: m_model_comm, m_model_rank, m_to_parent_comm, m_to_child_comm
 
     IMPLICIT NONE
@@ -70,33 +73,33 @@
     SAVE
 
-    INTERFACE pmc_send_to_server
-       MODULE PROCEDURE pmc_send_to_server_integer
-       MODULE PROCEDURE pmc_send_to_server_integer_2
-       MODULE PROCEDURE pmc_send_to_server_real_r1
-       MODULE PROCEDURE pmc_send_to_server_real_r2
-       MODULE PROCEDURE pmc_send_to_server_real_r3
-    END INTERFACE pmc_send_to_server
-
-    INTERFACE pmc_recv_from_server
-       MODULE PROCEDURE pmc_recv_from_server_integer
-       MODULE PROCEDURE pmc_recv_from_server_real_r1
-       MODULE PROCEDURE pmc_recv_from_server_real_r2
-       MODULE PROCEDURE pmc_recv_from_server_real_r3
-    END INTERFACE pmc_recv_from_server
-
-    INTERFACE pmc_send_to_client
-       MODULE PROCEDURE pmc_send_to_client_integer
-       MODULE PROCEDURE pmc_send_to_client_real_r1
-       MODULE PROCEDURE pmc_send_to_client_real_r2
-       MODULE PROCEDURE pmc_send_to_client_real_r3
-    END INTERFACE pmc_send_to_client
-
-    INTERFACE pmc_recv_from_client
-       MODULE PROCEDURE pmc_recv_from_client_integer
-       MODULE PROCEDURE pmc_recv_from_client_integer_2
-       MODULE PROCEDURE pmc_recv_from_client_real_r1
-       MODULE PROCEDURE pmc_recv_from_client_real_r2
-       MODULE PROCEDURE pmc_recv_from_client_real_r3
-    END INTERFACE pmc_recv_from_client
+    INTERFACE pmc_send_to_parent
+       MODULE PROCEDURE pmc_send_to_parent_integer
+       MODULE PROCEDURE pmc_send_to_parent_integer_2
+       MODULE PROCEDURE pmc_send_to_parent_real_r1
+       MODULE PROCEDURE pmc_send_to_parent_real_r2
+       MODULE PROCEDURE pmc_send_to_parent_real_r3
+    END INTERFACE pmc_send_to_parent
+
+    INTERFACE pmc_recv_from_parent
+       MODULE PROCEDURE pmc_recv_from_parent_integer
+       MODULE PROCEDURE pmc_recv_from_parent_real_r1
+       MODULE PROCEDURE pmc_recv_from_parent_real_r2
+       MODULE PROCEDURE pmc_recv_from_parent_real_r3
+    END INTERFACE pmc_recv_from_parent
+
+    INTERFACE pmc_send_to_child
+       MODULE PROCEDURE pmc_send_to_child_integer
+       MODULE PROCEDURE pmc_send_to_child_real_r1
+       MODULE PROCEDURE pmc_send_to_child_real_r2
+       MODULE PROCEDURE pmc_send_to_child_real_r3
+    END INTERFACE pmc_send_to_child
+
+    INTERFACE pmc_recv_from_child
+       MODULE PROCEDURE pmc_recv_from_child_integer
+       MODULE PROCEDURE pmc_recv_from_child_integer_2
+       MODULE PROCEDURE pmc_recv_from_child_real_r1
+       MODULE PROCEDURE pmc_recv_from_child_real_r2
+       MODULE PROCEDURE pmc_recv_from_child_real_r3
+    END INTERFACE pmc_recv_from_child
 
     INTERFACE pmc_bcast
@@ -118,6 +121,6 @@
     END INTERFACE pmc_time
 
-    PUBLIC pmc_alloc_mem, pmc_bcast, pmc_inter_bcast, pmc_recv_from_client,    &
-           pmc_recv_from_server, pmc_send_to_client, pmc_send_to_server,       &
+    PUBLIC pmc_alloc_mem, pmc_bcast, pmc_inter_bcast, pmc_recv_from_child,      &
+           pmc_recv_from_parent, pmc_send_to_child, pmc_send_to_parent,         &
            pmc_time
 
@@ -125,5 +128,5 @@
 
 
- SUBROUTINE pmc_send_to_server_integer( buf, n, server_rank, tag, ierr )
+ SUBROUTINE pmc_send_to_parent_integer( buf, n, parent_rank, tag, ierr )
 
     IMPLICIT NONE
@@ -131,17 +134,17 @@
     INTEGER, DIMENSION(:), INTENT(IN) ::  buf          !<
     INTEGER, INTENT(IN)               ::  n            !<
-    INTEGER, INTENT(IN)               ::  server_rank  !<
+    INTEGER, INTENT(IN)               ::  parent_rank  !<
     INTEGER, INTENT(IN)               ::  tag          !<
     INTEGER, INTENT(OUT)              ::  ierr         !<
 
     ierr = 0
-    CALL MPI_SEND( buf, n, MPI_INTEGER, server_rank, tag, m_to_server_comm,    &
+    CALL MPI_SEND( buf, n, MPI_INTEGER, parent_rank, tag, m_to_parent_comm,     &
                    ierr)
 
- END SUBROUTINE pmc_send_to_server_integer
-
-
-
- SUBROUTINE pmc_recv_from_server_integer( buf, n, server_rank, tag, ierr )
+ END SUBROUTINE pmc_send_to_parent_integer
+
+
+
+ SUBROUTINE pmc_recv_from_parent_integer( buf, n, parent_rank, tag, ierr )
 
     IMPLICIT NONE
@@ -149,17 +152,17 @@
     INTEGER, DIMENSION(:), INTENT(OUT) ::  buf          !<
     INTEGER, INTENT(IN)                ::  n            !<
-    INTEGER, INTENT(IN)                ::  server_rank  !<
+    INTEGER, INTENT(IN)                ::  parent_rank  !<
     INTEGER, INTENT(IN)                ::  tag          !<
     INTEGER, INTENT(OUT)               ::  ierr         !<
 
     ierr = 0
-    CALL MPI_RECV( buf, n, MPI_INTEGER, server_rank, tag, m_to_server_comm,    &
+    CALL MPI_RECV( buf, n, MPI_INTEGER, parent_rank, tag, m_to_parent_comm,     &
                    MPI_STATUS_IGNORE, ierr )
 
- END SUBROUTINE pmc_recv_from_server_integer
-
-
-
- SUBROUTINE pmc_send_to_server_integer_2( buf, n, server_rank, tag, ierr )
+ END SUBROUTINE pmc_recv_from_parent_integer
+
+
+
+ SUBROUTINE pmc_send_to_parent_integer_2( buf, n, parent_rank, tag, ierr )
 
     IMPLICIT NONE
@@ -167,17 +170,17 @@
     INTEGER, DIMENSION(:,:), INTENT(IN) :: buf          !<
     INTEGER, INTENT(IN)                 :: n            !<
-    INTEGER, INTENT(IN)                 :: server_rank  !<
+    INTEGER, INTENT(IN)                 :: parent_rank  !<
     INTEGER, INTENT(IN)                 :: tag          !<
     INTEGER, INTENT(OUT)                :: ierr         !<
 
     ierr = 0
-    CALL MPI_SEND( buf, n, MPI_INTEGER, server_rank, tag, m_to_server_comm,    &
+    CALL MPI_SEND( buf, n, MPI_INTEGER, parent_rank, tag, m_to_parent_comm,     &
                    ierr )
 
- END SUBROUTINE pmc_send_to_server_integer_2
-
-
-
- SUBROUTINE pmc_send_to_server_real_r1( buf, n, server_rank, tag, ierr )
+ END SUBROUTINE pmc_send_to_parent_integer_2
+
+
+
+ SUBROUTINE pmc_send_to_parent_real_r1( buf, n, parent_rank, tag, ierr )
 
     IMPLICIT NONE
@@ -185,16 +188,16 @@
     REAL(wp), DIMENSION(:), INTENT(IN) ::  buf          !<
     INTEGER, INTENT(IN)                ::  n            !<
-    INTEGER, INTENT(IN)                ::  server_rank  !<
+    INTEGER, INTENT(IN)                ::  parent_rank  !<
     INTEGER, INTENT(IN)                ::  tag          !<
     INTEGER, INTENT(OUT)               ::  ierr         !<
 
     ierr = 0
-    CALL MPI_SEND( buf, n, MPI_REAL, server_rank, tag, m_to_server_comm, ierr )
-
- END SUBROUTINE pmc_send_to_server_real_r1
-
-
-
- SUBROUTINE pmc_recv_from_server_real_r1( buf, n, server_rank, tag, ierr )
+    CALL MPI_SEND( buf, n, MPI_REAL, parent_rank, tag, m_to_parent_comm, ierr )
+
+ END SUBROUTINE pmc_send_to_parent_real_r1
+
+
+
+ SUBROUTINE pmc_recv_from_parent_real_r1( buf, n, parent_rank, tag, ierr )
 
     IMPLICIT NONE
@@ -202,17 +205,17 @@
     REAL(wp), DIMENSION(:), INTENT(OUT) ::  buf          !<
     INTEGER, INTENT(IN)                 ::  n            !<
-    INTEGER, INTENT(IN)                 ::  server_rank  !<
+    INTEGER, INTENT(IN)                 ::  parent_rank  !<
     INTEGER, INTENT(IN)                 ::  tag          !<
     INTEGER, INTENT(OUT)                ::  ierr         !<
 
     ierr = 0
-    CALL MPI_RECV( buf, n, MPI_REAL, server_rank, tag, m_to_server_comm,       &
+    CALL MPI_RECV( buf, n, MPI_REAL, parent_rank, tag, m_to_parent_comm,        &
                    MPI_STATUS_IGNORE, ierr )
 
- END SUBROUTINE pmc_recv_from_server_real_r1
-
-
-
- SUBROUTINE pmc_send_to_server_real_r2( buf, n, server_rank, tag, ierr )
+ END SUBROUTINE pmc_recv_from_parent_real_r1
+
+
+
+ SUBROUTINE pmc_send_to_parent_real_r2( buf, n, parent_rank, tag, ierr )
 
     IMPLICIT NONE
@@ -220,15 +223,15 @@
     REAL(wp), DIMENSION(:,:), INTENT(IN) ::  buf          !<
     INTEGER, INTENT(IN)                  ::  n            !<
-    INTEGER, INTENT(IN)                  ::  server_rank  !<
+    INTEGER, INTENT(IN)                  ::  parent_rank  !<
     INTEGER, INTENT(IN)                  ::  tag          !<
     INTEGER, INTENT(OUT)                 ::  ierr         !<
 
     ierr = 0
-    CALL MPI_SEND( buf, n, MPI_REAL, server_rank, tag, m_to_server_comm, ierr )
-
- END SUBROUTINE pmc_send_to_server_real_r2
-
-
- SUBROUTINE pmc_recv_from_server_real_r2( buf, n, server_rank, tag, ierr )
+    CALL MPI_SEND( buf, n, MPI_REAL, parent_rank, tag, m_to_parent_comm, ierr )
+
+ END SUBROUTINE pmc_send_to_parent_real_r2
+
+
+ SUBROUTINE pmc_recv_from_parent_real_r2( buf, n, parent_rank, tag, ierr )
 
     IMPLICIT NONE
@@ -236,17 +239,17 @@
     REAL(wp), DIMENSION(:,:), INTENT(OUT) ::  buf          !<
     INTEGER, INTENT(IN)                   ::  n            !<
-    INTEGER, INTENT(IN)                   ::  server_rank  !<
+    INTEGER, INTENT(IN)                   ::  parent_rank  !<
     INTEGER, INTENT(IN)                   ::  tag          !<
     INTEGER, INTENT(OUT)                  ::  ierr         !<
 
     ierr = 0
-    CALL MPI_RECV( buf, n, MPI_REAL, server_rank, tag, m_to_server_comm,       &
+    CALL MPI_RECV( buf, n, MPI_REAL, parent_rank, tag, m_to_parent_comm,        &
                    MPI_STATUS_IGNORE, ierr )
 
- END SUBROUTINE pmc_recv_from_server_real_r2
-
-
-
- SUBROUTINE pmc_send_to_server_real_r3( buf, n, server_rank, tag, ierr )
+ END SUBROUTINE pmc_recv_from_parent_real_r2
+
+
+
+ SUBROUTINE pmc_send_to_parent_real_r3( buf, n, parent_rank, tag, ierr )
 
     IMPLICIT NONE
@@ -254,16 +257,16 @@
     REAL(wp), DIMENSION(:,:,:), INTENT(IN) ::  buf          !<
     INTEGER, INTENT(IN)                    ::  n            !<
-    INTEGER, INTENT(IN)                    ::  server_rank  !<
+    INTEGER, INTENT(IN)                    ::  parent_rank  !<
     INTEGER, INTENT(IN)                    ::  tag          !<
     INTEGER, INTENT(OUT)                   ::  ierr         !<
 
     ierr = 0
-    CALL MPI_SEND( buf, n, MPI_REAL, server_rank, tag, m_to_server_comm, ierr )
-
- END SUBROUTINE pmc_send_to_server_real_r3
-
-
-
- SUBROUTINE pmc_recv_from_server_real_r3( buf, n, server_rank, tag, ierr )
+    CALL MPI_SEND( buf, n, MPI_REAL, parent_rank, tag, m_to_parent_comm, ierr )
+
+ END SUBROUTINE pmc_send_to_parent_real_r3
+
+
+
+ SUBROUTINE pmc_recv_from_parent_real_r3( buf, n, parent_rank, tag, ierr )
 
     IMPLICIT NONE
@@ -271,193 +274,193 @@
     REAL(wp), DIMENSION(:,:,:), INTENT(OUT) ::  buf          !<
     INTEGER, INTENT(IN)                     ::  n            !<
-    INTEGER, INTENT(IN)                     ::  server_rank  !<
+    INTEGER, INTENT(IN)                     ::  parent_rank  !<
     INTEGER, INTENT(IN)                     ::  tag          !<
     INTEGER, INTENT(OUT)                    ::  ierr         !<
 
     ierr = 0
-    CALL MPI_RECV( buf, n, MPI_REAL, server_rank, tag, m_to_server_comm,       &
+    CALL MPI_RECV( buf, n, MPI_REAL, parent_rank, tag, m_to_parent_comm,        &
                    MPI_STATUS_IGNORE, ierr )
 
- END SUBROUTINE pmc_recv_from_server_real_r3
-
-
-
- SUBROUTINE pmc_send_to_client_integer( client_id, buf, n, client_rank, tag,   &
-                                        ierr )
-
-    IMPLICIT NONE
-
-    INTEGER, INTENT(IN)               ::  client_id    !<
+ END SUBROUTINE pmc_recv_from_parent_real_r3
+
+
+
+ SUBROUTINE pmc_send_to_child_integer( child_id, buf, n, child_rank, tag,       &
+                                       ierr )
+
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN)               ::  child_id     !<
     INTEGER, DIMENSION(:), INTENT(IN) ::  buf          !<
     INTEGER, INTENT(IN)               ::  n            !<
-    INTEGER, INTENT(IN)               ::  client_rank  !<
+    INTEGER, INTENT(IN)               ::  child_rank   !<
     INTEGER, INTENT(IN)               ::  tag          !<
     INTEGER, INTENT(OUT)              ::  ierr         !<
 
     ierr = 0
-    CALL MPI_SEND( buf, n, MPI_INTEGER, client_rank, tag,                      &
-                   m_to_client_comm(client_id), ierr )
-
- END SUBROUTINE pmc_send_to_client_integer
-
-
-
- SUBROUTINE pmc_recv_from_client_integer( client_id, buf, n, client_rank, tag, &
-                                          ierr )
-
-    IMPLICIT NONE
-
-    INTEGER, INTENT(IN)                  ::  client_id    !<
+    CALL MPI_SEND( buf, n, MPI_INTEGER, child_rank, tag,                        &
+                   m_to_child_comm(child_id), ierr )
+
+ END SUBROUTINE pmc_send_to_child_integer
+
+
+
+ SUBROUTINE pmc_recv_from_child_integer( child_id, buf, n, child_rank, tag,     &
+                                         ierr )
+
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN)                  ::  child_id     !<
     INTEGER, DIMENSION(:), INTENT(INOUT) ::  buf          !<
     INTEGER, INTENT(IN)                  ::  n            !<
-    INTEGER, INTENT(IN)                  ::  client_rank  !<
+    INTEGER, INTENT(IN)                  ::  child_rank   !<
     INTEGER, INTENT(IN)                  ::  tag          !<
     INTEGER, INTENT(OUT)                 ::  ierr         !<
 
     ierr = 0
-    CALL MPI_RECV( buf, n, MPI_INTEGER, client_rank, tag,                      &
-                   m_to_client_comm(client_id), MPI_STATUS_IGNORE, ierr )
-
- END SUBROUTINE pmc_recv_from_client_integer
-
-
-
- SUBROUTINE pmc_recv_from_client_integer_2( client_id, buf, n, client_rank,    &
-                                            tag, ierr )
-
-    IMPLICIT NONE
-
-    INTEGER, INTENT(IN)                  ::  client_id    !<
+    CALL MPI_RECV( buf, n, MPI_INTEGER, child_rank, tag,                        &
+                   m_to_child_comm(child_id), MPI_STATUS_IGNORE, ierr )
+
+ END SUBROUTINE pmc_recv_from_child_integer
+
+
+
+ SUBROUTINE pmc_recv_from_child_integer_2( child_id, buf, n, child_rank,        &
+                                           tag, ierr )
+
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN)                  ::  child_id     !<
     INTEGER, DIMENSION(:,:), INTENT(OUT) ::  buf          !<
     INTEGER, INTENT(IN)                  ::  n            !<
-    INTEGER, INTENT(IN)                  ::  client_rank  !<
+    INTEGER, INTENT(IN)                  ::  child_rank   !<
     INTEGER, INTENT(IN)                  ::  tag          !<
     INTEGER, INTENT(OUT)                 ::  ierr         !<
 
     ierr = 0
-    CALL MPI_RECV( buf, n, MPI_INTEGER, client_rank, tag,                      &
-                   m_to_client_comm(client_id), MPI_STATUS_IGNORE, ierr )
-
- END SUBROUTINE pmc_recv_from_client_integer_2
-
-
-
- SUBROUTINE pmc_send_to_client_real_r1( client_id, buf, n, client_rank, tag,   &
-                                        ierr )
-
-    IMPLICIT NONE
-
-    INTEGER, INTENT(IN)                ::  client_id    !<
+    CALL MPI_RECV( buf, n, MPI_INTEGER, child_rank, tag,                        &
+                   m_to_child_comm(child_id), MPI_STATUS_IGNORE, ierr )
+
+ END SUBROUTINE pmc_recv_from_child_integer_2
+
+
+
+ SUBROUTINE pmc_send_to_child_real_r1( child_id, buf, n, child_rank, tag,       &
+                                       ierr )
+
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN)                ::  child_id     !<
     REAL(wp), DIMENSION(:), INTENT(IN) ::  buf          !<
     INTEGER, INTENT(IN)                ::  n            !<
-    INTEGER, INTENT(IN)                ::  client_rank  !<
+    INTEGER, INTENT(IN)                ::  child_rank   !<
     INTEGER, INTENT(IN)                ::  tag          !<
     INTEGER, INTENT(OUT)               ::  ierr         !<
 
     ierr = 0
-    CALL MPI_SEND( buf, n, MPI_REAL, client_rank, tag,                         &
-                   m_to_client_comm(client_id), ierr )
-
- END SUBROUTINE pmc_send_to_client_real_r1
-
-
-
- SUBROUTINE pmc_recv_from_client_real_r1( client_id, buf, n, client_rank, tag, &
-                                          ierr )
-
-    IMPLICIT NONE
-
-    INTEGER, INTENT(IN)                   ::  client_id    !<
+    CALL MPI_SEND( buf, n, MPI_REAL, child_rank, tag,                           &
+                   m_to_child_comm(child_id), ierr )
+
+ END SUBROUTINE pmc_send_to_child_real_r1
+
+
+
+ SUBROUTINE pmc_recv_from_child_real_r1( child_id, buf, n, child_rank, tag,     &
+                                         ierr )
+
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN)                   ::  child_id     !<
     REAL(wp), DIMENSION(:), INTENT(INOUT) ::  buf          !<
     INTEGER, INTENT(IN)                   ::  n            !<
-    INTEGER, INTENT(IN)                   ::  client_rank  !<
+    INTEGER, INTENT(IN)                   ::  child_rank   !<
     INTEGER, INTENT(IN)                   ::  tag          !<
     INTEGER, INTENT(OUT)                  ::  ierr         !<
 
     ierr = 0
-    CALL MPI_RECV( buf, n, MPI_REAL, client_rank, tag,                         &
-                   m_to_client_comm(client_id), MPI_STATUS_IGNORE, ierr )
-
- END SUBROUTINE pmc_recv_from_client_real_r1
-
-
-
- SUBROUTINE pmc_send_to_client_real_r2( client_id, buf, n, client_rank, tag,   &
-                                        ierr )
-
-    IMPLICIT NONE
-
-    INTEGER, INTENT(IN)                  ::  client_id    !<
+    CALL MPI_RECV( buf, n, MPI_REAL, child_rank, tag,                           &
+                   m_to_child_comm(child_id), MPI_STATUS_IGNORE, ierr )
+
+ END SUBROUTINE pmc_recv_from_child_real_r1
+
+
+
+ SUBROUTINE pmc_send_to_child_real_r2( child_id, buf, n, child_rank, tag,       &
+                                       ierr )
+
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN)                  ::  child_id     !<
     REAL(wp), DIMENSION(:,:), INTENT(IN) ::  buf          !<
     INTEGER, INTENT(IN)                  ::  n            !<
-    INTEGER, INTENT(IN)                  ::  client_rank  !<
+    INTEGER, INTENT(IN)                  ::  child_rank   !<
     INTEGER, INTENT(IN)                  ::  tag          !<
     INTEGER, INTENT(OUT)                 ::  ierr         !<
 
     ierr = 0
-    CALL MPI_SEND( buf, n, MPI_REAL, client_rank, tag,                         &
-                   m_to_client_comm(client_id), ierr )
-
- END SUBROUTINE pmc_send_to_client_real_r2
-
-
-
- SUBROUTINE pmc_recv_from_client_real_r2( client_id, buf, n, client_rank, tag, &
-                                          ierr )
-
-    IMPLICIT NONE
-
-    INTEGER, INTENT(IN)                   ::  client_id    !<
+    CALL MPI_SEND( buf, n, MPI_REAL, child_rank, tag,                           &
+                   m_to_child_comm(child_id), ierr )
+
+ END SUBROUTINE pmc_send_to_child_real_r2
+
+
+
+ SUBROUTINE pmc_recv_from_child_real_r2( child_id, buf, n, child_rank, tag,     &
+                                         ierr )
+
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN)                   ::  child_id     !<
     REAL(wp), DIMENSION(:,:), INTENT(OUT) ::  buf          !<
     INTEGER, INTENT(IN)                   ::  n            !<
-    INTEGER, INTENT(IN)                   ::  client_rank  !<
+    INTEGER, INTENT(IN)                   ::  child_rank   !<
     INTEGER, INTENT(IN)                   ::  tag          !<
     INTEGER, INTENT(OUT)                  ::  ierr         !<
 
     ierr = 0
-    CALL MPI_RECV( buf, n, MPI_REAL, client_rank, tag,                         &
-                   m_to_client_comm(client_id), MPI_STATUS_IGNORE, ierr )
-
- END SUBROUTINE pmc_recv_from_client_real_r2
-
-
-
- SUBROUTINE pmc_send_to_client_real_r3( client_id, buf, n, client_rank, tag,   &
-                                        ierr)
-
-    IMPLICIT NONE
-
-    INTEGER, INTENT(IN)                    ::  client_id    !<
+    CALL MPI_RECV( buf, n, MPI_REAL, child_rank, tag,                           &
+                   m_to_child_comm(child_id), MPI_STATUS_IGNORE, ierr )
+
+ END SUBROUTINE pmc_recv_from_child_real_r2
+
+
+
+ SUBROUTINE pmc_send_to_child_real_r3( child_id, buf, n, child_rank, tag,       &
+                                       ierr)
+
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN)                    ::  child_id     !<
     REAL(wp), DIMENSION(:,:,:), INTENT(IN) ::  buf          !<
     INTEGER, INTENT(IN)                    ::  n            !<
-    INTEGER, INTENT(IN)                    ::  client_rank  !<
+    INTEGER, INTENT(IN)                    ::  child_rank   !<
     INTEGER, INTENT(IN)                    ::  tag          !<
     INTEGER, INTENT(OUT)                   ::  ierr         !<
 
     ierr = 0
-    CALL MPI_SEND( buf, n, MPI_REAL, client_rank, tag,                         &
-                   m_to_client_comm(client_id), ierr )
-
- END SUBROUTINE pmc_send_to_client_real_r3
-
-
-
- SUBROUTINE pmc_recv_from_client_real_r3( client_id, buf, n, client_rank, tag, &
-                                          ierr )
-
-    IMPLICIT NONE
-
-    INTEGER, INTENT(IN)                     ::  client_id    !<
+    CALL MPI_SEND( buf, n, MPI_REAL, child_rank, tag,                           &
+                   m_to_child_comm(child_id), ierr )
+
+ END SUBROUTINE pmc_send_to_child_real_r3
+
+
+
+ SUBROUTINE pmc_recv_from_child_real_r3( child_id, buf, n, child_rank, tag,     &
+                                         ierr )
+
+    IMPLICIT NONE
+
+    INTEGER, INTENT(IN)                     ::  child_id     !<
     REAL(wp), DIMENSION(:,:,:), INTENT(OUT) ::  buf          !<
     INTEGER, INTENT(IN)                     ::  n            !<
-    INTEGER, INTENT(IN)                     ::  client_rank  !<
+    INTEGER, INTENT(IN)                     ::  child_rank   !<
     INTEGER, INTENT(IN)                     ::  tag          !<
     INTEGER, INTENT(OUT)                    ::  ierr         !<
 
     ierr = 0
-    CALL MPI_RECV( buf, n, MPI_REAL, client_rank, tag,                         &
-                   m_to_client_comm(client_id), MPI_STATUS_IGNORE, ierr )
-
- END SUBROUTINE pmc_recv_from_client_real_r3
+    CALL MPI_RECV( buf, n, MPI_REAL, child_rank, tag,                           & 
+                   m_to_child_comm(child_id), MPI_STATUS_IGNORE, ierr )
+
+ END SUBROUTINE pmc_recv_from_child_real_r3
 
 
@@ -520,10 +523,10 @@
 
 
- SUBROUTINE pmc_inter_bcast_integer_1( buf, client_id, ierr )
+ SUBROUTINE pmc_inter_bcast_integer_1( buf, child_id, ierr )
 
     IMPLICIT NONE
 
     INTEGER, INTENT(INOUT),DIMENSION(:) ::  buf        !<
-    INTEGER, INTENT(IN),optional        ::  client_id  !<
+    INTEGER, INTENT(IN),optional        ::  child_id   !<
     INTEGER, INTENT(OUT),optional       ::  ierr       !<
 
@@ -533,8 +536,8 @@
 
 !
-!-- PE 0 server broadcast to all client PEs
-    IF ( PRESENT( client_id ) )  THEN
-
-       mycomm = m_to_client_comm(client_id)
+!-- PE 0 on parent broadcast to all child PEs
+    IF ( PRESENT( child_id ) )  THEN
+
+       mycomm = m_to_child_comm(child_id)
 
        IF ( m_model_rank == 0 )  THEN
@@ -545,5 +548,5 @@
 
     ELSE
-       mycomm  = m_to_server_comm
+       mycomm  = m_to_parent_comm
        root_pe = 0
     ENDIF
