- Timestamp:
- Jul 6, 2017 11:18:47 AM (7 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/lpm_exchange_horiz.f90
r2245 r2305 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Improved calculation of particle IDs. 28 ! 29 ! 2245 2017-06-02 14:37:10Z schwenkel 27 30 ! Bugfix in Add_particles_to_gridcell: 28 31 ! Apply boundary conditions also in y-direction … … 106 109 MODULE lpm_exchange_horiz_mod 107 110 111 USE, INTRINSIC :: ISO_C_BINDING 108 112 109 113 USE control_parameters, & … … 130 134 ONLY: alloc_factor, deleted_particles, grid_particles, & 131 135 ibc_par_lr, ibc_par_ns, min_nr_particle, & 132 mpi_particle_type, number_of_particles,&136 number_of_particles, & 133 137 offset_ocean_nzt, offset_ocean_nzt_m1, particles, & 134 138 particle_type, prt_count, trlp_count_sum, & … … 195 199 INTEGER(iwp) :: kp !< index variable along z 196 200 INTEGER(iwp) :: n !< particle index variable 201 INTEGER(iwp) :: par_size !< Particle size in bytes 197 202 INTEGER(iwp) :: trlp_count !< number of particles send to left PE 198 203 INTEGER(iwp) :: trlp_count_recv !< number of particles receive from right PE … … 419 424 420 425 ALLOCATE(rvrp(MAX(1,trrp_count_recv))) 421 422 CALL MPI_SENDRECV( trlp(1)%radius, max(1,trlp_count), mpi_particle_type,& 423 pleft, 1, rvrp(1)%radius, & 424 max(1,trrp_count_recv), mpi_particle_type, pright, 1,& 426 ! 427 !-- This MPI_SENDRECV should work even with odd mixture on 32 and 64 Bit 428 !-- variables in structure particle_type (due to the calculation of par_size) 429 par_size = c_sizeof(trlp(1)) 430 CALL MPI_SENDRECV( trlp, max(1,trlp_count)*par_size, MPI_BYTE,& 431 pleft, 1, rvrp, & 432 max(1,trrp_count_recv)*par_size, MPI_BYTE, pright, 1,& 425 433 comm2d, status, ierr ) 426 434 … … 436 444 437 445 ALLOCATE(rvlp(MAX(1,trlp_count_recv))) 438 439 CALL MPI_SENDRECV( trrp(1)%radius, max(1,trrp_count), mpi_particle_type,& 440 pright, 1, rvlp(1)%radius, & 441 max(1,trlp_count_recv), mpi_particle_type, pleft, 1, & 446 ! 447 !-- This MPI_SENDRECV should work even with odd mixture on 32 and 64 Bit 448 !-- variables in structure particle_type (due to the calculation of par_size) 449 par_size = c_sizeof(trrp(1)) 450 CALL MPI_SENDRECV( trrp, max(1,trrp_count)*par_size, MPI_BYTE,& 451 pright, 1, rvlp, & 452 max(1,trlp_count_recv)*par_size, MPI_BYTE, pleft, 1, & 442 453 comm2d, status, ierr ) 443 454 … … 641 652 642 653 ALLOCATE(rvnp(MAX(1,trnp_count_recv))) 643 644 CALL MPI_SENDRECV( trsp(1)%radius, trsp_count, mpi_particle_type, & 645 psouth, 1, rvnp(1)%radius, & 646 trnp_count_recv, mpi_particle_type, pnorth, 1, & 654 ! 655 !-- This MPI_SENDRECV should work even with odd mixture on 32 and 64 Bit 656 !-- variables in structure particle_type (due to the calculation of par_size) 657 par_size = c_sizeof(trsp(1)) 658 CALL MPI_SENDRECV( trsp, trsp_count*par_size, MPI_BYTE, & 659 psouth, 1, rvnp, & 660 trnp_count_recv*par_size, MPI_BYTE, pnorth, 1, & 647 661 comm2d, status, ierr ) 648 662 … … 658 672 659 673 ALLOCATE(rvsp(MAX(1,trsp_count_recv))) 660 661 CALL MPI_SENDRECV( trnp(1)%radius, trnp_count, mpi_particle_type, & 662 pnorth, 1, rvsp(1)%radius, & 663 trsp_count_recv, mpi_particle_type, psouth, 1, & 674 ! 675 !-- This MPI_SENDRECV should work even with odd mixture on 32 and 64 Bit 676 !-- variables in structure particle_type (due to the calculation of par_size) 677 par_size = c_sizeof(trnp(1)) 678 CALL MPI_SENDRECV( trnp, trnp_count*par_size, MPI_BYTE, & 679 pnorth, 1, rvsp, & 680 trsp_count_recv*par_size, MPI_BYTE, psouth, 1, & 664 681 comm2d, status, ierr ) 665 682 -
palm/trunk/SOURCE/lpm_init.f90
r2274 r2305 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Improved calculation of particle IDs. 28 ! 29 ! 2274 2017-06-09 13:27:48Z Giersch 27 30 ! Changed error messages 28 31 ! … … 44 47 ! 2182 2017-03-17 14:27:40Z schwenkel 45 48 ! Added parameters for simplified particle initialization. 46 ! 49 ! 47 50 ! 2122 2017-01-18 12:22:54Z hoffmann 48 51 ! Improved initialization of equilibrium aerosol radii … … 157 160 MODULE lpm_init_mod 158 161 162 USE, INTRINSIC :: ISO_C_BINDING 159 163 160 164 USE arrays_3d, & … … 187 191 ibc_par_lr, ibc_par_ns, ibc_par_t, iran_part, log_z_z0, & 188 192 max_number_of_particle_groups, min_nr_particle, & 189 mpi_particle_type, number_concentration,&193 number_concentration, & 190 194 number_particles_per_gridbox, number_of_particles, & 191 195 number_of_particle_groups, number_of_sublayers, & … … 243 247 INTEGER(iwp) :: k !< 244 248 245 #if defined( __parallel )246 INTEGER(iwp), DIMENSION(3) :: blocklengths !<247 INTEGER(iwp), DIMENSION(3) :: displacements !<248 INTEGER(iwp), DIMENSION(3) :: types !<249 #endif250 251 249 REAL(wp) :: div !< 252 250 REAL(wp) :: height_int !< … … 255 253 REAL(wp) :: z0_av_local !< 256 254 257 #if defined( __parallel )258 !259 !-- Define MPI derived datatype for FORTRAN datatype particle_type (see module260 !-- particle_attributes). Integer length is 4 byte, Real is 8 byte261 blocklengths(1) = 19; blocklengths(2) = 6; blocklengths(3) = 1262 displacements(1) = 0; displacements(2) = 152; displacements(3) = 176263 264 types(1) = MPI_REAL265 types(2) = MPI_INTEGER266 types(3) = MPI_UB267 CALL MPI_TYPE_STRUCT( 3, blocklengths, displacements, types, &268 mpi_particle_type, ierr )269 CALL MPI_TYPE_COMMIT( mpi_particle_type, ierr )270 #endif271 255 272 256 ! … … 541 525 ! 542 526 !-- initialize counter for particle IDs 543 grid_particles%id_counter = 0527 grid_particles%id_counter = 1 544 528 545 529 ! … … 551 535 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 552 536 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 553 0, 0, 0 , 0, .FALSE., -1 )537 0, 0, 0_idp, .FALSE., -1 ) 554 538 555 539 particle_groups = particle_groups_type( 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp ) … … 697 681 698 682 DO j = 1, particles_per_point 683 699 684 700 685 n = n + 1 … … 731 716 tmp_particle%class = 1 732 717 tmp_particle%group = i 733 tmp_particle%id1 = 0 734 tmp_particle%id2 = 0 718 tmp_particle%id = 0_idp 735 719 tmp_particle%particle_mask = .TRUE. 736 720 tmp_particle%block_nr = -1 … … 858 842 DO n = local_start(kp,jp,ip), number_of_particles !only new particles 859 843 860 particles(n)%id1 = 10000_iwp * grid_particles(kp,jp,ip)%id_counter + kp 861 particles(n)%id2 = 10000_iwp * jp + ip 862 844 particles(n)%id = 10000_idp**3 * grid_particles(kp,jp,ip)%id_counter + & 845 10000_idp**2 * kp + 10000_idp * jp + ip 846 ! 847 !-- Count the number of particles that have been released before 863 848 grid_particles(kp,jp,ip)%id_counter = & 864 849 grid_particles(kp,jp,ip)%id_counter + 1 -
palm/trunk/SOURCE/lpm_read_restart_file.f90
r2265 r2305 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Improved calculation of particle IDs. 28 ! 29 ! 2265 2017-06-08 16:58:28Z schwenkel 27 30 ! Unused variables removed. 28 31 ! … … 122 125 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 123 126 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 124 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0, 0, 0,&125 0, .FALSE., -1)127 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 128 0, 0, 0_idp, .FALSE., -1 ) 126 129 ! 127 130 !-- Read some particle parameters and the size of the particle arrays, -
palm/trunk/SOURCE/mod_particle_attributes.f90
r2278 r2305 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Improved calculation of particle IDs. 28 ! 29 ! 2278 2017-06-12 13:08:18Z schwenkel 27 30 ! Added comments 28 31 ! … … 111 114 INTEGER(iwp) :: merge_drp = 0 !< number of merged droplets 112 115 INTEGER(iwp) :: min_nr_particle = 50 !< namelist parameter (see documentation) 113 INTEGER(iwp) :: mpi_particle_type !< parameter for particle PE particle exchange114 116 INTEGER(iwp) :: new_particles = 0 !< number of new particles 115 117 INTEGER(iwp) :: n_max = 100 !< number of radii bin for splitting functions … … 210 212 211 213 TYPE particle_type 212 SEQUENCE213 214 REAL(wp) :: radius !< radius of particle 214 215 REAL(wp) :: age !< age of particle … … 232 233 INTEGER(iwp) :: class !< radius class needed for collision 233 234 INTEGER(iwp) :: group !< number of particle group 234 INTEGER(iwp) :: id1 !< first part of particle id 235 INTEGER(iwp) :: id2 !< second part of particle id 235 INTEGER(idp) :: id !< particle ID (64 bit integer) 236 236 LOGICAL :: particle_mask !< if this parameter is set to false the particle will be deleted 237 237 INTEGER(iwp) :: block_nr !< number for sorting (removable?) … … 255 255 INTEGER(iwp), DIMENSION(0:7) :: start_index !< start particle index for current block 256 256 INTEGER(iwp), DIMENSION(0:7) :: end_index !< end particle index for current block 257 INTEGER(iwp) :: id_counter !< particle id counter (removeable?)257 INTEGER(iwp) :: id_counter !< particle id counter 258 258 LOGICAL :: time_loop_done !< timestep loop for particle advection 259 259 TYPE(particle_type), POINTER, DIMENSION(:) :: particles !< Particle array for this grid cell
Note: See TracChangeset
for help on using the changeset viewer.