Changeset 3948 for palm/trunk/SOURCE/pmc_particle_interface.f90
- Timestamp:
- May 3, 2019 2:49:57 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/pmc_particle_interface.f90
r3883 r3948 26 26 ! -----------------! 27 27 ! $Id$ 28 ! coarse bound renamed as parent_bound and icl, icr, jcs, jcn as ipl, ipr, jps, jpn. 29 ! 30 ! 3883 2019-04-10 12:51:50Z hellstea 28 31 ! Function get_number_of_childs renamed to get_number_of_children and cg 29 32 ! renamed to pg according to their definitions in pmc_interface_mod … … 108 111 ONLY: cpl_id, get_number_of_children, nr_part, part_adr, nested_run, & 109 112 get_childid, get_child_edges, nr_partc, part_adrc, & 110 coarse_bound, coord_x, coord_y, pg, get_child_gridspacing, &113 parent_bound, coord_x, coord_y, pg, get_child_gridspacing, & 111 114 lower_left_coord_x, lower_left_coord_y 112 115 … … 251 254 INTEGER(iwp) :: m !< loop index 252 255 INTEGER(iwp) :: ierr !< error code 253 INTEGER(iwp) :: i cl !< left boundary in coarse(parent) index space254 INTEGER(iwp) :: i cr !< right boundary in coarse(parent) index space255 INTEGER(iwp) :: j cs !< south boundary in coarse(parent) index space256 INTEGER(iwp) :: j cn !< north boundary in coarse(parent) index space256 INTEGER(iwp) :: ipl !< left boundary in coarse(parent) index space 257 INTEGER(iwp) :: ipr !< right boundary in coarse(parent) index space 258 INTEGER(iwp) :: jps !< south boundary in coarse(parent) index space 259 INTEGER(iwp) :: jpn !< north boundary in coarse(parent) index space 257 260 INTEGER(iwp) :: child_id !< Id of a child model 258 261 INTEGER(iwp) :: nr_childs !< Number of child models of the current model … … 285 288 ! 286 289 !-- Child domain boundaries in the parent index space 287 i cl = coarse_bound(1)288 i cr = coarse_bound(2)289 j cs = coarse_bound(3)290 j cn = coarse_bound(4)291 292 ALLOCATE( coarse_particles(j cs:jcn, icl:icr) )290 ipl = parent_bound(1) 291 ipr = parent_bound(2) 292 jps = parent_bound(3) 293 jpn = parent_bound(4) 294 295 ALLOCATE( coarse_particles(jps:jpn,ipl:ipr) ) 293 296 294 297 coarse_particles(:,:)%nr_particle = 0 … … 331 334 332 335 INTEGER(iwp) :: i !< x grid index 333 INTEGER(iwp) :: i cl !< left boundary in coarse(parent) index space336 INTEGER(iwp) :: ipl !< left boundary in coarse(parent) index space 334 337 INTEGER(iwp) :: ierr !< error code 335 338 INTEGER(iwp) :: ij !< combined xy index for the buffer array 336 339 INTEGER(iwp) :: ip !< loop index (child PEs) 337 340 INTEGER(iwp) :: j !< y grid index 338 INTEGER(iwp) :: j cs !< south boundary in coarse(parent) index space341 INTEGER(iwp) :: jps !< south boundary in coarse(parent) index space 339 342 INTEGER(iwp) :: nr !< number of particles to receive from a parent box 340 343 … … 359 362 !-- Synchronization is done implicitely in pmc_c_getbuffer and pmc_s_fillbuffer on the parent side 360 363 361 i cl = coarse_bound(1)362 j cs = coarse_bound(3)364 ipl = parent_bound(1) 365 jps = parent_bound(3) 363 366 364 367 DO ip = 1, me%inter_npes … … 367 370 368 371 DO ij = 1, ape%nrele 369 j = ape%locind(ij)%j + j cs - 1370 i = ape%locind(ij)%i + i cl - 1372 j = ape%locind(ij)%j + jps - 1 373 i = ape%locind(ij)%i + ipl - 1 371 374 nr = nr_partc(j,i) 372 375 IF ( nr > 0 ) THEN … … 406 409 INTEGER(iwp) :: disp_offset !< 407 410 INTEGER(iwp) :: i !< x loop index 408 INTEGER(iwp) :: i cl !< left boundary in coarse(parent) index space409 INTEGER(iwp) :: i cr !< right boundary in coarse(parent) index space411 INTEGER(iwp) :: ipl !< left boundary in coarse(parent) index space 412 INTEGER(iwp) :: ipr !< right boundary in coarse(parent) index space 410 413 INTEGER(iwp) :: ierr !< error code 411 414 INTEGER(iwp) :: ij !< combined xy index for the buffer array 412 415 INTEGER(iwp) :: ip !< loop index (child PEs) 413 416 INTEGER(iwp) :: j !< y loop index 414 INTEGER(iwp) :: j cs !< south boundary in coarse(parent) index space415 INTEGER(iwp) :: j cn !< north boundary in coarse(parent) index space417 INTEGER(iwp) :: jps !< south boundary in coarse(parent) index space 418 INTEGER(iwp) :: jpn !< north boundary in coarse(parent) index space 416 419 INTEGER(iwp) :: max_nr_particle_per_pe !< maximum number of particles per PE (depending on grid apect ratio) 417 420 INTEGER(iwp) :: n !< shorter variable name for nr_fine_in_coarse … … 440 443 !-- Child domain boundaries in the parent index space 441 444 442 i cl = coarse_bound(1)443 i cr = coarse_bound(2)444 j cs = coarse_bound(3)445 j cn = coarse_bound(4)445 ipl = parent_bound(1) 446 ipr = parent_bound(2) 447 jps = parent_bound(3) 448 jpn = parent_bound(4) 446 449 447 450 nr_partc = 0 448 451 449 DO i = i cl, icr450 DO j = j cs, jcn452 DO i = ipl, ipr 453 DO j = jps, jpn 451 454 nr_partc(j,i) = coarse_particles(j,i)%nr_particle 452 455 ENDDO … … 480 483 target_disp = disp_offset 481 484 DO ij = 1, ape%nrele 482 j = ape%locind(ij)%j + j cs - 1483 i = ape%locind(ij)%i + i cl - 1485 j = ape%locind(ij)%j + jps - 1 486 i = ape%locind(ij)%i + ipl - 1 484 487 nr = nr_partc(j,i) 485 488 IF( nr > 0 ) THEN … … 907 910 908 911 INTEGER(iwp) :: ic !< coarse x grid index 909 INTEGER(iwp) :: i cl !< left boundary in coarse(parent) index space910 INTEGER(iwp) :: i cr !< right boundary in coarse(parent) index space912 INTEGER(iwp) :: ipl !< left boundary in coarse(parent) index space 913 INTEGER(iwp) :: ipr !< right boundary in coarse(parent) index space 911 914 INTEGER(iwp) :: ip !< x grid index 912 915 INTEGER(iwp) :: jc !< coarse y grid index 913 INTEGER(iwp) :: j cn !< north boundary in coarse(parent) index space914 INTEGER(iwp) :: j cs !< south boundary in coarse(parent) index space916 INTEGER(iwp) :: jpn !< north boundary in coarse(parent) index space 917 INTEGER(iwp) :: jps !< south boundary in coarse(parent) index space 915 918 INTEGER(iwp) :: jp !< y grid index 916 919 INTEGER(iwp) :: kp !< z grid index … … 927 930 ! 928 931 !-- Child domain boundaries in the parent index space 929 i cl = coarse_bound(1)930 i cr = coarse_bound(2)931 j cs = coarse_bound(3)932 j cn = coarse_bound(4)933 934 DO ic = i cl, icr935 DO jc = j cs, jcn932 ipl = parent_bound(1) 933 ipr = parent_bound(2) 934 jps = parent_bound(3) 935 jpn = parent_bound(4) 936 937 DO ic = ipl, ipr 938 DO jc = jps, jpn 936 939 nr = coarse_particles(jc,ic)%nr_particle 937 940 … … 984 987 INTEGER(iwp) :: i !< loop index (x grid) 985 988 INTEGER(iwp) :: ic !< loop index (coarse x grid) 986 INTEGER(iwp) :: i cl !< left boundary in coarse(parent) index space987 INTEGER(iwp) :: i cr !< left boundary in coarse(parent) index space989 INTEGER(iwp) :: ipl !< left boundary in coarse(parent) index space 990 INTEGER(iwp) :: ipr !< left boundary in coarse(parent) index space 988 991 INTEGER(iwp) :: ierr !< error code 989 992 INTEGER(iwp) :: j !< loop index (y grid) 990 993 INTEGER(iwp) :: jc !< loop index (coarse y grid) 991 INTEGER(iwp) :: j cs !< south boundary in coarse(parent) index space992 INTEGER(iwp) :: j cn !< north boundary in coarse(parent) index space994 INTEGER(iwp) :: jps !< south boundary in coarse(parent) index space 995 INTEGER(iwp) :: jpn !< north boundary in coarse(parent) index space 993 996 INTEGER(iwp) :: k !< loop index (z grid) 994 997 INTEGER(iwp) :: n !< loop index (number of particles) … … 1008 1011 !-- Child domain boundaries in the parent index space 1009 1012 1010 i cl = coarse_bound(1)1011 i cr = coarse_bound(2)1012 j cs = coarse_bound(3)1013 j cn = coarse_bound(4)1013 ipl = parent_bound(1) 1014 ipr = parent_bound(2) 1015 jps = parent_bound(3) 1016 jpn = parent_bound(4) 1014 1017 1015 1018 ! … … 1022 1025 ! Clear Particle Buffer 1023 1026 1024 DO ic = i cl, icr1025 DO jc = j cs, jcn1027 DO ic = ipl, ipr 1028 DO jc = jps, jpn 1026 1029 coarse_particles(jc,ic)%nr_particle = 0 1027 1030 ENDDO … … 1054 1057 jc = y / pg%dy 1055 1058 1056 IF ( ic >= i cl .AND. ic <= icr .AND. jc >= jcs .AND. jc <= jcn ) THEN1059 IF ( ic >= ipl .AND. ic <= ipr .AND. jc >= jps .AND. jc <= jpn ) THEN 1057 1060 coarse_particles(jc,ic)%nr_particle = coarse_particles(jc,ic)%nr_particle + 1 1058 1061 CALL check_and_alloc_coarse_particle( ic, jc, coarse_particles(jc,ic)%nr_particle, with_copy=.TRUE. ) … … 1066 1069 grid_particles(k,j,i)%particles(n)%particle_mask = .FALSE. 1067 1070 ELSE 1068 WRITE(9,'(a,10i6)') 'This should not happen ',i,j,k,ic,jc,i cl,icr,jcs,jcn1071 WRITE(9,'(a,10i6)') 'This should not happen ',i,j,k,ic,jc,ipl,ipr,jps,jpn 1069 1072 CALL MPI_Abort( MPI_COMM_WORLD, 9999, ierr ) 1070 1073 ENDIF … … 1128 1131 yo = particle_in_win(pindex)%origin_y-lower_left_coord_y 1129 1132 k = nzt + 1 1130 DO WHILE ( zw(k-1) > z .AND. k > nzb + 1 ) 1133 DO WHILE ( zw(k-1) > z .AND. k > nzb + 1 ) ! kk search loop has to be optimzed !!! 1131 1134 k = k - 1 1132 1135 END DO
Note: See TracChangeset
for help on using the changeset viewer.