Changeset 2807 for palm


Ignore:
Timestamp:
Feb 14, 2018 5:24:14 PM (7 years ago)
Author:
thiele
Message:

Bugfixes gfortran c_sizeof

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/pmc_particle_interface.f90

    r2801 r2807  
    2626! -----------------
    2727!
     28! Bugfixes gfortran c_sizeof
     29!
     30!
    2831! Initial Version (by Klaus Ketelsen)
    2932!
     
    219222    INTEGER(iwp) ::  nr_childs !< Number of child models of the current model
    220223   
     224    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize !<
    221225    INTEGER(KIND=MPI_ADDRESS_KIND) ::  winsize !<
    222    
    223226    TYPE(C_PTR), SAVE ::  ptr !<
    224227   
     
    230233!-- If the model has a parent model prepare the structures for transfer
    231234    IF ( cpl_id > 1 )  THEN
    232        winsize = C_SIZEOF (zero_particle)
    233        CALL MPI_ALLOC_MEM( winsize , MPI_INFO_NULL, ptr, ierr )
     235#if defined( __gfortran )
     236!
     237!--    For the gfortran compiler the function c_sizeof produces strange erros
     238!--    which can probably be attributed to an error in the gfortran compiler.
     239!--    Therefore the particle size in bytes is set manually. Attention: A
     240!--    change of the size of the particle type requires an adjustment of
     241!--    this value
     242       parsize = 184
     243#else
     244       parsize = C_SIZEOF (zero_particle)
     245#endif
     246       CALL MPI_ALLOC_MEM( parsize , MPI_INFO_NULL, ptr, ierr )
    234247       buf_shape(1) = 1
    235248       CALL C_F_POINTER( ptr, win_buffer, buf_shape )
    236        CALL MPI_WIN_CREATE( win_buffer, winsize, C_SIZEOF (zero_particle),     &
     249       CALL MPI_WIN_CREATE( win_buffer, parsize, parsize,     &
    237250                            MPI_INFO_NULL, me%intra_comm, particle_win_child,  &
    238251                            ierr )
     
    258271       DO  m = 1, nr_childs
    259272          child_id = get_childid(m)
    260 
    261           winsize = max_nr_particle_in_rma_win * C_SIZEOF( zero_particle )
     273#if defined( __gfortran )
     274!
     275!--       For the gfortran compiler the function c_sizeof produces strange erros
     276!--       which can probably be attributed to an error in the gfortran compiler.
     277!--       Therefore the particle size in bytes is set manually. Attention: A
     278!--       change of the size of the particle type requires an adjustment of
     279!--       this value
     280          parsize = 184
     281#else
     282          parsize = C_SIZEOF (zero_particle)
     283#endif
     284          winsize = max_nr_particle_in_rma_win * parsize
    262285          CALL MPI_ALLOC_MEM( winsize , MPI_INFO_NULL, buf_ptr(m), ierr )
    263286          buf_shape(1) = max_nr_particle_in_rma_win
    264287          CALL C_F_POINTER( buf_ptr(m), win_buffer, buf_shape )
    265           CALL MPI_WIN_CREATE( win_buffer, winsize, C_SIZEOF( zero_particle ), &
     288          CALL MPI_WIN_CREATE( win_buffer, winsize, parsize, &
    266289                               MPI_INFO_NULL, children(child_id)%intra_comm,   &
    267290                               particle_win_parent(m), ierr )
Note: See TracChangeset for help on using the changeset viewer.