Index: /palm/trunk/SOURCE/pmc_particle_interface.f90
===================================================================
--- /palm/trunk/SOURCE/pmc_particle_interface.f90	(revision 2883)
+++ /palm/trunk/SOURCE/pmc_particle_interface.f90	(revision 2884)
@@ -26,4 +26,7 @@
 ! -----------------! 
 ! $Id$
+! B: corrected KIND of variable "parsize" for some MPI calls
+! 
+! 2841 2018-02-27 15:02:57Z knoop
 ! Bugfix: wrong placement of include 'mpif.h' corrected
 ! 
@@ -233,5 +236,6 @@
     INTEGER(iwp) ::  nr_childs !< Number of child models of the current model
     
-    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize !<
+    INTEGER ::  parsize !<
+    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize_mpi_address_kind !<
     INTEGER(KIND=MPI_ADDRESS_KIND) ::  winsize !<
     TYPE(C_PTR), SAVE ::  ptr !<
@@ -245,10 +249,11 @@
     IF ( cpl_id > 1 )  THEN 
 
-       parsize = STORAGE_SIZE(zero_particle)/8
-
-       CALL MPI_ALLOC_MEM( parsize , MPI_INFO_NULL, ptr, ierr )
+       parsize_mpi_address_kind = STORAGE_SIZE(zero_particle)/8
+
+       CALL MPI_ALLOC_MEM( parsize_mpi_address_kind , MPI_INFO_NULL, ptr, ierr )
+       parsize = parsize_mpi_address_kind
        buf_shape(1) = 1
        CALL C_F_POINTER( ptr, win_buffer, buf_shape )
-       CALL MPI_WIN_CREATE( win_buffer, parsize, parsize,     &
+       CALL MPI_WIN_CREATE( win_buffer, parsize_mpi_address_kind, parsize,     &
                             MPI_INFO_NULL, me%intra_comm, particle_win_child,  &
                             ierr )
@@ -261,5 +266,5 @@
        jcn = coarse_bound(4)
 
-!        ALLOCATE( coarse_particles(jcs:jcn, icl:icr) )
+       ALLOCATE( coarse_particles(jcs:jcn, icl:icr) )
 
        coarse_particles(:,:)%nr_particle = 0
@@ -274,12 +279,13 @@
        DO  m = 1, nr_childs
           child_id = get_childid(m)
-          parsize = STORAGE_SIZE(zero_particle)/8
-
-          winsize = max_nr_particle_in_rma_win * parsize
+          parsize_mpi_address_kind = STORAGE_SIZE(zero_particle)/8
+          parsize = parsize_mpi_address_kind
+
+          winsize = max_nr_particle_in_rma_win * parsize_mpi_address_kind
           CALL MPI_ALLOC_MEM( winsize , MPI_INFO_NULL, buf_ptr(m), ierr )
           buf_shape(1) = max_nr_particle_in_rma_win
           CALL C_F_POINTER( buf_ptr(m), win_buffer, buf_shape )
-          CALL MPI_WIN_CREATE( win_buffer, winsize, parsize, &
-                               MPI_INFO_NULL, children(child_id)%intra_comm,   &
+          CALL MPI_WIN_CREATE( win_buffer, winsize, parsize, MPI_INFO_NULL,    &
+                               children(child_id)%intra_comm,                  &
                                particle_win_parent(m), ierr )
           ENDDO
@@ -306,5 +312,6 @@
     INTEGER(iwp) ::  nr   !< number of particles to receive from a parent box 
     
-    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize !<
+    INTEGER ::  parsize !<
+    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize_mpi_address_kind !<
     INTEGER(KIND=MPI_ADDRESS_KIND) ::  target_disp !<
     
@@ -337,11 +344,12 @@
 
                  CALL check_and_alloc_coarse_particle (i, j, nr)
-                 parsize = STORAGE_SIZE(zero_particle)/8
+                 parsize_mpi_address_kind = STORAGE_SIZE(zero_particle)/8
+                 parsize = parsize_mpi_address_kind
                  target_disp = part_adrc(j,i) - 1
-                 CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0, particle_win_child, ierr )
+                 CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0,               &
+                                    particle_win_child, ierr )
                  CALL MPI_GET( coarse_particles(j,i)%parent_particles,         &
-                               nr * parsize, MPI_BYTE, ip - 1,    &
-                               target_disp, nr * parsize,         &
-                               MPI_BYTE, particle_win_child, ierr )
+                               nr * parsize, MPI_BYTE, ip - 1, target_disp,    &
+                               nr * parsize, MPI_BYTE, particle_win_child, ierr )
                  CALL MPI_WIN_UNLOCK( ip - 1, particle_win_child, ierr )
              ENDIF
@@ -379,5 +387,6 @@
     INTEGER(iwp) ::  pe_offset              !< offset index of the current PE
     
-    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize !<
+    INTEGER ::  parsize !<
+    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize_mpi_address_kind !<
     INTEGER(KIND=MPI_ADDRESS_KIND) ::  target_disp !<
     
@@ -429,5 +438,6 @@
        max_nr_particle_per_pe = max_nr_particle_in_rma_win / ( n * n )
        disp_offset            = pe_offset * max_nr_particle_per_pe
-       parsize = STORAGE_SIZE(zero_particle)/8
+       parsize_mpi_address_kind = STORAGE_SIZE(zero_particle)/8
+       parsize = parsize_mpi_address_kind
        DO  ip = 1, me%inter_npes
 
@@ -447,9 +457,9 @@
                    CALL message( 'pmci_create_child_arrays', 'PA0480', 3, 2, 0, 6, 0 )   ! PA number has to be adjusted
                 ENDIF
-                CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0, particle_win_child, ierr )
+                CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0,                &
+                                   particle_win_child, ierr )
                 CALL MPI_PUT( coarse_particles(j,i)%parent_particles,          &
-                              nr * parsize, MPI_BYTE, ip - 1,     &
-                              target_disp, nr * parsize ,         &
-                              MPI_BYTE, particle_win_child, ierr )
+                              nr * parsize, MPI_BYTE, ip - 1, target_disp,     &
+                              nr * parsize, MPI_BYTE,  particle_win_child, ierr )
                 CALL MPI_WIN_UNLOCK( ip - 1, particle_win_child, ierr )
                 part_adrc(j,i) = target_disp + 1
