Ignore:
Timestamp:
Nov 10, 2017 10:36:31 AM (4 years ago)
Author:
schwenkel
Message:

Modified particle box location and further changes in particle model

File:
1 edited

Legend:

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

    r2375 r2606  
    2525! -----------------
    2626! $Id$
     27! Changed particle box locations: center of particle box now coincides
     28! with scalar grid point of same index.
     29! Renamed module and subroutines: lpm_pack_arrays_mod -> lpm_pack_and_sort_mod
     30! lpm_pack_all_arrays -> lpm_sort_in_subboxes, lpm_pack_arrays -> lpm_pack
     31! lpm_sort -> lpm_sort_timeloop_done
     32!
     33! 2375 2017-08-29 14:10:28Z schwenkel
    2734! Initialization of chemical aerosol composition
    2835!
     
    277284!
    278285!-- Define block offsets for dividing a gridcell in 8 sub cells
    279 
    280     block_offset(0) = block_offset_def (-1,-1,-1)
    281     block_offset(1) = block_offset_def (-1,-1, 0)
    282     block_offset(2) = block_offset_def (-1, 0,-1)
    283     block_offset(3) = block_offset_def (-1, 0, 0)
    284     block_offset(4) = block_offset_def ( 0,-1,-1)
    285     block_offset(5) = block_offset_def ( 0,-1, 0)
    286     block_offset(6) = block_offset_def ( 0, 0,-1)
    287     block_offset(7) = block_offset_def ( 0, 0, 0)
     286!-- See documentation for List of subgrid boxes
     287!-- See pack_and_sort in lpm_pack_arrays.f90 for assignment of the subgrid boxes
     288    block_offset(0) = block_offset_def ( 0, 0, 0)
     289    block_offset(1) = block_offset_def ( 0, 0,-1)
     290    block_offset(2) = block_offset_def ( 0,-1, 0)
     291    block_offset(3) = block_offset_def ( 0,-1,-1)
     292    block_offset(4) = block_offset_def (-1, 0, 0)
     293    block_offset(5) = block_offset_def (-1, 0,-1)
     294    block_offset(6) = block_offset_def (-1,-1, 0)
     295    block_offset(7) = block_offset_def (-1,-1,-1)
    288296!
    289297!-- Check the number of particle groups.
     
    309317!
    310318!-- Set default start positions, if necessary
    311     IF ( psl(1) == 9999999.9_wp )  psl(1) = -0.5_wp * dx
    312     IF ( psr(1) == 9999999.9_wp )  psr(1) = ( nx + 0.5_wp ) * dx
    313     IF ( pss(1) == 9999999.9_wp )  pss(1) = -0.5_wp * dy
    314     IF ( psn(1) == 9999999.9_wp )  psn(1) = ( ny + 0.5_wp ) * dy
     319    IF ( psl(1) == 9999999.9_wp )  psl(1) = 0.0_wp
     320    IF ( psr(1) == 9999999.9_wp )  psr(1) = ( nx +1 ) * dx
     321    IF ( pss(1) == 9999999.9_wp )  pss(1) = 0.0_wp
     322    IF ( psn(1) == 9999999.9_wp )  psn(1) = ( ny +1 ) * dy
    315323    IF ( psb(1) == 9999999.9_wp )  psb(1) = zu(nz/2)
    316324    IF ( pst(1) == 9999999.9_wp )  pst(1) = psb(1)
     
    617625        ONLY: lpm_exchange_horiz, lpm_move_particle, realloc_particles_array
    618626
    619     USE lpm_pack_arrays_mod,                                                   &
    620         ONLY: lpm_pack_all_arrays
     627    USE lpm_pack_and_sort_mod,                                                   &
     628        ONLY: lpm_sort_in_subboxes
    621629
    622630    USE particle_attributes,                                                   &
     
    683691                DO WHILE ( pos_y <= psn(i) )
    684692
    685                    IF ( pos_y >= ( nys - 0.5_wp ) * dy  .AND.                  &
    686                         pos_y <  ( nyn + 0.5_wp ) * dy ) THEN
     693                   IF ( pos_y >= nys * dy  .AND.                  &
     694                        pos_y <  ( nyn + 1 ) * dy  ) THEN
    687695
    688696                      pos_x = psl(i)
     
    690698               xloop: DO WHILE ( pos_x <= psr(i) )
    691699
    692                          IF ( pos_x >= ( nxl - 0.5_wp ) * dx  .AND.            &
    693                               pos_x <  ( nxr + 0.5_wp ) * dx ) THEN
     700                         IF ( pos_x >= nxl * dx  .AND.            &
     701                              pos_x <  ( nxr + 1) * dx ) THEN
    694702
    695703                            DO  j = 1, particles_per_point
     
    729737!
    730738!--                            Determine the grid indices of the particle position
    731                                ip = ( tmp_particle%x + 0.5_wp * dx ) * ddx
    732                                jp = ( tmp_particle%y + 0.5_wp * dy ) * ddy
     739                               ip = tmp_particle%x * ddx
     740                               jp = tmp_particle%y * ddy
    733741                               kp = tmp_particle%z / dz + 1 + offset_ocean_nzt
    734742!
     
    916924                       grid_particles(kp,jp,ip)%particles(1:number_of_particles)
    917925                DO  n = local_start(kp,jp,ip), number_of_particles
    918                    i = ( particles(n)%x + 0.5_wp * dx ) * ddx
    919                    j = ( particles(n)%y + 0.5_wp * dy ) * ddy
     926                   i = particles(n)%x * ddx
     927                   j = particles(n)%y * ddy
    920928                   k =   particles(n)%z / dz + 1 + offset_ocean_nzt
    921929!
     
    941949!-- which is needed for a fast interpolation of the LES fields on the particle
    942950!-- position.
    943     CALL lpm_pack_all_arrays
     951    CALL lpm_sort_in_subboxes
    944952
    945953!
Note: See TracChangeset for help on using the changeset viewer.