Changeset 2809 for palm/trunk/SOURCE
- Timestamp:
- Feb 15, 2018 9:55:58 AM (7 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/lpm_exchange_horiz.f90
r2801 r2809 25 25 ! ----------------- 26 26 ! $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 27 31 ! Introduce particle transfer in nested models. 28 32 ! … … 446 450 ENDDO 447 451 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 468 457 469 458 -
palm/trunk/SOURCE/pmc_child_mod.f90
r2801 r2809 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Bugfix for gfortran: Replace the function C_SIZEOF with STORAGE_SIZE 29 ! 30 ! 2801 2018-02-14 16:01:55Z thiele 28 31 ! Introduce particle transfer in nested models. 29 32 ! … … 314 317 315 318 316 win_size = C_SIZEOF( dummy )319 win_size = STORAGE_SIZE( dummy )/8 317 320 CALL MPI_WIN_CREATE( dummy, win_size, iwp, MPI_INFO_NULL, me%intra_comm, & 318 321 indwin, ierr ) -
palm/trunk/SOURCE/pmc_interface_mod.f90
r2806 r2809 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Bugfix for gfortran: Replace the function C_SIZEOF with STORAGE_SIZE 28 ! 29 ! 2806 2018-02-14 17:10:37Z thiele 27 30 ! Bugfixing Write statements 28 31 ! … … 223 226 ! routine 224 227 ! @todo Data transfer of qc and nc is prepared but not activated 225 ! @todo determine c_sizeof(childgrid(1)) for gfortran226 228 !------------------------------------------------------------------------------! 227 229 MODULE pmc_interface … … 928 930 929 931 CALL MPI_BCAST( nz_cl, 1, MPI_INTEGER, 0, comm2d, ierr ) 930 #if defined( __gfortran ) 931 ! 932 !-- For the gfortran compiler the function c_sizeof produces strange erros 933 !-- which can probably be attributed to an error in the gfortran compiler. 934 !-- Therefore the particle size in bytes is set manually. Attention: A 935 !-- change of the size of the particle type requires an adjustment of 936 !-- this value 937 !-- TODO: determine c_sizeof(childgrid(1)) as gfortran can not handle the 938 !-- function 939 #else 940 ! 941 !-- This MPI_SENDRECV should work even with odd mixture on 32 and 64 Bit 942 !-- variables in structure particle_type (due to the calculation of par_size). 943 !-- Please note, in case of 1D decomposition ( only 1 core along 944 !-- x dimension), array trlp is not allocated, leading to program crash. 945 !-- Hence, check if array is allocated and allocate it temporarily if 946 !-- if required. 947 CALL MPI_BCAST( childgrid(m), c_sizeof(childgrid(1)), MPI_BYTE, 0, comm2d, ierr ) 948 #endif 949 932 933 CALL MPI_BCAST( childgrid(m), STORAGE_SIZE(childgrid(1))/8, MPI_BYTE, 0, comm2d, ierr ) 950 934 ! 951 935 !-- TO_DO: Klaus: please give a comment what is done here -
palm/trunk/SOURCE/pmc_mpi_wrapper_mod.f90
r2718 r2809 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Bugfix for gfortran: Replace the function C_SIZEOF with STORAGE_SIZE 29 ! 30 ! 2718 2018-01-02 08:49:38Z maronga 28 31 ! Corrected "Former revisions" section 29 32 ! … … 609 612 610 613 611 winsize = idim1 * C_SIZEOF( ierr )614 winsize = idim1 * STORAGE_SIZE( ierr )/8 612 615 613 616 CALL MPI_ALLOC_MEM( winsize, MPI_INFO_NULL, p_myind, ierr ) -
palm/trunk/SOURCE/pmc_parent_mod.f90
r2801 r2809 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Bugfix for gfortran: Replace the function C_SIZEOF with STORAGE_SIZE 29 ! 30 ! 2801 2018-02-14 16:01:55Z thiele 28 31 ! Introduce particle transfer in nested models. 29 32 ! … … 1010 1013 ! 1011 1014 !-- Number of child processes * size of INTEGER (i just arbitrary INTEGER) 1012 winsize = mychild%inter_npes* c_sizeof(i)*21015 winsize = mychild%inter_npes*STORAGE_SIZE(i)/8*2 1013 1016 1014 1017 CALL MPI_WIN_CREATE( rldef, winsize, iwp, MPI_INFO_NULL, & … … 1043 1046 1044 1047 CALL MPI_BARRIER( m_model_comm, ierr ) 1045 CALL MPI_WIN_CREATE( remindw, winsize* c_sizeof(i), iwp, MPI_INFO_NULL, &1048 CALL MPI_WIN_CREATE( remindw, winsize*STORAGE_SIZE(i)/8, iwp, MPI_INFO_NULL, & 1046 1049 mychild%intra_comm, indwin2, ierr ) 1047 1050 ! -
palm/trunk/SOURCE/pmc_particle_interface.f90
r2808 r2809 24 24 ! 25 25 ! 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 ! 33 31 ! Initial Version (by Klaus Ketelsen) 34 32 ! … … 235 233 !-- If the model has a parent model prepare the structures for transfer 236 234 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 248 238 CALL MPI_ALLOC_MEM( parsize , MPI_INFO_NULL, ptr, ierr ) 249 239 buf_shape(1) = 1 … … 273 263 DO m = 1, nr_childs 274 264 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 286 267 winsize = max_nr_particle_in_rma_win * parsize 287 268 CALL MPI_ALLOC_MEM( winsize , MPI_INFO_NULL, buf_ptr(m), ierr ) … … 345 326 346 327 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 358 329 target_disp = part_adrc(j,i) - 1 359 330 CALL MPI_WIN_LOCK( MPI_LOCK_SHARED , ip - 1, 0, particle_win_child, ierr ) … … 447 418 max_nr_particle_per_pe = max_nr_particle_in_rma_win / ( n * n ) 448 419 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 460 421 DO ip = 1, me%inter_npes 461 422 -
palm/trunk/SOURCE/radiation_model_mod.f90
r2753 r2809 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Bugfix for gfortran: Replace the function C_SIZEOF with STORAGE_SIZE 28 ! 29 ! 2753 2018-01-16 14:16:49Z suehring 27 30 ! Tile approach for spectral albedo implemented. 28 31 ! … … 5901 5904 !-- must be in accordance with allocation of lad_s in plant_canopy_model 5902 5905 !-- optimization of memory should be done 5903 !-- Argument X of function c_sizeof(X) needs arbitrary REAL(wp) value, set to 1.0_wp for now5904 size_lad_rma = c_sizeof(1.0_wp)*nnx*nny*nzu5905 CALL MPI_Win_allocate(size_lad_rma, c_sizeof(1.0_wp), minfo, comm2d, &5906 !-- Argument X of function STORAGE_SIZE(X) needs arbitrary REAL(wp) value, set to 1.0_wp for now 5907 size_lad_rma = STORAGE_SIZE(1.0_wp)/8*nnx*nny*nzu 5908 CALL MPI_Win_allocate(size_lad_rma, STORAGE_SIZE(1.0_wp)/8, minfo, comm2d, & 5906 5909 lad_s_rma_p, win_lad, ierr) 5907 5910 CALL c_f_pointer(lad_s_rma_p, lad_s_rma, (/ nzu, nny, nnx /))
Note: See TracChangeset
for help on using the changeset viewer.