Ignore:
Timestamp:
Feb 15, 2018 9:55:58 AM (3 years ago)
Author:
schwenkel
Message:

Bugfix for gfortran: Replace the function C_SIZEOF with STORAGE_SIZE

File:
1 edited

Legend:

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

    r2808 r2809  
    2424!
    2525! Former revisions:
    26 ! -----------------
    27 !
    28 ! Bugfixes gfortran C_SIZEOF(zero_particle)
    29 !
    30 !
    31 !
    32 !
     26! -----------------!
     27! $Id$
     28! Bugfix for gfortran: Replace the function C_SIZEOF with STORAGE_SIZE.
     29
     30!
    3331! Initial Version (by Klaus Ketelsen)
    3432!
     
    235233!-- If the model has a parent model prepare the structures for transfer
    236234    IF ( cpl_id > 1 )  THEN
    237 #if defined( __gfortran )
    238 !
    239 !--    For the gfortran compiler the function c_sizeof produces strange erros
    240 !--    which can probably be attributed to an error in the gfortran compiler.
    241 !--    Therefore the particle size in bytes is set manually. Attention: A
    242 !--    change of the size of the particle type requires an adjustment of
    243 !--    this value
    244        parsize = 184
    245 #else
    246        parsize = C_SIZEOF (zero_particle)
    247 #endif
     235
     236       parsize = STORAGE_SIZE(zero_particle)/8
     237
    248238       CALL MPI_ALLOC_MEM( parsize , MPI_INFO_NULL, ptr, ierr )
    249239       buf_shape(1) = 1
     
    273263       DO  m = 1, nr_childs
    274264          child_id = get_childid(m)
    275 #if defined( __gfortran )
    276 !
    277 !--       For the gfortran compiler the function c_sizeof produces strange erros
    278 !--       which can probably be attributed to an error in the gfortran compiler.
    279 !--       Therefore the particle size in bytes is set manually. Attention: A
    280 !--       change of the size of the particle type requires an adjustment of
    281 !--       this value
    282           parsize = 184
    283 #else
    284           parsize = C_SIZEOF (zero_particle)
    285 #endif
     265          parsize = STORAGE_SIZE(zero_particle)/8
     266
    286267          winsize = max_nr_particle_in_rma_win * parsize
    287268          CALL MPI_ALLOC_MEM( winsize , MPI_INFO_NULL, buf_ptr(m), ierr )
     
    345326
    346327                 CALL check_and_alloc_coarse_particle (i, j, nr)
    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
     328                 parsize = STORAGE_SIZE(zero_particle)/8
    358329                 target_disp = part_adrc(j,i) - 1
    359330                 CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0, particle_win_child, ierr )
     
    447418       max_nr_particle_per_pe = max_nr_particle_in_rma_win / ( n * n )
    448419       disp_offset            = pe_offset * max_nr_particle_per_pe
    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
     420       parsize = STORAGE_SIZE(zero_particle)/8
    460421       DO  ip = 1, me%inter_npes
    461422
Note: See TracChangeset for help on using the changeset viewer.