[1682] | 1 | !> @file mod_particle_attributes.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[1359] | 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
[2000] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
| 6 | ! terms of the GNU General Public License as published by the Free Software |
---|
| 7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
| 8 | ! version. |
---|
[1359] | 9 | ! |
---|
| 10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 13 | ! |
---|
| 14 | ! You should have received a copy of the GNU General Public License along with |
---|
| 15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 16 | ! |
---|
[2101] | 17 | ! Copyright 1997-2017 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1359] | 19 | ! |
---|
| 20 | ! Current revisions: |
---|
| 21 | ! ------------------ |
---|
[1937] | 22 | ! |
---|
[2183] | 23 | ! |
---|
[1360] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: mod_particle_attributes.f90 2265 2017-06-08 16:58:28Z sward $ |
---|
[2265] | 27 | ! Unused variables removed. |
---|
| 28 | ! |
---|
| 29 | ! 2263 2017-06-08 14:59:01Z schwenkel |
---|
[2263] | 30 | ! Implemented splitting and merging algorithm |
---|
| 31 | ! |
---|
| 32 | ! 2183 2017-03-17 14:29:15Z schwenkel |
---|
[1937] | 33 | ! |
---|
[2183] | 34 | ! 2182 2017-03-17 14:27:40Z schwenkel |
---|
| 35 | ! Added parameters for simplified particle initialization. |
---|
| 36 | ! |
---|
[2123] | 37 | ! 2122 2017-01-18 12:22:54Z hoffmann |
---|
| 38 | ! Calculation of particle ID |
---|
| 39 | ! Particle attribute dvrp_psize renamed to user: this attribute can be used by |
---|
| 40 | ! by the user to store any variable |
---|
| 41 | ! |
---|
[2001] | 42 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 43 | ! Forced header and separation lines into 80 columns |
---|
| 44 | ! |
---|
[1937] | 45 | ! 1936 2016-06-13 13:37:44Z suehring |
---|
| 46 | ! +deallocate_memory, step_dealloc |
---|
| 47 | ! |
---|
[1930] | 48 | ! 1929 2016-06-09 16:25:25Z suehring |
---|
| 49 | ! -sgs_wfu_par, sgs_wfv_par, sgs_wfw_par |
---|
| 50 | ! + sgs_wf_par |
---|
[1360] | 51 | ! |
---|
[1872] | 52 | ! 1871 2016-04-15 11:46:09Z hoffmann |
---|
| 53 | ! Initialization of aerosols added. |
---|
| 54 | ! |
---|
[1851] | 55 | ! 1849 2016-04-08 11:33:18Z hoffmann |
---|
| 56 | ! bfactor, mass_of_solute, molecular_weight_of_solute, molecular_weight_of_water, |
---|
| 57 | ! vanthoff added from modules |
---|
| 58 | ! |
---|
[1832] | 59 | ! 1831 2016-04-07 13:15:51Z hoffmann |
---|
| 60 | ! palm_kernel removed, curvature_solution_effects added |
---|
| 61 | ! |
---|
[1823] | 62 | ! 1822 2016-04-07 07:49:42Z hoffmann |
---|
| 63 | ! +collision_algorithm, all_or_nothing, average_impact |
---|
| 64 | ! Tails removed. |
---|
| 65 | ! |
---|
[1728] | 66 | ! 1727 2015-11-20 07:22:02Z knoop |
---|
| 67 | ! Bugfix: Cause of syntax warning gfortran preprocessor removed |
---|
| 68 | ! |
---|
[1683] | 69 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 70 | ! Code annotations made doxygen readable |
---|
| 71 | ! |
---|
[1576] | 72 | ! 1575 2015-03-27 09:56:27Z raasch |
---|
| 73 | ! +seed_follows_topography |
---|
| 74 | ! |
---|
[1360] | 75 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
[1359] | 76 | ! new module containing all particle related variables |
---|
| 77 | ! -dt_sort_particles |
---|
| 78 | ! |
---|
| 79 | ! Description: |
---|
| 80 | ! ------------ |
---|
[1682] | 81 | !> Definition of variables used to compute particle transport |
---|
[1359] | 82 | !------------------------------------------------------------------------------! |
---|
[1682] | 83 | MODULE particle_attributes |
---|
| 84 | |
---|
[1359] | 85 | |
---|
| 86 | USE kinds |
---|
| 87 | |
---|
[1822] | 88 | CHARACTER(LEN=15) :: bc_par_lr = 'cyclic' !< left/right boundary condition |
---|
| 89 | CHARACTER(LEN=15) :: bc_par_ns = 'cyclic' !< north/south boundary condition |
---|
| 90 | CHARACTER(LEN=15) :: bc_par_b = 'reflect' !< bottom boundary condition |
---|
| 91 | CHARACTER(LEN=15) :: bc_par_t = 'absorb' !< top boundary condition |
---|
| 92 | CHARACTER(LEN=15) :: collision_algorithm = 'all_or_nothing' !< collision algorithm |
---|
| 93 | CHARACTER(LEN=15) :: collision_kernel = 'none' !< collision kernel |
---|
[2263] | 94 | CHARACTER(LEN=5) :: splitting_function = 'gamma' !< function for calculation critical weighting factor |
---|
| 95 | CHARACTER(LEN=5) :: splitting_mode = 'const' !< splitting mode |
---|
[1359] | 96 | |
---|
| 97 | |
---|
[2263] | 98 | INTEGER(iwp) :: deleted_particles = 0 !< number of deleted particles per time step |
---|
[2265] | 99 | INTEGER(iwp) :: dissipation_classes = 10 !< namelist parameter (see documentation) |
---|
[2263] | 100 | INTEGER(iwp) :: ibc_par_b !< particle bottom boundary condition dummy |
---|
| 101 | INTEGER(iwp) :: ibc_par_lr !< particle left/right boundary condition dummy |
---|
| 102 | INTEGER(iwp) :: ibc_par_ns !< particle north/south boundary condition dummy |
---|
| 103 | INTEGER(iwp) :: ibc_par_t !< particle top boundary condition dummy |
---|
| 104 | INTEGER(iwp) :: iran_part = -1234567 !< number for random generator |
---|
| 105 | INTEGER(iwp) :: isf !< dummy for splitting function |
---|
| 106 | INTEGER(iwp) :: i_splitting_mode !< dummy for splitting mode |
---|
[2265] | 107 | INTEGER(iwp) :: max_number_particles_per_gridbox = 30 !< namelist parameter (see documentation) |
---|
[2263] | 108 | INTEGER(iwp) :: merge_drp = 0 !< number of merged droplets |
---|
[2265] | 109 | INTEGER(iwp) :: min_nr_particle = 50 !< namelist parameter (see documentation) |
---|
[2263] | 110 | INTEGER(iwp) :: mpi_particle_type !< parameter for particle PE particle exchange |
---|
| 111 | INTEGER(iwp) :: new_particles = 0 !< number of new particles |
---|
| 112 | INTEGER(iwp) :: n_max = 100 !< number of radii bin for splitting functions |
---|
| 113 | INTEGER(iwp) :: number_of_particles = 0 !< number of particles for each grid box (3d array is saved on prt_count) |
---|
[2265] | 114 | INTEGER(iwp) :: number_of_particle_groups = 1 !< namelist parameter (see documentation) |
---|
[2263] | 115 | INTEGER(iwp) :: number_of_sublayers = 20 !< number of sublayers for particle velocities betwenn surface and first grid level |
---|
[2265] | 116 | INTEGER(iwp) :: number_particles_per_gridbox = -1 !< namelist parameter (see documentation) |
---|
[2263] | 117 | INTEGER(iwp) :: offset_ocean_nzt = 0 !< in case of oceans runs, the vertical index calculations need an offset |
---|
| 118 | INTEGER(iwp) :: offset_ocean_nzt_m1 = 0 !< in case of oceans runs, the vertical index calculations need an offset |
---|
[2265] | 119 | INTEGER(iwp) :: particles_per_point = 1 !< namelist parameter (see documentation) |
---|
| 120 | INTEGER(iwp) :: radius_classes = 20 !< namelist parameter (see documentation) |
---|
[2263] | 121 | INTEGER(iwp) :: sort_count = 0 !< counter for sorting particles |
---|
[2265] | 122 | INTEGER(iwp) :: splitting_factor = 2 !< namelist parameter (see documentation) |
---|
| 123 | INTEGER(iwp) :: splitting_factor_max = 5 !< namelist parameter (see documentation) |
---|
| 124 | INTEGER(iwp) :: step_dealloc = 100 !< namelist parameter (see documentation) |
---|
[2263] | 125 | INTEGER(iwp) :: sum_merge_drp = 0 !< sum of merged super droplets |
---|
| 126 | INTEGER(iwp) :: sum_new_particles = 0 !< sum of created particles (in splitting algorithm) |
---|
| 127 | INTEGER(iwp) :: total_number_of_particles !< total number of particles in the whole model domain |
---|
| 128 | INTEGER(iwp) :: trlp_count_sum !< parameter for particle exchange of PEs |
---|
| 129 | INTEGER(iwp) :: trlp_count_recv_sum !< parameter for particle exchange of PEs |
---|
| 130 | INTEGER(iwp) :: trrp_count_sum !< parameter for particle exchange of PEs |
---|
| 131 | INTEGER(iwp) :: trrp_count_recv_sum !< parameter for particle exchange of PEs |
---|
| 132 | INTEGER(iwp) :: trsp_count_sum !< parameter for particle exchange of PEs |
---|
| 133 | INTEGER(iwp) :: trsp_count_recv_sum !< parameter for particle exchange of PEs |
---|
| 134 | INTEGER(iwp) :: trnp_count_sum !< parameter for particle exchange of PEs |
---|
| 135 | INTEGER(iwp) :: trnp_count_recv_sum !< parameter for particle exchange of PEs |
---|
[1359] | 136 | |
---|
[2263] | 137 | INTEGER(iwp), PARAMETER :: max_number_of_particle_groups = 10 !< maximum allowed number of particle groups |
---|
[1359] | 138 | |
---|
[2263] | 139 | INTEGER(iwp), DIMENSION(:,:,:), ALLOCATABLE :: prt_count !< 3d array of number of particles of every grid box |
---|
[1359] | 140 | |
---|
[2263] | 141 | LOGICAL :: all_or_nothing = .FALSE. !< flag for collision algorithm |
---|
| 142 | LOGICAL :: average_impact = .FALSE. !< flag for collision algortihm |
---|
[2265] | 143 | LOGICAL :: curvature_solution_effects = .FALSE. !< namelist parameter (see documentation) |
---|
| 144 | LOGICAL :: deallocate_memory = .TRUE. !< namelist parameter (see documentation) |
---|
[2263] | 145 | LOGICAL :: hall_kernel = .FALSE. !< flag for collision kernel |
---|
[2265] | 146 | LOGICAL :: init_aerosol_probabilistic = .FALSE. !< namelist parameter (see documentation) |
---|
| 147 | LOGICAL :: merging = .FALSE. !< namelist parameter (see documentation) |
---|
| 148 | LOGICAL :: monodisperse_aerosols = .FALSE. !< namelist parameter (see documentation) |
---|
[2263] | 149 | LOGICAL :: particle_advection = .FALSE. !< parameter to steer the advection of particles |
---|
[2265] | 150 | LOGICAL :: random_start_position = .FALSE. !< namelist parameter (see documentation) |
---|
| 151 | LOGICAL :: read_particles_from_restartfile = .TRUE. !< namelist parameter (see documentation) |
---|
| 152 | LOGICAL :: seed_follows_topography = .FALSE. !< namelist parameter (see documentation) |
---|
| 153 | LOGICAL :: splitting = .FALSE. !< namelist parameter (see documentation) |
---|
[2263] | 154 | LOGICAL :: use_kernel_tables = .FALSE. !< parameter, which turns on the use of precalculated collision kernels |
---|
[2265] | 155 | LOGICAL :: use_sgs_for_particles = .FALSE. !< namelist parameter (see documentation) |
---|
[2263] | 156 | LOGICAL :: wang_kernel = .FALSE. !< flag for collision kernel |
---|
[2265] | 157 | LOGICAL :: write_particle_statistics = .FALSE. !< namelist parameter (see documentation) |
---|
[2263] | 158 | |
---|
[1359] | 159 | LOGICAL, DIMENSION(max_number_of_particle_groups) :: & |
---|
[2263] | 160 | vertical_particle_advection = .TRUE. !< Switch on/off vertical particle transport |
---|
[1359] | 161 | |
---|
[2265] | 162 | REAL(wp) :: alloc_factor = 20.0_wp !< namelist parameter (see documentation) |
---|
| 163 | REAL(wp) :: c_0 = 3.0_wp !< parameter for lagrangian timescale |
---|
| 164 | REAL(wp) :: dt_min_part = 0.0002_wp !< minimum particle time step when SGS velocities are used (s) |
---|
| 165 | REAL(wp) :: dt_prel = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 166 | REAL(wp) :: dt_write_particle_data = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 167 | REAL(wp) :: end_time_prel = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 168 | REAL(wp) :: initial_weighting_factor = 1.0_wp !< namelist parameter (see documentation) |
---|
| 169 | REAL(wp) :: molecular_weight_of_solute = 0.05844_wp !< mol. m. NaCl (kg mol-1) |
---|
| 170 | REAL(wp) :: molecular_weight_of_water = 0.01801528_wp !< mol. m. H2O (kg mol-1) |
---|
| 171 | REAL(wp) :: n1 = 100.0_wp !< namelist parameter (see documentation) |
---|
| 172 | REAL(wp) :: n2 = 0.0_wp !< namelist parameter (see documentation) |
---|
| 173 | REAL(wp) :: n3 = 0.0_wp !< namelist parameter (see documentation) |
---|
| 174 | REAL(wp) :: number_concentration = -1.0_wp !< namelist parameter (see documentation) |
---|
| 175 | REAL(wp) :: particle_advection_start = 0.0_wp !< namelist parameter (see documentation) |
---|
| 176 | REAL(wp) :: radius_merge = 1.0E-7_wp !< namelist parameter (see documentation) |
---|
| 177 | REAL(wp) :: radius_split = 40.0E-6_wp !< namelist parameter (see documentation) |
---|
| 178 | REAL(wp) :: rho_s = 2165.0_wp !< density of NaCl (kg m-3) |
---|
| 179 | REAL(wp) :: rm1 = 0.05E-6_wp !< namelist parameter (see documentation) |
---|
| 180 | REAL(wp) :: rm2 = 0.05E-6_wp !< namelist parameter (see documentation) |
---|
| 181 | REAL(wp) :: rm3 = 0.05E-6_wp !< namelist parameter (see documentation) |
---|
| 182 | REAL(wp) :: s1 = 2.0_wp !< namelist parameter (see documentation) |
---|
| 183 | REAL(wp) :: s2 = 2.0_wp !< namelist parameter (see documentation) |
---|
| 184 | REAL(wp) :: s3 = 2.0_wp !< namelist parameter (see documentation) |
---|
| 185 | REAL(wp) :: sgs_wf_part !< parameter for sgs |
---|
| 186 | REAL(wp) :: time_prel = 0.0_wp !< time for particle release |
---|
| 187 | REAL(wp) :: time_write_particle_data = 0.0_wp !< write particle data at current time on file |
---|
| 188 | REAL(wp) :: vanthoff = 2.0_wp !< van't Hoff factor for NaCl |
---|
| 189 | REAL(wp) :: weight_factor_merge = -1.0_wp !< namelist parameter (see documentation) |
---|
| 190 | REAL(wp) :: weight_factor_split = -1.0_wp !< namelist parameter (see documentation) |
---|
| 191 | REAL(wp) :: z0_av_global !< horizontal mean value of z0 |
---|
[1359] | 192 | |
---|
[2265] | 193 | REAL(wp), DIMENSION(max_number_of_particle_groups) :: density_ratio = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 194 | REAL(wp), DIMENSION(max_number_of_particle_groups) :: pdx = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 195 | REAL(wp), DIMENSION(max_number_of_particle_groups) :: pdy = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 196 | REAL(wp), DIMENSION(max_number_of_particle_groups) :: pdz = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 197 | REAL(wp), DIMENSION(max_number_of_particle_groups) :: psb = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 198 | REAL(wp), DIMENSION(max_number_of_particle_groups) :: psl = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 199 | REAL(wp), DIMENSION(max_number_of_particle_groups) :: psn = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 200 | REAL(wp), DIMENSION(max_number_of_particle_groups) :: psr = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 201 | REAL(wp), DIMENSION(max_number_of_particle_groups) :: pss = 9999999.9_wp !< namelist parameter (see documentation) |
---|
| 202 | REAL(wp), DIMENSION(max_number_of_particle_groups) :: pst = 9999999.9_wp !< namelist parameter (see documentation). |
---|
| 203 | REAL(wp), DIMENSION(max_number_of_particle_groups) :: radius = 9999999.9_wp !< namelist parameter (see documentation) |
---|
[1359] | 204 | |
---|
[2263] | 205 | REAL(wp), DIMENSION(:), ALLOCATABLE :: log_z_z0 !< Precalculate LOG(z/z0) |
---|
[1359] | 206 | |
---|
[2263] | 207 | |
---|
[1359] | 208 | TYPE particle_type |
---|
| 209 | SEQUENCE |
---|
[2265] | 210 | REAL(wp) :: radius !< radius of particle |
---|
| 211 | REAL(wp) :: age !< age of particle |
---|
| 212 | REAL(wp) :: age_m !< |
---|
| 213 | REAL(wp) :: dt_sum !< |
---|
| 214 | REAL(wp) :: user !< varible for user |
---|
| 215 | REAL(wp) :: e_m !< interpolated sgs tke |
---|
| 216 | REAL(wp) :: origin_x !< origin x-position of particle (changed cyclic bc) |
---|
| 217 | REAL(wp) :: origin_y !< origin y-position of particle (changed cyclic bc) |
---|
| 218 | REAL(wp) :: origin_z !< origin z-position of particle (changed cyclic bc) |
---|
| 219 | REAL(wp) :: rvar1 !< |
---|
| 220 | REAL(wp) :: rvar2 !< |
---|
| 221 | REAL(wp) :: rvar3 !< |
---|
| 222 | REAL(wp) :: speed_x !< speed of particle in x |
---|
| 223 | REAL(wp) :: speed_y !< speed of particle in y |
---|
| 224 | REAL(wp) :: speed_z !< speed of particle in z |
---|
| 225 | REAL(wp) :: weight_factor !< weighting factor |
---|
| 226 | REAL(wp) :: x !< x-position |
---|
| 227 | REAL(wp) :: y !< y-position |
---|
| 228 | REAL(wp) :: z !< z-position |
---|
| 229 | INTEGER(iwp) :: class !< radius class needed for collision |
---|
| 230 | INTEGER(iwp) :: group !< number of particle group |
---|
| 231 | INTEGER(iwp) :: id1 !< first part of particle id |
---|
| 232 | INTEGER(iwp) :: id2 !< second part of particle id |
---|
| 233 | LOGICAL :: particle_mask !< if this parameter is set to false the particle will be deleted |
---|
| 234 | INTEGER(iwp) :: block_nr !< number for sorting (removable?) |
---|
[1359] | 235 | END TYPE particle_type |
---|
| 236 | |
---|
[2265] | 237 | TYPE(particle_type), DIMENSION(:), POINTER :: particles !< Particle array for this grid cell |
---|
| 238 | TYPE(particle_type) :: zero_particle !< zero particle to avoid weird thinge |
---|
[1359] | 239 | |
---|
| 240 | TYPE particle_groups_type |
---|
| 241 | SEQUENCE |
---|
[2265] | 242 | REAL(wp) :: density_ratio !< density ratio of the fluid and the particles |
---|
| 243 | REAL(wp) :: radius !< radius of particle |
---|
| 244 | REAL(wp) :: exp_arg !< exponential term of particle inertia |
---|
| 245 | REAL(wp) :: exp_term !< exponential term of particle inertia |
---|
[1359] | 246 | END TYPE particle_groups_type |
---|
| 247 | |
---|
| 248 | TYPE(particle_groups_type), DIMENSION(max_number_of_particle_groups) :: & |
---|
| 249 | particle_groups |
---|
| 250 | |
---|
| 251 | TYPE grid_particle_def |
---|
[2265] | 252 | INTEGER(iwp), DIMENSION(0:7) :: start_index !< start particle index for current block |
---|
| 253 | INTEGER(iwp), DIMENSION(0:7) :: end_index !< end particle index for current block |
---|
| 254 | INTEGER(iwp) :: id_counter !< particle id counter (removeable?) |
---|
| 255 | LOGICAL :: time_loop_done !< timestep loop for particle advection |
---|
| 256 | TYPE(particle_type), POINTER, DIMENSION(:) :: particles !< Particle array for this grid cell |
---|
[1359] | 257 | END TYPE grid_particle_def |
---|
| 258 | |
---|
| 259 | TYPE(grid_particle_def), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: grid_particles |
---|
| 260 | |
---|
[2265] | 261 | TYPE block_offset_def !< |
---|
| 262 | INTEGER(iwp) :: i_off !< |
---|
| 263 | INTEGER(iwp) :: j_off !< |
---|
| 264 | INTEGER(iwp) :: k_off !< |
---|
[1359] | 265 | END TYPE block_offset_def |
---|
| 266 | |
---|
| 267 | TYPE(block_offset_def), DIMENSION(0:7) :: block_offset |
---|
| 268 | |
---|
| 269 | SAVE |
---|
| 270 | |
---|
| 271 | |
---|
| 272 | END MODULE particle_attributes |
---|
| 273 | |
---|