Ignore:
Timestamp:
Feb 14, 2018 5:34:13 PM (3 years ago)
Author:
thiele
Message:

Bugfixes gfortran C_SIZEOF(zero_particle)

File:
1 edited

Legend:

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

    r2807 r2808  
    2626! -----------------
    2727!
    28 ! Bugfixes gfortran c_sizeof
     28! Bugfixes gfortran C_SIZEOF(zero_particle)
     29!
     30!
    2931!
    3032!
     
    312314    INTEGER(iwp) ::  nr   !< number of particles to receive from a parent box
    313315   
     316    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize !<
    314317    INTEGER(KIND=MPI_ADDRESS_KIND) ::  target_disp !<
    315318   
    316319    TYPE(pedef), POINTER ::  ape !< TO_DO Klaus: give a description and better name of the variable
    317    
    318     TYPE(particle_type) ::  dummy_part !<
    319320
    320321    IF ( cpl_id > 1 )  THEN
     
    344345
    345346                 CALL check_and_alloc_coarse_particle (i, j, nr)
    346 
     347#if defined( __gfortran )
     348!
     349!--       For the gfortran compiler the function c_sizeof produces strange erros
     350!--       which can probably be attributed to an error in the gfortran compiler.
     351!--       Therefore the particle size in bytes is set manually. Attention: A
     352!--       change of the size of the particle type requires an adjustment of
     353!--       this value
     354          parsize = 184
     355#else
     356          parsize = C_SIZEOF (zero_particle)
     357#endif
    347358                 target_disp = part_adrc(j,i) - 1
    348359                 CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0, particle_win_child, ierr )
    349360                 CALL MPI_GET( coarse_particles(j,i)%parent_particles,         &
    350                                nr * C_SIZEOF(dummy_part), MPI_BYTE, ip - 1,    &
    351                                target_disp, nr * C_SIZEOF(dummy_part),         &
     361                               nr * parsize, MPI_BYTE, ip - 1,    &
     362                               target_disp, nr * parsize,         &
    352363                               MPI_BYTE, particle_win_child, ierr )
    353364                 CALL MPI_WIN_UNLOCK( ip - 1, particle_win_child, ierr )
     
    386397    INTEGER(iwp) ::  pe_offset              !< offset index of the current PE
    387398   
     399    INTEGER(KIND=MPI_ADDRESS_KIND) ::  parsize !<
    388400    INTEGER(KIND=MPI_ADDRESS_KIND) ::  target_disp !<
    389401   
     
    435447       max_nr_particle_per_pe = max_nr_particle_in_rma_win / ( n * n )
    436448       disp_offset            = pe_offset * max_nr_particle_per_pe
    437 
     449#if defined( __gfortran )
     450!
     451!--       For the gfortran compiler the function c_sizeof produces strange erros
     452!--       which can probably be attributed to an error in the gfortran compiler.
     453!--       Therefore the particle size in bytes is set manually. Attention: A
     454!--       change of the size of the particle type requires an adjustment of
     455!--       this value
     456          parsize = 184
     457#else
     458          parsize = C_SIZEOF (zero_particle)
     459#endif
    438460       DO  ip = 1, me%inter_npes
    439461
     
    455477                CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0, particle_win_child, ierr )
    456478                CALL MPI_PUT( coarse_particles(j,i)%parent_particles,          &
    457                               nr * C_SIZEOF(zero_particle), MPI_BYTE, ip - 1,     &
    458                               target_disp, nr * C_SIZEOF(zero_particle) ,         &
     479                              nr * parsize, MPI_BYTE, ip - 1,     &
     480                              target_disp, nr * parsize ,         &
    459481                              MPI_BYTE, particle_win_child, ierr )
    460482                CALL MPI_WIN_UNLOCK( ip - 1, particle_win_child, ierr )
Note: See TracChangeset for help on using the changeset viewer.