Index: /palm/trunk/SCRIPTS/.mrun.config.cuhk
===================================================================
--- /palm/trunk/SCRIPTS/.mrun.config.cuhk	(revision 2329)
+++ /palm/trunk/SCRIPTS/.mrun.config.cuhk	(revision 2330)
@@ -32,5 +32,5 @@
 %compiler_name     mpif90                                        lccuhk parallel
 %compiler_name_ser gfortran                                      lccuhk parallel
-%cpp_options       -cpp:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__parallel   lccuhk parallel
+%cpp_options       -cpp:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__parallel:-D__gfortran   lccuhk parallel
 %netcdf_inc        -I:$HOME/opt/netcdf-3.6.3/include             lccuhk parallel
 %netcdf_lib        -L:$HOME/opt/netcdf-3.6.3/lib:-lnetcdf        lccuhk parallel
@@ -44,5 +44,5 @@
 %compiler_name     mpif90                                        lccuhk parallel trace
 %compiler_name_ser gfortran                                      lccuhk parallel trace
-%cpp_options       -cpp:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__parallel   lccuhk parallel trace
+%cpp_options       -cpp:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__parallel:-D__gfortran   lccuhk parallel trace
 %netcdf_inc        -I:$HOME/opt/netcdf-3.6.3/include             lccuhk parallel trace
 %netcdf_lib        -L:$HOME/opt/netcdf-3.6.3/lib:-lnetcdf        lccuhk parallel trace
Index: /palm/trunk/SCRIPTS/.mrun.config.forwind_eddy
===================================================================
--- /palm/trunk/SCRIPTS/.mrun.config.forwind_eddy	(revision 2329)
+++ /palm/trunk/SCRIPTS/.mrun.config.forwind_eddy	(revision 2330)
@@ -34,5 +34,5 @@
 %compiler_name     mpifort                                                                                                       lceddy parallel
 %compiler_name_ser gfortran                                                                                                      lceddy parallel
-%cpp_options       -DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__netcdf4:-D__parallel  lceddy parallel
+%cpp_options       -DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__netcdf4:-D__parallel:-D__gfortran  lceddy parallel
 %netcdf_inc        -I/cm/shared/uniol/software/netCDF-Fortran/4.4.4-goolf-5.2.01/include                                         lceddy parallel
 %netcdf_lib        -lnetcdff:-lnetcdf                                                                                            lceddy parallel
Index: /palm/trunk/SCRIPTS/.mrun.config.forwind_hlrnIII
===================================================================
--- /palm/trunk/SCRIPTS/.mrun.config.forwind_hlrnIII	(revision 2329)
+++ /palm/trunk/SCRIPTS/.mrun.config.forwind_hlrnIII	(revision 2330)
@@ -46,5 +46,5 @@
 %compiler_name     mpif90                                                    lcfor parallel
 %compiler_name_ser gfortran                                                  lcfor parallel
-%cpp_options       -DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__netcdf4:-D__parallel  lcfor parallel
+%cpp_options       -DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__netcdf4:-D__parallel:-D__gfortran  lcfor parallel
 %netcdf_inc        -I/usr/include                                            lcfor parallel
 %netcdf_lib        -L/usr/lib:-lnetcdff:-lnetcdf                             lcfor parallel
Index: /palm/trunk/SCRIPTS/.mrun.config.gfortran
===================================================================
--- /palm/trunk/SCRIPTS/.mrun.config.gfortran	(revision 2329)
+++ /palm/trunk/SCRIPTS/.mrun.config.gfortran	(revision 2330)
@@ -35,5 +35,5 @@
 %compiler_name     mpif90                                        <hi> parallel
 %compiler_name_ser gfortran                                      <hi> parallel
-%cpp_options       -cpp:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__parallel   <hi> parallel
+%cpp_options       -cpp:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__parallel:-D__gfortran   <hi> parallel
 %netcdf_inc        -I:<replace_by_netcdf_include_path>           <hi> parallel
 %netcdf_lib        -L:<replace_by_netcdf_library_path>:-lnetcdf  <hi> parallel
@@ -53,5 +53,5 @@
 %compiler_name     mpif90                                        <hi> parallel trace
 %compiler_name_ser gfortran                                      <hi> parallel trace
-%cpp_options       -cpp:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__parallel   <hi> parallel trace
+%cpp_options       -cpp:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:-D__lc:-D__netcdf:-D__parallel:-D__gfortran   <hi> parallel trace
 %netcdf_inc        -I:<replace_by_netcdf_include_path>           <hi> parallel trace
 %netcdf_lib        -L:<replace_by_netcdf_library_path>:-lnetcdf  <hi> parallel trace
Index: /palm/trunk/SOURCE/lpm_exchange_horiz.f90
===================================================================
--- /palm/trunk/SOURCE/lpm_exchange_horiz.f90	(revision 2329)
+++ /palm/trunk/SOURCE/lpm_exchange_horiz.f90	(revision 2330)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Bugfix: Also for gfortran compilable, function c_sizeof is not used. 
+! 
+! 2305 2017-07-06 11:18:47Z hoffmann
 ! Improved calculation of particle IDs.
 ! 
@@ -406,4 +409,20 @@
     ENDDO
 
+#if defined( __gfortran )
+!
+!--    For the gfortran compiler the function c_sizeof produces strange erros 
+!--    which can probably be attributed to an error in the gfortran compiler.
+!--    Therefore the particle size in bytes is set manually. Attention: A 
+!--    change of the size of the particle type requires an adjustment of 
+!--    this value
+       par_size = 184
+#else
+!      
+!--    This MPI_SENDRECV should work even with odd mixture on 32 and 64 Bit 
+!--    variables in structure particle_type (due to the calculation of par_size)
+       par_size = c_sizeof(trlp(1))
+#endif
+
+
 !
 !-- Allocate arrays required for north-south exchange, as these
@@ -424,8 +443,5 @@
 
        ALLOCATE(rvrp(MAX(1,trrp_count_recv)))
-!      
-!--    This MPI_SENDRECV should work even with odd mixture on 32 and 64 Bit 
-!--    variables in structure particle_type (due to the calculation of par_size)
-       par_size = c_sizeof(trlp(1))
+
        CALL MPI_SENDRECV( trlp, max(1,trlp_count)*par_size, MPI_BYTE,&
                           pleft, 1, rvrp,                            &
@@ -447,5 +463,4 @@
 !--    This MPI_SENDRECV should work even with odd mixture on 32 and 64 Bit 
 !--    variables in structure particle_type (due to the calculation of par_size)
-       par_size = c_sizeof(trrp(1))
        CALL MPI_SENDRECV( trrp, max(1,trrp_count)*par_size, MPI_BYTE,&
                           pright, 1, rvlp,                           &
@@ -655,5 +670,4 @@
 !--    This MPI_SENDRECV should work even with odd mixture on 32 and 64 Bit 
 !--    variables in structure particle_type (due to the calculation of par_size)
-       par_size = c_sizeof(trsp(1))
        CALL MPI_SENDRECV( trsp, trsp_count*par_size, MPI_BYTE,      &
                           psouth, 1, rvnp,                             &
@@ -675,5 +689,4 @@
 !--    This MPI_SENDRECV should work even with odd mixture on 32 and 64 Bit 
 !--    variables in structure particle_type (due to the calculation of par_size)
-       par_size = c_sizeof(trnp(1))
        CALL MPI_SENDRECV( trnp, trnp_count*par_size, MPI_BYTE,      &
                           pnorth, 1, rvsp,                          &
