Changeset 3560


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

Location:
palm/trunk/SOURCE
Files:
7 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
  • palm/trunk/SOURCE/lpm_init.f90

    r3524 r3560  
    2525! -----------------
    2626! $Id$
     27! set the first particle release time
     28!
     29! 3524 2018-11-14 13:36:44Z raasch
    2730! added missing working precision
    2831!
     
    260263                curvature_solution_effects, density_ratio, grid_particles,     &
    261264                isf,i_splitting_mode, initial_weighting_factor, ibc_par_b,     &
    262                 ibc_par_lr, ibc_par_ns, ibc_par_t, iran_part, log_z_z0,        &
     265                ibc_par_lr, ibc_par_ns, ibc_par_t, iran_part,                  &
     266                last_particle_release_time, log_z_z0,                          &
    263267                max_number_of_particle_groups, min_nr_particle,                &
    264268                number_concentration,                                          &
     
    654658       iran_part = iran_part + myid
    655659
    656        CALL lpm_create_particle (PHASE_INIT)
     660!
     661!--    Create the particle set, and set the initial particles
     662       CALL lpm_create_particle( phase_init )
     663       last_particle_release_time = particle_advection_start
     664
    657665!
    658666!--    User modification of initial particles
  • palm/trunk/SOURCE/lpm_read_restart_file.f90

    r3049 r3560  
    2525! -----------------
    2626! $Id$
     27! time_prel replaced by last_particle_release_time
     28!
     29! 3049 2018-05-29 13:52:36Z Giersch
    2730! Error messages revised
    2831!
     
    9396    USE kinds
    9497
    95     USE lpm_pack_and_sort_mod,                                                   &
     98    USE lpm_pack_and_sort_mod,                                                 &
    9699        ONLY:  lpm_sort_in_subboxes
    97100
    98101    USE particle_attributes,                                                   &
    99102        ONLY:  alloc_factor, bc_par_b, bc_par_lr, bc_par_ns, bc_par_t,         &
    100                grid_particles, min_nr_particle, number_of_particles,           &
    101                number_of_particle_groups, particle_groups, particle_type,      &
    102                prt_count, time_prel, time_write_particle_data, zero_particle
     103               grid_particles, last_particle_release_time, min_nr_particle,    &
     104               number_of_particles, number_of_particle_groups, particle_groups,&
     105               particle_type, prt_count, time_write_particle_data, zero_particle
    103106
    104107    USE pegrid
     
    153156!-- allocate them and read their contents.
    154157    READ ( 90 )  bc_par_b, bc_par_lr, bc_par_ns, bc_par_t,                     &
    155                  number_of_particle_groups, particle_groups, time_prel,        &
    156                  time_write_particle_data
     158                 last_particle_release_time, number_of_particle_groups,        &
     159                 particle_groups, time_write_particle_data
    157160
    158161    ALLOCATE( prt_count(nzb:nzt+1,nysg:nyng,nxlg:nxrg),                        &
  • palm/trunk/SOURCE/lpm_write_restart_file.f90

    r2718 r3560  
    2525! -----------------
    2626! $Id$
     27! time_prel replaced by last_particle_release_time
     28!
     29! 2718 2018-01-02 08:49:38Z maronga
    2730! Corrected "Former revisions" section
    2831!
     
    7578    USE particle_attributes,                                                   &
    7679        ONLY:  bc_par_b, bc_par_lr, bc_par_ns, bc_par_t, grid_particles,       &
    77                number_of_particles, number_of_particle_groups,                 &
    78                particles, particle_groups, prt_count, time_prel,               &
    79                time_write_particle_data
     80               last_particle_release_time, number_of_particles,                &
     81               number_of_particle_groups, particles, particle_groups,          &
     82               prt_count, time_write_particle_data
    8083
    8184    USE pegrid
     
    119122!-- Write some particle parameters, the size of the particle arrays as
    120123!-- well as other dvrp-plot variables.
    121     WRITE ( 90 )  bc_par_b, bc_par_lr, bc_par_ns, bc_par_t,              &
    122                   number_of_particle_groups, particle_groups, time_prel, &
    123                   time_write_particle_data
     124    WRITE ( 90 )  bc_par_b, bc_par_lr, bc_par_ns, bc_par_t,                    &
     125                  last_particle_release_time, number_of_particle_groups,      &
     126                  particle_groups, time_write_particle_data
    124127
    125128    WRITE ( 90 )  prt_count
  • palm/trunk/SOURCE/mod_particle_attributes.f90

    r3405 r3560  
    2525! -----------------
    2626! $Id$
     27! time_prel replaced by last_particle_release_time
     28!
     29! 3405 2018-10-23 15:34:41Z raasch
    2730! bugfix: BIND attribute added to derived type particle_type
    2831!
     
    186189    REAL(wp) ::  end_time_prel = 9999999.9_wp              !< namelist parameter (see documentation)
    187190    REAL(wp) ::  initial_weighting_factor = 1.0_wp         !< namelist parameter (see documentation)
     191    REAL(wp) ::  last_particle_release_time = 0.0_wp       !< last time of particle release
    188192    REAL(wp) ::  log_sigma(3) = 1.0_wp                     !< namelist parameter (see documentation)
    189193    REAL(wp) ::  na(3) = 0.0_wp                            !< namelist parameter (see documentation)
     
    194198    REAL(wp) ::  rm(3) = 1.0E-6_wp                         !< namelist parameter (see documentation)
    195199    REAL(wp) ::  sgs_wf_part                               !< parameter for sgs
    196     REAL(wp) ::  time_prel = 0.0_wp                        !< time for particle release
    197200    REAL(wp) ::  time_write_particle_data = 0.0_wp         !< write particle data at current time on file
    198201    REAL(wp) ::  weight_factor_merge = -1.0_wp             !< namelist parameter (see documentation)
  • palm/trunk/SOURCE/netcdf_data_input_mod.f90

    r3556 r3560  
    2020! Current revisions:
    2121! -----------------
    22 ! Some formatting adjustment
     22!
    2323!
    2424! Former revisions:
    2525! -----------------
    2626! $Id$
     27! Some formatting adjustment
     28!
     29! 3556 2018-11-22 14:11:57Z suehring
    2730! variables documented and unused variables removed
    2831!
  • palm/trunk/SOURCE/surface_mod.f90

    r3556 r3560  
    2121! Current revisions:
    2222! ------------------
    23 ! Surface restoring in restarts commented. Some formatting.
     23!
    2424!
    2525! Former revisions:
    2626! -----------------
    2727! $Id$
     28! Surface restoring in restarts commented. Some formatting.
     29!
     30! 3556 2018-11-22 14:11:57Z suehring
    2831! variables documented
    2932!
Note: See TracChangeset for help on using the changeset viewer.