Ignore:
Timestamp:
Feb 15, 2018 9:55:58 AM (4 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/lpm_exchange_horiz.f90

    r2801 r2809  
    2525! -----------------
    2626! $Id$
     27! Bugfix for gfortran: Replace the function C_SIZEOF with STORAGE_SIZE.
     28! Preprocessor directive(__gfortran) for c_sizeof removed.
     29!
     30! 2801 2018-02-14 16:01:55Z thiele
    2731! Introduce particle transfer in nested models.
    2832!
     
    446450    ENDDO
    447451
    448 #if defined( __gfortran )
    449 !
    450 !--    For the gfortran compiler the function c_sizeof produces strange erros
    451 !--    which can probably be attributed to an error in the gfortran compiler.
    452 !--    Therefore the particle size in bytes is set manually. Attention: A
    453 !--    change of the size of the particle type requires an adjustment of
    454 !--    this value
    455        par_size = 184
    456 #else
    457 !     
    458 !--    This MPI_SENDRECV should work even with odd mixture on 32 and 64 Bit
    459 !--    variables in structure particle_type (due to the calculation of par_size).
    460 !--    Please note, in case of 1D decomposition ( only 1 core along
    461 !--    x dimension), array trlp is not allocated, leading to program crash.
    462 !--    Hence, check if array is allocated and allocate it temporarily if
    463 !--    if required.
    464        IF ( .NOT. ALLOCATED( trlp ) )  ALLOCATE( trlp(1:1) )
    465 
    466        par_size = c_sizeof(trlp(1))
    467 #endif
     452!
     453!-- STORAGE_SIZE returns the storage size of argument A in bits. However , it
     454!-- is needed in bytes. The function C_SIZEOF which produces this value directly
     455!-- causes problems with gfortran. For this reason the use of C_SIZEOF is avoided
     456    par_size = STORAGE_SIZE(trlp(1))/8
    468457
    469458
Note: See TracChangeset for help on using the changeset viewer.