Ignore:
Timestamp:
May 3, 2019 2:49:57 PM (2 years ago)
Author:
hellstea
Message:

some cleaning up

File:
1 edited

Legend:

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

    r3883 r3948  
    2626! -----------------!
    2727! $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
    2831! Function get_number_of_childs renamed to get_number_of_children and cg
    2932! renamed to pg according to their definitions in pmc_interface_mod
     
    108111       ONLY: cpl_id, get_number_of_children, nr_part, part_adr, nested_run,    &
    109112             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,        &
    111114             lower_left_coord_x, lower_left_coord_y
    112115
     
    251254    INTEGER(iwp) ::  m         !< loop index
    252255    INTEGER(iwp) ::  ierr      !< error code
    253     INTEGER(iwp) ::  icl       !< left boundary in coarse(parent) index space
    254     INTEGER(iwp) ::  icr       !< right boundary in coarse(parent) index space
    255     INTEGER(iwp) ::  jcs       !< south boundary in coarse(parent) index space
    256     INTEGER(iwp) ::  jcn       !< north boundary in coarse(parent) index space
     256    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
    257260    INTEGER(iwp) ::  child_id  !< Id of a child model
    258261    INTEGER(iwp) ::  nr_childs !< Number of child models of the current model
     
    285288!
    286289!--    Child domain boundaries in the parent index space
    287        icl = coarse_bound(1)
    288        icr = coarse_bound(2)
    289        jcs = coarse_bound(3)
    290        jcn = coarse_bound(4)
    291 
    292        ALLOCATE( coarse_particles(jcs: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) )
    293296
    294297       coarse_particles(:,:)%nr_particle = 0
     
    331334
    332335    INTEGER(iwp) ::  i    !< x grid index
    333     INTEGER(iwp) ::  icl  !< left boundary in coarse(parent) index space
     336    INTEGER(iwp) ::  ipl  !< left boundary in coarse(parent) index space
    334337    INTEGER(iwp) ::  ierr !< error code
    335338    INTEGER(iwp) ::  ij   !< combined xy index for the buffer array
    336339    INTEGER(iwp) ::  ip   !< loop index (child PEs)
    337340    INTEGER(iwp) ::  j    !< y grid index
    338     INTEGER(iwp) ::  jcs  !< south boundary in coarse(parent) index space
     341    INTEGER(iwp) ::  jps  !< south boundary in coarse(parent) index space
    339342    INTEGER(iwp) ::  nr   !< number of particles to receive from a parent box
    340343   
     
    359362!--    Synchronization is done implicitely in pmc_c_getbuffer and pmc_s_fillbuffer on the parent side
    360363
    361        icl = coarse_bound(1)
    362        jcs = coarse_bound(3)
     364       ipl = parent_bound(1)
     365       jps = parent_bound(3)
    363366
    364367       DO  ip = 1, me%inter_npes
     
    367370
    368371          DO  ij = 1, ape%nrele
    369               j = ape%locind(ij)%j + jcs - 1
    370               i = ape%locind(ij)%i + icl - 1
     372              j = ape%locind(ij)%j + jps - 1
     373              i = ape%locind(ij)%i + ipl - 1
    371374              nr = nr_partc(j,i)
    372375              IF ( nr > 0 )  THEN
     
    406409    INTEGER(iwp) ::  disp_offset            !<
    407410    INTEGER(iwp) ::  i                      !< x loop index
    408     INTEGER(iwp) ::  icl                    !< left boundary in coarse(parent) index space
    409     INTEGER(iwp) ::  icr                    !< right boundary in coarse(parent) index space
     411    INTEGER(iwp) ::  ipl                    !< left boundary in coarse(parent) index space
     412    INTEGER(iwp) ::  ipr                    !< right boundary in coarse(parent) index space
    410413    INTEGER(iwp) ::  ierr                   !< error code
    411414    INTEGER(iwp) ::  ij                     !< combined xy index for the buffer array
    412415    INTEGER(iwp) ::  ip                     !< loop index (child PEs)
    413416    INTEGER(iwp) ::  j                      !< y loop index
    414     INTEGER(iwp) ::  jcs                    !< south boundary in coarse(parent) index space
    415     INTEGER(iwp) ::  jcn                    !< north boundary in coarse(parent) index space
     417    INTEGER(iwp) ::  jps                    !< south boundary in coarse(parent) index space
     418    INTEGER(iwp) ::  jpn                    !< north boundary in coarse(parent) index space
    416419    INTEGER(iwp) ::  max_nr_particle_per_pe !< maximum number of particles per PE (depending on grid apect ratio)
    417420    INTEGER(iwp) ::  n                      !< shorter variable name for nr_fine_in_coarse
     
    440443!--    Child domain boundaries in the parent index space
    441444
    442        icl = coarse_bound(1)
    443        icr = coarse_bound(2)
    444        jcs = coarse_bound(3)
    445        jcn = coarse_bound(4)
     445       ipl = parent_bound(1)
     446       ipr = parent_bound(2)
     447       jps = parent_bound(3)
     448       jpn = parent_bound(4)
    446449
    447450       nr_partc = 0
    448451       
    449        DO i = icl, icr
    450           DO j = jcs, jcn
     452       DO i = ipl, ipr
     453          DO j = jps, jpn
    451454             nr_partc(j,i) = coarse_particles(j,i)%nr_particle
    452455          ENDDO
     
    480483          target_disp = disp_offset
    481484          DO ij = 1, ape%nrele
    482              j  = ape%locind(ij)%j + jcs - 1
    483              i  = ape%locind(ij)%i + icl - 1
     485             j  = ape%locind(ij)%j + jps - 1
     486             i  = ape%locind(ij)%i + ipl - 1
    484487             nr = nr_partc(j,i)
    485488             IF( nr > 0 ) THEN
     
    907910 
    908911    INTEGER(iwp) ::  ic  !< coarse x grid index
    909     INTEGER(iwp) ::  icl !< left boundary in coarse(parent) index space
    910     INTEGER(iwp) ::  icr !< right boundary in coarse(parent) index space
     912    INTEGER(iwp) ::  ipl !< left boundary in coarse(parent) index space
     913    INTEGER(iwp) ::  ipr !< right boundary in coarse(parent) index space
    911914    INTEGER(iwp) ::  ip  !< x grid index
    912915    INTEGER(iwp) ::  jc  !< coarse y grid index
    913     INTEGER(iwp) ::  jcn !< north boundary in coarse(parent) index space
    914     INTEGER(iwp) ::  jcs !< south boundary in coarse(parent) index space
     916    INTEGER(iwp) ::  jpn !< north boundary in coarse(parent) index space
     917    INTEGER(iwp) ::  jps !< south boundary in coarse(parent) index space
    915918    INTEGER(iwp) ::  jp  !< y grid index
    916919    INTEGER(iwp) ::  kp  !< z grid index
     
    927930!
    928931!-- Child domain boundaries in the parent index space
    929     icl = coarse_bound(1)
    930     icr = coarse_bound(2)
    931     jcs = coarse_bound(3)
    932     jcn = coarse_bound(4)
    933 
    934     DO ic = icl, icr
    935        DO jc = jcs, jcn
     932    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
    936939          nr = coarse_particles(jc,ic)%nr_particle
    937940
     
    984987    INTEGER(iwp) ::  i    !< loop index (x grid)
    985988    INTEGER(iwp) ::  ic   !< loop index (coarse x grid)
    986     INTEGER(iwp) ::  icl  !< left boundary in coarse(parent) index space
    987     INTEGER(iwp) ::  icr  !< left boundary in coarse(parent) index space
     989    INTEGER(iwp) ::  ipl  !< left boundary in coarse(parent) index space
     990    INTEGER(iwp) ::  ipr  !< left boundary in coarse(parent) index space
    988991    INTEGER(iwp) ::  ierr !< error code
    989992    INTEGER(iwp) ::  j    !< loop index (y grid)
    990993    INTEGER(iwp) ::  jc   !< loop index (coarse y grid)
    991     INTEGER(iwp) ::  jcs  !< south boundary in coarse(parent) index space
    992     INTEGER(iwp) ::  jcn  !< north boundary in coarse(parent) index space
     994    INTEGER(iwp) ::  jps  !< south boundary in coarse(parent) index space
     995    INTEGER(iwp) ::  jpn  !< north boundary in coarse(parent) index space
    993996    INTEGER(iwp) ::  k    !< loop index (z grid)
    994997    INTEGER(iwp) ::  n    !< loop index (number of particles)
     
    10081011!-- Child domain boundaries in the parent index space
    10091012
    1010     icl = coarse_bound(1)
    1011     icr = coarse_bound(2)
    1012     jcs = coarse_bound(3)
    1013     jcn = coarse_bound(4)
     1013    ipl = parent_bound(1)
     1014    ipr = parent_bound(2)
     1015    jps = parent_bound(3)
     1016    jpn = parent_bound(4)
    10141017
    10151018!
     
    10221025!   Clear Particle Buffer
    10231026
    1024     DO ic = icl, icr
    1025        DO jc = jcs, jcn
     1027    DO ic = ipl, ipr
     1028       DO jc = jps, jpn
    10261029          coarse_particles(jc,ic)%nr_particle = 0
    10271030       ENDDO
     
    10541057                      jc = y / pg%dy
    10551058
    1056                       IF ( ic >= icl .AND. ic <= icr .AND. jc >= jcs .AND. jc <= jcn ) THEN
     1059                      IF ( ic >= ipl .AND. ic <= ipr .AND. jc >= jps .AND. jc <= jpn ) THEN
    10571060                         coarse_particles(jc,ic)%nr_particle = coarse_particles(jc,ic)%nr_particle + 1
    10581061                         CALL check_and_alloc_coarse_particle( ic, jc, coarse_particles(jc,ic)%nr_particle, with_copy=.TRUE. )
     
    10661069                         grid_particles(k,j,i)%particles(n)%particle_mask = .FALSE.
    10671070                      ELSE
    1068                          WRITE(9,'(a,10i6)') 'This should not happen ',i,j,k,ic,jc,icl,icr,jcs,jcn
     1071                         WRITE(9,'(a,10i6)') 'This should not happen ',i,j,k,ic,jc,ipl,ipr,jps,jpn
    10691072                         CALL MPI_Abort( MPI_COMM_WORLD, 9999, ierr )
    10701073                      ENDIF
     
    11281131                yo = particle_in_win(pindex)%origin_y-lower_left_coord_y
    11291132                k = nzt + 1
    1130                 DO WHILE ( zw(k-1) > z .AND. k > nzb + 1 )                               ! kk search loop has to be optimzed !!!
     1133                DO WHILE ( zw(k-1) > z .AND. k > nzb + 1 )           ! kk search loop has to be optimzed !!!
    11311134                   k = k - 1
    11321135                END DO
Note: See TracChangeset for help on using the changeset viewer.