!> @file mod_particle_attributes.f90 !------------------------------------------------------------------------------! ! This file is part of PALM. ! ! PALM is free software: you can redistribute it and/or modify it under the ! terms of the GNU General Public License as published by the Free Software ! Foundation, either version 3 of the License, or (at your option) any later ! version. ! ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License along with ! PALM. If not, see . ! ! Copyright 1997-2017 Leibniz Universitaet Hannover !------------------------------------------------------------------------------! ! ! Current revisions: ! ------------------ ! ! ! Former revisions: ! ----------------- ! $Id: mod_particle_attributes.f90 2263 2017-06-08 14:59:01Z schwenkel $ ! Implemented splitting and merging algorithm ! ! 2183 2017-03-17 14:29:15Z schwenkel ! ! 2182 2017-03-17 14:27:40Z schwenkel ! Added parameters for simplified particle initialization. ! ! 2122 2017-01-18 12:22:54Z hoffmann ! Calculation of particle ID ! Particle attribute dvrp_psize renamed to user: this attribute can be used by ! by the user to store any variable ! ! 2000 2016-08-20 18:09:15Z knoop ! Forced header and separation lines into 80 columns ! ! 1936 2016-06-13 13:37:44Z suehring ! +deallocate_memory, step_dealloc ! ! 1929 2016-06-09 16:25:25Z suehring ! -sgs_wfu_par, sgs_wfv_par, sgs_wfw_par ! + sgs_wf_par ! ! 1871 2016-04-15 11:46:09Z hoffmann ! Initialization of aerosols added. ! ! 1849 2016-04-08 11:33:18Z hoffmann ! bfactor, mass_of_solute, molecular_weight_of_solute, molecular_weight_of_water, ! vanthoff added from modules ! ! 1831 2016-04-07 13:15:51Z hoffmann ! palm_kernel removed, curvature_solution_effects added ! ! 1822 2016-04-07 07:49:42Z hoffmann ! +collision_algorithm, all_or_nothing, average_impact ! Tails removed. ! ! 1727 2015-11-20 07:22:02Z knoop ! Bugfix: Cause of syntax warning gfortran preprocessor removed ! ! 1682 2015-10-07 23:56:08Z knoop ! Code annotations made doxygen readable ! ! 1575 2015-03-27 09:56:27Z raasch ! +seed_follows_topography ! ! 1359 2014-04-11 17:15:14Z hoffmann ! new module containing all particle related variables ! -dt_sort_particles ! ! Description: ! ------------ !> Definition of variables used to compute particle transport !------------------------------------------------------------------------------! MODULE particle_attributes USE kinds CHARACTER(LEN=15) :: bc_par_lr = 'cyclic' !< left/right boundary condition CHARACTER(LEN=15) :: bc_par_ns = 'cyclic' !< north/south boundary condition CHARACTER(LEN=15) :: bc_par_b = 'reflect' !< bottom boundary condition CHARACTER(LEN=15) :: bc_par_t = 'absorb' !< top boundary condition CHARACTER(LEN=15) :: collision_algorithm = 'all_or_nothing' !< collision algorithm CHARACTER(LEN=15) :: collision_kernel = 'none' !< collision kernel CHARACTER(LEN=5) :: splitting_function = 'gamma' !< function for calculation critical weighting factor CHARACTER(LEN=5) :: splitting_mode = 'const' !< splitting mode INTEGER(iwp) :: deleted_particles = 0 !< number of deleted particles per time step INTEGER(iwp) :: dissipation_classes = 10 !< number of dissipation classes INTEGER(iwp) :: ibc_par_b !< particle bottom boundary condition dummy INTEGER(iwp) :: ibc_par_lr !< particle left/right boundary condition dummy INTEGER(iwp) :: ibc_par_ns !< particle north/south boundary condition dummy INTEGER(iwp) :: ibc_par_t !< particle top boundary condition dummy INTEGER(iwp) :: iran_part = -1234567 !< number for random generator INTEGER(iwp) :: isf !< dummy for splitting function INTEGER(iwp) :: i_splitting_mode !< dummy for splitting mode INTEGER(iwp) :: maximum_number_of_particles = 0 !< maximum number of particles on a PE (can be removed?) INTEGER(iwp) :: max_number_particles_per_gridbox = 30 !< maximum number of particles per gridbox (used in splitting algorithm) INTEGER(iwp) :: merge_drp = 0 !< number of merged droplets INTEGER(iwp) :: min_nr_particle = 50 !< minimum number of particles for which memory is allocated at every grid cell INTEGER(iwp) :: mpi_particle_type !< parameter for particle PE particle exchange INTEGER(iwp) :: new_particles = 0 !< number of new particles INTEGER(iwp) :: n_max = 100 !< number of radii bin for splitting functions INTEGER(iwp) :: number_of_particles = 0 !< number of particles for each grid box (3d array is saved on prt_count) INTEGER(iwp) :: number_of_particle_groups = 1 !< number of particle groups to be used INTEGER(iwp) :: number_of_sublayers = 20 !< number of sublayers for particle velocities betwenn surface and first grid level INTEGER(iwp) :: number_particles_per_gridbox = -1 !< number of particles which are created in every grid box INTEGER(iwp) :: offset_ocean_nzt = 0 !< in case of oceans runs, the vertical index calculations need an offset INTEGER(iwp) :: offset_ocean_nzt_m1 = 0 !< in case of oceans runs, the vertical index calculations need an offset INTEGER(iwp) :: particles_per_point = 1 !< number of particles to be started per point INTEGER(iwp) :: particle_file_count = 0 !< can be removed ? INTEGER(iwp) :: radius_classes = 20 !< number of radius classes to be used in the collision efficiency table INTEGER(iwp) :: sort_count = 0 !< counter for sorting particles INTEGER(iwp) :: splitting_factor = 2 !< splitting factor INTEGER(iwp) :: splitting_factor_max = 5 !< maximum splittig factor INTEGER(iwp) :: step_dealloc = 100 !< number of timesteps after which particle memory is deallocated INTEGER(iwp) :: sum_merge_drp = 0 !< sum of merged super droplets INTEGER(iwp) :: sum_new_particles = 0 !< sum of created particles (in splitting algorithm) INTEGER(iwp) :: total_number_of_particles !< total number of particles in the whole model domain INTEGER(iwp) :: trlp_count_sum !< parameter for particle exchange of PEs INTEGER(iwp) :: trlp_count_recv_sum !< parameter for particle exchange of PEs INTEGER(iwp) :: trrp_count_sum !< parameter for particle exchange of PEs INTEGER(iwp) :: trrp_count_recv_sum !< parameter for particle exchange of PEs INTEGER(iwp) :: trsp_count_sum !< parameter for particle exchange of PEs INTEGER(iwp) :: trsp_count_recv_sum !< parameter for particle exchange of PEs INTEGER(iwp) :: trnp_count_sum !< parameter for particle exchange of PEs INTEGER(iwp) :: trnp_count_recv_sum !< parameter for particle exchange of PEs INTEGER(iwp), PARAMETER :: max_number_of_particle_groups = 10 !< maximum allowed number of particle groups INTEGER(iwp), DIMENSION(:,:,:), ALLOCATABLE :: prt_count !< 3d array of number of particles of every grid box LOGICAL :: all_or_nothing = .FALSE. !< flag for collision algorithm LOGICAL :: average_impact = .FALSE. !< flag for collision algortihm LOGICAL :: curvature_solution_effects = .FALSE. !< parameter to consider solution and curvature effects on the equilibrium vapor pressure of cloud droplets LOGICAL :: deallocate_memory = .TRUE. !< parameter to enable deallocation of unused memory LOGICAL :: hall_kernel = .FALSE. !< flag for collision kernel LOGICAL :: init_aerosol_probabilistic = .FALSE. !< parameter to steer the initialization of the aerosol spectrum LOGICAL :: merging = .FALSE. !< parameter to enable merging of super droplets LOGICAL :: monodisperse_aerosols = .FALSE. !< parameter to steer the initialization of the aerosol spectrum LOGICAL :: particle_advection = .FALSE. !< parameter to steer the advection of particles LOGICAL :: random_start_position = .FALSE. !< parameter to initialize particles on random positon (within one grid box) LOGICAL :: read_particles_from_restartfile = .TRUE. !< read particle data from the previous run LOGICAL :: seed_follows_topography = .FALSE. !< heights of initial particles are interpreted relative to the given topography LOGICAL :: splitting = .FALSE. !< parameter to enable the splitting of super droplets LOGICAL :: uniform_particles = .TRUE. !< can be removed? LOGICAL :: use_kernel_tables = .FALSE. !< parameter, which turns on the use of precalculated collision kernels LOGICAL :: use_sgs_for_particles = .FALSE. !< parameter to use sgs velocities for particles LOGICAL :: wang_kernel = .FALSE. !< flag for collision kernel LOGICAL :: write_particle_statistics = .FALSE. !< switch on/off output of particle information (statistical information) LOGICAL, DIMENSION(max_number_of_particle_groups) :: & vertical_particle_advection = .TRUE. !< Switch on/off vertical particle transport REAL(wp) :: alloc_factor = 20.0_wp !< memory allocated additionally to the memory needed for initial particles at a given grid cell REAL(wp) :: c_0 = 3.0_wp !< parameter for lagrangian timescale REAL(wp) :: dt_min_part = 0.0002_wp !< minimum particle time step when SGS velocities are used (s) REAL(wp) :: dt_prel = 9999999.9_wp !< temporal interval at which particles are to be released from a particle source (in s) REAL(wp) :: dt_write_particle_data = 9999999.9_wp !< temporal interval for output of particle data (in s) REAL(wp) :: end_time_prel = 9999999.9_wp !< time of the last release of particles (in s). REAL(wp) :: initial_weighting_factor = 1.0_wp !< weighting factor used for initialization REAL(wp) :: molecular_weight_of_solute = 0.05844_wp !< mol. m. NaCl (kg mol-1) REAL(wp) :: molecular_weight_of_water = 0.01801528_wp !< mol. m. H2O (kg mol-1) REAL(wp) :: n1 = 100.0_wp !< number concentration of the first log-normal distribution (dry aerosol initialization) REAL(wp) :: n2 = 0.0_wp !< see n1 REAL(wp) :: n3 = 0.0_wp !< see n1 REAL(wp) :: number_concentration = -1.0_wp !< initial particle number concentration (in units of 1/cm^-3) REAL(wp) :: particle_advection_start = 0.0_wp !< time of the first release of particles (in s). REAL(wp) :: radius_merge = 1.0E-7_wp !< particles with a smaller radius are merged if merging is set REAL(wp) :: radius_split = 40.0E-6_wp !< particles with a bigger radius are splitted if splittig is set REAL(wp) :: rho_s = 2165.0_wp !< density of NaCl (kg m-3) REAL(wp) :: rm1 = 0.05E-6_wp !< mode radius of the first log-normal distribution (dry aerosol initialization) REAL(wp) :: rm2 = 0.05E-6_wp !< see rm1 REAL(wp) :: rm3 = 0.05E-6_wp !< see rm2 REAL(wp) :: s1 = 2.0_wp !< geometric standard deviation of the first log-normal distribution (dry aerosol initialization) REAL(wp) :: s2 = 2.0_wp !< see s1 REAL(wp) :: s3 = 2.0_wp !< see s1 REAL(wp) :: sgs_wf_part !< parameter for sgs REAL(wp) :: time_prel = 0.0_wp !< time for particle release REAL(wp) :: time_sort_particles = 0.0_wp !< can be removed? REAL(wp) :: time_write_particle_data = 0.0_wp !< write particle data at current time on file REAL(wp) :: vanthoff = 2.0_wp !< van't Hoff factor for NaCl REAL(wp) :: weight_factor_merge = -1.0_wp !< critical weighting factor for merging REAL(wp) :: weight_factor_split = -1.0_wp !< critical weighting factor for splitting REAL(wp) :: z0_av_global !< horizontal mean value of z0 REAL(wp), DIMENSION(max_number_of_particle_groups) :: density_ratio = 9999999.9_wp !< ratio of the density of the fluid and the density of the particles REAL(wp), DIMENSION(max_number_of_particle_groups) :: pdx = 9999999.9_wp !< distance along x between particles within a particle source (in m) REAL(wp), DIMENSION(max_number_of_particle_groups) :: pdy = 9999999.9_wp !< distance along y between particles within a particle source (in m) REAL(wp), DIMENSION(max_number_of_particle_groups) :: pdz = 9999999.9_wp !< distance along z between particles within a particle source (in m) REAL(wp), DIMENSION(max_number_of_particle_groups) :: psb = 9999999.9_wp !< bottom edge of a particle source (in m) REAL(wp), DIMENSION(max_number_of_particle_groups) :: psl = 9999999.9_wp !< left edge of a particle source (in m) REAL(wp), DIMENSION(max_number_of_particle_groups) :: psn = 9999999.9_wp !< rear ("north") edge of a particle source (in m) REAL(wp), DIMENSION(max_number_of_particle_groups) :: psr = 9999999.9_wp !< right edge of a particle source (in m). REAL(wp), DIMENSION(max_number_of_particle_groups) :: pss = 9999999.9_wp !< front ("south") edge of a particle source (in m). REAL(wp), DIMENSION(max_number_of_particle_groups) :: pst = 9999999.9_wp !< top edge of a particle source (in m). REAL(wp), DIMENSION(max_number_of_particle_groups) :: radius = 9999999.9_wp !< particle radius (in m). REAL(wp), DIMENSION(:), ALLOCATABLE :: log_z_z0 !< Precalculate LOG(z/z0) TYPE particle_type SEQUENCE REAL(wp) :: radius, age, age_m, dt_sum, user, e_m, & origin_x, origin_y, origin_z, rvar1, rvar2, rvar3, & speed_x, speed_y, speed_z, weight_factor, x, y, z INTEGER(iwp) :: class, group, id1, id2 LOGICAL :: particle_mask INTEGER(iwp) :: block_nr END TYPE particle_type TYPE(particle_type), DIMENSION(:), POINTER :: particles TYPE(particle_type) :: zero_particle TYPE particle_groups_type SEQUENCE REAL(wp) :: density_ratio, radius, exp_arg, exp_term END TYPE particle_groups_type TYPE(particle_groups_type), DIMENSION(max_number_of_particle_groups) :: & particle_groups TYPE grid_particle_def INTEGER(iwp), DIMENSION(0:7) :: start_index INTEGER(iwp), DIMENSION(0:7) :: end_index INTEGER(iwp) :: id_counter LOGICAL :: time_loop_done TYPE(particle_type), POINTER, DIMENSION(:) :: particles !Particle array for this grid cell END TYPE grid_particle_def TYPE(grid_particle_def), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: grid_particles TYPE block_offset_def INTEGER(iwp) :: i_off INTEGER(iwp) :: j_off INTEGER(iwp) :: k_off END TYPE block_offset_def TYPE(block_offset_def), DIMENSION(0:7) :: block_offset SAVE END MODULE particle_attributes