Ignore:
Timestamp:
Nov 23, 2018 9:20:21 AM (3 years ago)
Author:
raasch
Message:

bugfix to guarantee correct particle releases in case that the release interval is smaller than the model timestep

File:
1 edited

Legend:

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

    r2801 r3560  
    2727! -----------------
    2828! $Id$
     29! bugfix to guarantee correct particle releases in case that the release
     30! interval is smaller than the model timestep
     31!
     32! 2801 2018-02-14 16:01:55Z thiele
    2933! Changed lpm from subroutine to module.
    3034! Introduce particle transfer in nested models.
     
    172176    USE particle_attributes,                                                   &
    173177        ONLY:  collision_kernel, deleted_particles, deallocate_memory,         &
    174                dt_write_particle_data, dt_prel, end_time_prel,                 &
    175                grid_particles, merging,  number_of_particles,                  &
     178               dt_write_particle_data, dt_prel, end_time_prel, grid_particles, &
     179               last_particle_release_time, merging, number_of_particles,       &
    176180               number_of_particle_groups, particles, particle_groups,          &
    177                prt_count, splitting, step_dealloc, time_prel,                  &
    178                time_write_particle_data, trlp_count_sum, trlp_count_recv_sum,  &
    179                trnp_count_sum, trnp_count_recv_sum, trrp_count_sum,            &
    180                trrp_count_recv_sum, trsp_count_sum, trsp_count_recv_sum,       &
    181                use_sgs_for_particles, write_particle_statistics
     181               prt_count, splitting, step_dealloc, time_write_particle_data,   &
     182               trlp_count_sum, trlp_count_recv_sum, trnp_count_sum,            &
     183               trnp_count_recv_sum, trrp_count_sum, trrp_count_recv_sum,       &
     184               trsp_count_sum, trsp_count_recv_sum, use_sgs_for_particles,     &
     185               write_particle_statistics
    182186                             
    183187    USE pegrid
     
    274278!
    275279!-- If necessary, release new set of particles
    276     IF ( time_prel >= dt_prel  .AND.  end_time_prel > simulated_time )  THEN
    277 
    278        CALL lpm_create_particle(PHASE_RELEASE)
    279 !
    280 !--    The MOD function allows for changes in the output interval with
    281 !--    restart runs.
    282        time_prel = MOD( time_prel, MAX( dt_prel, dt_3d ) )
     280    IF ( ( simulated_time - last_particle_release_time ) >= dt_prel  .AND. end_time_prel > simulated_time ) &
     281    THEN
     282
     283       DO WHILE ( ( simulated_time - last_particle_release_time ) >= dt_prel )
     284
     285          CALL lpm_create_particle( phase_release )
     286          last_particle_release_time = last_particle_release_time + dt_prel
     287
     288       ENDDO
    283289
    284290    ENDIF
     
    429435
    430436!
    431 !--    Increment time since last release
    432        IF ( dt_3d_reached )  time_prel = time_prel + dt_3d
    433 !
    434437!--    Apply splitting and merging algorithm
    435438       IF ( cloud_droplets )  THEN
Note: See TracChangeset for help on using the changeset viewer.