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