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-2019 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ------------------ |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: mod_particle_attributes.f90 4043 2019-06-18 16:59:00Z motisi $ |
---|
27 | ! Remove min_nr_particle |
---|
28 | ! |
---|
29 | ! 4017 2019-06-06 12:16:46Z schwenkel |
---|
30 | ! interoperable C datatypes introduced in particle type to avoid compiler warnings |
---|
31 | ! |
---|
32 | ! 3720 2019-02-06 13:19:55Z knoop |
---|
33 | ! time_prel replaced by last_particle_release_time |
---|
34 | ! |
---|
35 | ! 3405 2018-10-23 15:34:41Z raasch |
---|
36 | ! bugfix: BIND attribute added to derived type particle_type |
---|
37 | ! |
---|
38 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
39 | ! Corrected "Former revisions" section |
---|
40 | ! |
---|
41 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
42 | ! Change in file header (GPL part) |
---|
43 | ! |
---|
44 | ! 2375 2017-08-29 14:10:28Z schwenkel |
---|
45 | ! molecular_weight_of_solute, molecular_weight_of_water, vanthoff removed and |
---|
46 | ! added in modules. Parameters are also used in bulk-microphysics. |
---|
47 | ! |
---|
48 | ! 2312 2017-07-14 20:26:51Z hoffmann |
---|
49 | ! Aerosol initialization improved. |
---|
50 | ! |
---|
51 | ! 2305 2017-07-06 11:18:47Z hoffmann |
---|
52 | ! Improved calculation of particle IDs. |
---|
53 | ! |
---|
54 | ! 2278 2017-06-12 13:08:18Z schwenkel |
---|
55 | ! Added comments |
---|
56 | ! |
---|
57 | ! 2265 2017-06-08 16:58:28Z schwenkel |
---|
58 | ! Unused variables removed. |
---|
59 | ! |
---|
60 | ! 2263 2017-06-08 14:59:01Z schwenkel |
---|
61 | ! Implemented splitting and merging algorithm |
---|
62 | ! |
---|
63 | ! 2183 2017-03-17 14:29:15Z schwenkel |
---|
64 | ! |
---|
65 | ! 2182 2017-03-17 14:27:40Z schwenkel |
---|
66 | ! Added parameters for simplified particle initialization. |
---|
67 | ! |
---|
68 | ! 2122 2017-01-18 12:22:54Z hoffmann |
---|
69 | ! Calculation of particle ID |
---|
70 | ! Particle attribute dvrp_psize renamed to user: this attribute can be used by |
---|
71 | ! by the user to store any variable |
---|
72 | ! |
---|
73 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
74 | ! Forced header and separation lines into 80 columns |
---|
75 | ! |
---|
76 | ! 1936 2016-06-13 13:37:44Z suehring |
---|
77 | ! +deallocate_memory, step_dealloc |
---|
78 | ! |
---|
79 | ! 1929 2016-06-09 16:25:25Z suehring |
---|
80 | ! -sgs_wfu_par, sgs_wfv_par, sgs_wfw_par |
---|
81 | ! + sgs_wf_par |
---|
82 | ! |
---|
83 | ! 1871 2016-04-15 11:46:09Z hoffmann |
---|
84 | ! Initialization of aerosols added. |
---|
85 | ! |
---|
86 | ! 1849 2016-04-08 11:33:18Z hoffmann |
---|
87 | ! bfactor, mass_of_solute, molecular_weight_of_solute, molecular_weight_of_water, |
---|
88 | ! vanthoff added from modules |
---|
89 | ! |
---|
90 | ! 1831 2016-04-07 13:15:51Z hoffmann |
---|
91 | ! palm_kernel removed, curvature_solution_effects added |
---|
92 | ! |
---|
93 | ! 1822 2016-04-07 07:49:42Z hoffmann |
---|
94 | ! +collision_algorithm, all_or_nothing, average_impact |
---|
95 | ! Tails removed. |
---|
96 | ! |
---|
97 | ! 1727 2015-11-20 07:22:02Z knoop |
---|
98 | ! Bugfix: Cause of syntax warning gfortran preprocessor removed |
---|
99 | ! |
---|
100 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
101 | ! Code annotations made doxygen readable |
---|
102 | ! |
---|
103 | ! 1575 2015-03-27 09:56:27Z raasch |
---|
104 | ! +seed_follows_topography |
---|
105 | ! |
---|
106 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
107 | ! new module containing all particle related variables |
---|
108 | ! -dt_sort_particles |
---|
109 | ! |
---|
110 | ! Description: |
---|
111 | ! ------------ |
---|
112 | !> Definition of variables used to compute particle transport |
---|
113 | !------------------------------------------------------------------------------! |
---|
114 | MODULE particle_attributes |
---|
115 | |
---|
116 | USE, INTRINSIC :: ISO_C_BINDING |
---|
117 | |
---|
118 | USE kinds |
---|
119 | |
---|
120 | INTEGER(iwp) :: dissipation_classes = 10 !< namelist parameter (see documentation) |
---|
121 | INTEGER(iwp) :: ibc_par_b !< particle bottom boundary condition dummy |
---|
122 | INTEGER(iwp) :: ibc_par_lr !< particle left/right boundary condition dummy |
---|
123 | INTEGER(iwp) :: ibc_par_ns !< particle north/south boundary condition dummy |
---|
124 | INTEGER(iwp) :: ibc_par_t !< particle top boundary condition dummy |
---|
125 | INTEGER(iwp) :: number_of_particles = 0 !< number of particles for each grid box (3d array is saved on prt_count) |
---|
126 | INTEGER(iwp) :: number_of_particle_groups = 1 !< namelist parameter (see documentation) |
---|
127 | |
---|
128 | INTEGER(iwp), PARAMETER :: max_number_of_particle_groups = 10 !< maximum allowed number of particle groups |
---|
129 | |
---|
130 | INTEGER(iwp), DIMENSION(:,:,:), ALLOCATABLE :: prt_count !< 3d array of number of particles of every grid box |
---|
131 | |
---|
132 | LOGICAL :: particle_advection = .FALSE. !< parameter to steer the advection of particles |
---|
133 | LOGICAL :: use_sgs_for_particles = .FALSE. !< namelist parameter (see documentation) |
---|
134 | LOGICAL :: wang_kernel = .FALSE. !< flag for collision kernel |
---|
135 | |
---|
136 | REAL(wp) :: alloc_factor = 20.0_wp !< namelist parameter (see documentation) |
---|
137 | REAL(wp) :: particle_advection_start = 0.0_wp !< namelist parameter (see documentation) |
---|
138 | |
---|
139 | ! |
---|
140 | !-- WARNING: For compatibility of derived types, the BIND attribute is required, and interoperable C |
---|
141 | !-- datatypes must be used. These type are hard wired here! So changes in working precision (wp, iwp) |
---|
142 | !-- will not affect the particle_type! |
---|
143 | !-- The main reason for introducing the interoperable datatypes was to avoid compiler warnings of |
---|
144 | !-- the gfortran compiler. |
---|
145 | !-- The BIND attribite is required because of C_F_POINTER usage in the pmc particle interface. |
---|
146 | TYPE, BIND(C) :: particle_type |
---|
147 | REAL(C_DOUBLE) :: aux1 !< auxiliary multi-purpose feature |
---|
148 | REAL(C_DOUBLE) :: aux2 !< auxiliary multi-purpose feature |
---|
149 | REAL(C_DOUBLE) :: radius !< radius of particle |
---|
150 | REAL(C_DOUBLE) :: age !< age of particle |
---|
151 | REAL(C_DOUBLE) :: age_m !< |
---|
152 | REAL(C_DOUBLE) :: dt_sum !< |
---|
153 | REAL(C_DOUBLE) :: e_m !< interpolated sgs tke |
---|
154 | REAL(C_DOUBLE) :: origin_x !< origin x-position of particle (changed cyclic bc) |
---|
155 | REAL(C_DOUBLE) :: origin_y !< origin y-position of particle (changed cyclic bc) |
---|
156 | REAL(C_DOUBLE) :: origin_z !< origin z-position of particle (changed cyclic bc) |
---|
157 | REAL(C_DOUBLE) :: rvar1 !< |
---|
158 | REAL(C_DOUBLE) :: rvar2 !< |
---|
159 | REAL(C_DOUBLE) :: rvar3 !< |
---|
160 | REAL(C_DOUBLE) :: speed_x !< speed of particle in x |
---|
161 | REAL(C_DOUBLE) :: speed_y !< speed of particle in y |
---|
162 | REAL(C_DOUBLE) :: speed_z !< speed of particle in z |
---|
163 | REAL(C_DOUBLE) :: weight_factor !< weighting factor |
---|
164 | REAL(C_DOUBLE) :: x !< x-position |
---|
165 | REAL(C_DOUBLE) :: y !< y-position |
---|
166 | REAL(C_DOUBLE) :: z !< z-position |
---|
167 | INTEGER(C_INT) :: class !< radius class needed for collision |
---|
168 | INTEGER(C_INT) :: group !< number of particle group |
---|
169 | INTEGER(C_LONG_LONG) :: id !< particle ID (64 bit integer) |
---|
170 | LOGICAL(C_BOOL) :: particle_mask !< if this parameter is set to false the particle will be deleted |
---|
171 | INTEGER(C_INT) :: block_nr !< number for sorting (removable?) |
---|
172 | END TYPE particle_type |
---|
173 | |
---|
174 | TYPE(particle_type), DIMENSION(:), POINTER :: particles !< Particle array for this grid cell |
---|
175 | TYPE(particle_type) :: zero_particle !< zero particle to avoid weird thinge |
---|
176 | |
---|
177 | TYPE particle_groups_type |
---|
178 | SEQUENCE |
---|
179 | REAL(wp) :: density_ratio !< density ratio of the fluid and the particles |
---|
180 | REAL(wp) :: radius !< radius of particle |
---|
181 | REAL(wp) :: exp_arg !< exponential term of particle inertia |
---|
182 | REAL(wp) :: exp_term !< exponential term of particle inertia |
---|
183 | END TYPE particle_groups_type |
---|
184 | |
---|
185 | TYPE(particle_groups_type), DIMENSION(max_number_of_particle_groups) :: & |
---|
186 | particle_groups |
---|
187 | |
---|
188 | TYPE grid_particle_def |
---|
189 | INTEGER(iwp), DIMENSION(0:7) :: start_index !< start particle index for current block |
---|
190 | INTEGER(iwp), DIMENSION(0:7) :: end_index !< end particle index for current block |
---|
191 | INTEGER(iwp) :: id_counter !< particle id counter |
---|
192 | LOGICAL :: time_loop_done !< timestep loop for particle advection |
---|
193 | TYPE(particle_type), POINTER, DIMENSION(:) :: particles !< Particle array for this grid cell |
---|
194 | END TYPE grid_particle_def |
---|
195 | |
---|
196 | TYPE(grid_particle_def), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: grid_particles |
---|
197 | |
---|
198 | TYPE block_offset_def !< |
---|
199 | INTEGER(iwp) :: i_off !< |
---|
200 | INTEGER(iwp) :: j_off !< |
---|
201 | INTEGER(iwp) :: k_off !< |
---|
202 | END TYPE block_offset_def |
---|
203 | |
---|
204 | TYPE(block_offset_def), DIMENSION(0:7) :: block_offset |
---|
205 | |
---|
206 | SAVE |
---|
207 | |
---|
208 | |
---|
209 | END MODULE particle_attributes |
---|