Changeset 2182 for palm/trunk/SOURCE


Ignore:
Timestamp:
Mar 17, 2017 2:27:40 PM (7 years ago)
Author:
schwenkel
Message:

Added parameters for simplified particle initialization

Location:
palm/trunk/SOURCE
Files:
3 edited

Legend:

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

    r2123 r2182  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Added parameters for simplified particle initialization.
    2323!
    2424! Former revisions:
     
    170170                max_number_of_particle_groups, maximum_number_of_particles,    &
    171171                min_nr_particle, mpi_particle_type,                            &
     172                number_concentration, number_particles_per_gridbox,            &
    172173                number_of_particles,                                           &
    173174                number_of_particle_groups, number_of_sublayers,                &
     
    230231#endif
    231232
     233    REAL(wp) ::  div                             !<
    232234    REAL(wp) ::  height_int                      !<
    233235    REAL(wp) ::  height_p                        !<
     
    292294    IF ( pdy(1) == 9999999.9_wp  .OR.  pdy(1) == 0.0_wp )  pdy(1) = dy
    293295    IF ( pdz(1) == 9999999.9_wp  .OR.  pdz(1) == 0.0_wp )  pdz(1) = zu(2) - zu(1)
     296
     297!
     298!-- If number_particles_per_gridbox is set, the parametres pdx, pdy and pdz are
     299!-- calculated diagnostically. Therfore an isotropic distribution is prescribed.
     300    IF ( number_particles_per_gridbox /= -1 .AND.   &
     301         number_particles_per_gridbox >= 1 )    THEN
     302       pdx(1) = (( dx * dy * ( zu(2) - zu(1) ) ) /  &
     303             REAL(number_particles_per_gridbox))**0.3333333_wp
     304!
     305!--    Ensure a smooth value (two significant digits) of distance between
     306!--    particles (pdx, pdy, pdz).
     307       div = 1000.0_wp
     308       DO  WHILE ( pdx(1) < div )
     309          div = div / 10.0_wp
     310       ENDDO
     311       pdx(1) = NINT( pdx(1) * 100.0_wp / div ) * div / 100.0_wp
     312       pdy(1) = pdx(1)
     313       pdz(1) = pdx(1)
     314
     315    ENDIF
    294316
    295317    DO  j = 2, number_of_particle_groups
     
    578600          local_count = prt_count   ! Start address of new particles
    579601       ENDIF
     602
     603!
     604!--    Calculate initial_weighting_factor diagnostically
     605       IF ( number_concentration /= -1.0_wp .AND. number_concentration > 0.0_wp ) THEN
     606          initial_weighting_factor =  number_concentration * 1.0E6_wp *             &
     607                                      pdx(1) * pdy(1) * pdz(1)
     608       END IF
    580609
    581610       n = 0
     
    662691
    663692                            local_count(kp,jp,ip) = local_count(kp,jp,ip) + 1
     693
    664694                            IF ( .NOT. first_stride )  THEN
    665695                               IF ( ip < nxl  .OR.  jp < nys  .OR.  kp < nzb+1 )  THEN
     
    714744                            alloc_factor / 100.0_wp ) ), min_nr_particle )
    715745                         IF( alloc_size > SIZE( grid_particles(kp,jp,ip)%particles) )  THEN
    716                            CALL realloc_particles_array(ip,jp,kp,alloc_size)
     746                            CALL realloc_particles_array(ip,jp,kp,alloc_size)
    717747                         ENDIF
    718748                      ENDIF
    719749                   ENDIF
    720 
    721750                ENDDO
    722751             ENDDO
     
    725754
    726755    ENDDO
     756
     757
    727758
    728759    local_start = prt_count+1
     
    740771             DO  n = local_start(kp,jp,ip), number_of_particles  !only new particles
    741772
    742                 particles(n)%id1 = 10000 * grid_particles(kp,jp,ip)%id_counter + kp
    743                 particles(n)%id2 = 10000 * jp + ip
     773                particles(n)%id1 = 10000_iwp * grid_particles(kp,jp,ip)%id_counter + kp
     774                particles(n)%id2 = 10000_iwp * jp + ip
    744775
    745776                grid_particles(kp,jp,ip)%id_counter =                          &
  • palm/trunk/SOURCE/mod_particle_attributes.f90

    r2123 r2182  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! Added parameters for simplified particle initialization.
    2323!
    2424! Former revisions:
     
    9393                     number_of_particle_groups = 1,                            &
    9494                     number_of_sublayers = 20,                                 &
     95                     number_particles_per_gridbox = -1,                        &
    9596                     offset_ocean_nzt = 0,                                     &
    9697                     offset_ocean_nzt_m1 = 0, particles_per_point = 1,         &
     
    125126                 end_time_prel = 9999999.9_wp,                                 &
    126127                 initial_weighting_factor = 1.0_wp,                            &
     128                 number_concentration     = -1.0_wp,                           &
    127129                 particle_advection_start = 0.0_wp,                            &
    128130                 sgs_wf_part, time_prel = 0.0_wp, time_sort_particles = 0.0_wp,&
  • palm/trunk/SOURCE/package_parin.f90

    r2101 r2182  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Added parameters for simplified particle initialization.
    2323!
    2424! Former revisions:
     
    165165               dt_write_particle_data, end_time_prel, initial_weighting_factor,&
    166166               init_aerosol_probabilistic, min_nr_particle,                    &
    167                monodisperse_aerosols, n1, n2, n3, number_of_particle_groups,   &
     167               monodisperse_aerosols, n1, n2, n3, number_concentration,        &
     168               number_of_particle_groups, number_particles_per_gridbox,        &
    168169               particles_per_point, particle_advection,                        &
    169170               particle_advection_start,                                       &
     
    207208                                  init_aerosol_probabilistic,                  &
    208209                                  min_nr_particle, monodisperse_aerosols,      &
    209                                   n1, n2, n3, number_of_particle_groups,       &
     210                                  n1, n2, n3, number_concentration,            &
     211                                  number_of_particle_groups,                   &
     212                                  number_particles_per_gridbox,                &
    210213                                  particles_per_point,                         &
    211214                                  particle_advection_start,                    &
Note: See TracChangeset for help on using the changeset viewer.