1 | !> @file package_parin.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: package_parin.f90 3655 2019-01-07 16:51:22Z monakurppa $ |
---|
27 | ! Minor formating changes |
---|
28 | ! |
---|
29 | ! 3246 2018-09-13 15:14:50Z sward |
---|
30 | ! Added error handling for input namelist via parin_fail_message |
---|
31 | ! |
---|
32 | ! 3241 2018-09-12 15:02:00Z raasch |
---|
33 | ! unused variables removed |
---|
34 | ! |
---|
35 | ! 3049 2018-05-29 13:52:36Z Giersch |
---|
36 | ! Error messages revised |
---|
37 | ! |
---|
38 | ! 2932 2018-03-26 09:39:22Z Giersch |
---|
39 | ! renamed particles_par to particle_parameters |
---|
40 | ! |
---|
41 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
42 | ! Corrected "Former revisions" section |
---|
43 | ! |
---|
44 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
45 | ! Change in file header (GPL part) |
---|
46 | ! |
---|
47 | ! 2375 2017-08-29 14:10:28Z schwenkel |
---|
48 | ! Added aerosol_species |
---|
49 | ! |
---|
50 | ! 2312 2017-07-14 20:26:51Z hoffmann |
---|
51 | ! Aerosol initialization improved. |
---|
52 | ! |
---|
53 | ! 2263 2017-06-08 14:59:01Z schwenkel |
---|
54 | ! Implemented splitting and merging algorithm |
---|
55 | ! |
---|
56 | ! 2183 2017-03-17 14:29:15Z schwenkel |
---|
57 | ! |
---|
58 | ! 2182 2017-03-17 14:27:40Z schwenkel |
---|
59 | ! Added parameters for simplified particle initialization. |
---|
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 | ! 1871 2016-04-15 11:46:09Z hoffmann |
---|
68 | ! Initialization of aerosols added. |
---|
69 | ! |
---|
70 | ! 1833 2016-04-07 14:23:03Z raasch |
---|
71 | ! reading of spectra_par moved to spectra_mod |
---|
72 | ! |
---|
73 | ! 1831 2016-04-07 13:15:51Z hoffmann |
---|
74 | ! curvature_solution_effects added |
---|
75 | ! |
---|
76 | ! 1826 2016-04-07 12:01:39Z maronga |
---|
77 | ! Reading of &radiation_par moved to radiation_model_mod. |
---|
78 | ! Reading of &canopy_par moved to plant_canopy_model_mod. |
---|
79 | ! |
---|
80 | ! 822 2016-04-07 07:49:42Z hoffmann |
---|
81 | ! +collision_algorithm |
---|
82 | ! Tails removed. |
---|
83 | ! |
---|
84 | ! 1817 2016-04-06 15:44:20Z maronga |
---|
85 | ! Reading of &lsm_par moved to land_surface_model_mod. |
---|
86 | ! |
---|
87 | ! 1788 2016-03-10 11:01:04Z maronga |
---|
88 | ! Parameter dewfall removed. |
---|
89 | ! |
---|
90 | ! 1786 2016-03-08 05:49:27Z raasch |
---|
91 | ! cpp-direktives for spectra removed |
---|
92 | ! |
---|
93 | ! 1757 2016-02-22 15:49:32Z maronga |
---|
94 | ! Added parameter unscheduled_radiation_calls |
---|
95 | ! |
---|
96 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
97 | ! Added skip_time_do_lsm, skip_time_do_radiation, and emissivity |
---|
98 | ! |
---|
99 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
100 | ! Code annotations made doxygen readable |
---|
101 | ! |
---|
102 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
103 | ! Added several radiation_par parameters |
---|
104 | ! |
---|
105 | ! 1575 2015-03-27 09:56:27Z raasch |
---|
106 | ! +seed_follows_topography in particles_par |
---|
107 | ! |
---|
108 | ! 1553 2015-03-03 17:33:54Z maronga |
---|
109 | ! Resorting of lsm_par |
---|
110 | ! |
---|
111 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
112 | ! Several changes in the liste for land surface model and radiation model |
---|
113 | ! |
---|
114 | ! 1496 2014-12-02 17:25:50Z maronga |
---|
115 | ! Added support for the land surface model and radiation scheme |
---|
116 | ! |
---|
117 | ! 1484 2014-10-21 10:53:05Z kanani |
---|
118 | ! Changes due to new module structure of the plant canopy model: |
---|
119 | ! module plant_canopy_model_mod added, |
---|
120 | ! new package/namelist canopy_par added, i.e. the canopy model is no longer |
---|
121 | ! steered over the inipar-namelist, |
---|
122 | ! drag_coefficient, leaf_surface_concentration and scalar_exchange_coefficient |
---|
123 | ! renamed to canopy_drag_coeff, leaf_surface_conc and leaf_scalar_exch_coeff. |
---|
124 | ! Changed statement tags in CONTINUE-statement |
---|
125 | ! |
---|
126 | ! 1367 2014-04-23 15:18:30Z witha |
---|
127 | ! Bugfix: module kinds must be used |
---|
128 | ! |
---|
129 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
130 | ! +alloc_factor, + min_nr_particle |
---|
131 | ! -dt_sort_particles, -maximum_number_of_particles |
---|
132 | ! |
---|
133 | ! 1340 2014-03-25 19:45:13Z kanani |
---|
134 | ! REAL constants defined as wp-kinds |
---|
135 | ! |
---|
136 | ! 1324 2014-03-21 09:13:16Z suehring |
---|
137 | ! Bugfix: Missing variable dt_data_output output added to ONLY statement |
---|
138 | ! |
---|
139 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
140 | ! ONLY-attribute added to USE-statements, |
---|
141 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
142 | ! kinds are defined in new module kinds, |
---|
143 | ! old module precision_kind is removed, |
---|
144 | ! revision history before 2012 removed, |
---|
145 | ! comment fields (!:) to be used for variable explanations added to |
---|
146 | ! all variable declaration statements |
---|
147 | ! |
---|
148 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
149 | ! code put under GPL (PALM 3.9) |
---|
150 | ! |
---|
151 | ! 828 2012-02-21 12:00:36Z raasch |
---|
152 | ! +dissipation_classes, radius_classes in parpar |
---|
153 | ! |
---|
154 | ! 825 2012-02-19 03:03:44Z raasch |
---|
155 | ! wang_collision_kernel and turbulence_effects_on_collision in particles_par |
---|
156 | ! replaced by collision_kernel |
---|
157 | ! |
---|
158 | ! Revision 1.1 2000/12/28 13:21:57 raasch |
---|
159 | ! Initial revision |
---|
160 | ! |
---|
161 | ! |
---|
162 | ! Description: |
---|
163 | ! ------------ |
---|
164 | !> This subroutine reads from the NAMELIST file variables controling model |
---|
165 | !> software packages which are used optionally in the run. |
---|
166 | !> |
---|
167 | !> @todo Perform all actions in the respective submodules and remove |
---|
168 | !> package_parin |
---|
169 | !------------------------------------------------------------------------------! |
---|
170 | SUBROUTINE package_parin |
---|
171 | |
---|
172 | |
---|
173 | USE control_parameters, & |
---|
174 | ONLY: dt_dopts, dt_dvrp, message_string, particle_maximum_age, & |
---|
175 | threshold |
---|
176 | |
---|
177 | USE dvrp_variables, & |
---|
178 | ONLY: clip_dvrp_l, clip_dvrp_n, clip_dvrp_r, clip_dvrp_s, & |
---|
179 | cluster_size, color_interval, dvrpsize_interval, & |
---|
180 | dvrp_directory, dvrp_file, dvrp_host, dvrp_output, & |
---|
181 | dvrp_password, dvrp_username, groundplate_color, & |
---|
182 | isosurface_color, mode_dvrp, particle_color, & |
---|
183 | particle_dvrpsize, pathlines_fadeintime, & |
---|
184 | pathlines_fadeouttime, pathlines_linecount, & |
---|
185 | pathlines_maxhistory, pathlines_wavecount, & |
---|
186 | pathlines_wavetime, slicer_range_limits_dvrp, superelevation, & |
---|
187 | superelevation_x, superelevation_y, topography_color, & |
---|
188 | vc_alpha, vc_gradient_normals, vc_mode, vc_size_x, vc_size_y, & |
---|
189 | vc_size_z |
---|
190 | |
---|
191 | USE kinds |
---|
192 | |
---|
193 | USE particle_attributes, & |
---|
194 | ONLY: aero_species, aero_type, aero_weight, alloc_factor, bc_par_b, & |
---|
195 | bc_par_lr, bc_par_ns, bc_par_t, collision_kernel, & |
---|
196 | curvature_solution_effects, deallocate_memory, density_ratio, & |
---|
197 | dissipation_classes, dt_min_part, dt_prel, & |
---|
198 | dt_write_particle_data, end_time_prel, initial_weighting_factor,& |
---|
199 | log_sigma, max_number_particles_per_gridbox, & |
---|
200 | merging, min_nr_particle, na, & |
---|
201 | number_concentration, number_of_particle_groups, & |
---|
202 | number_particles_per_gridbox, particles_per_point, & |
---|
203 | particle_advection, particle_advection_start, pdx, pdy, pdz, & |
---|
204 | psb, psl, psn, psr, pss, pst, radius, radius_classes, & |
---|
205 | radius_merge, radius_split, random_start_position, & |
---|
206 | read_particles_from_restartfile, rm, & |
---|
207 | seed_follows_topography, splitting, splitting_factor, & |
---|
208 | splitting_factor_max, splitting_function, splitting_mode, & |
---|
209 | step_dealloc, use_sgs_for_particles, & |
---|
210 | vertical_particle_advection, weight_factor_merge, & |
---|
211 | weight_factor_split, write_particle_statistics |
---|
212 | |
---|
213 | IMPLICIT NONE |
---|
214 | |
---|
215 | CHARACTER (LEN=80) :: line !< |
---|
216 | |
---|
217 | |
---|
218 | |
---|
219 | NAMELIST /dvrp_graphics_par/ clip_dvrp_l, clip_dvrp_n, clip_dvrp_r, & |
---|
220 | clip_dvrp_s, cluster_size, color_interval, & |
---|
221 | dt_dvrp, dvrpsize_interval, dvrp_directory, & |
---|
222 | dvrp_file, dvrp_host, dvrp_output, & |
---|
223 | dvrp_password, dvrp_username, & |
---|
224 | groundplate_color, isosurface_color, & |
---|
225 | mode_dvrp, particle_color, particle_dvrpsize,& |
---|
226 | pathlines_fadeintime, pathlines_fadeouttime, & |
---|
227 | pathlines_linecount, pathlines_maxhistory, & |
---|
228 | pathlines_wavecount, pathlines_wavetime, & |
---|
229 | slicer_range_limits_dvrp, superelevation, & |
---|
230 | superelevation_x, superelevation_y, & |
---|
231 | threshold, topography_color, vc_alpha, & |
---|
232 | vc_gradient_normals, vc_mode, vc_size_x, & |
---|
233 | vc_size_y, vc_size_z |
---|
234 | |
---|
235 | NAMELIST /particles_par/ aero_species, aero_type, aero_weight, & |
---|
236 | alloc_factor, bc_par_b, bc_par_lr, & |
---|
237 | bc_par_ns, bc_par_t, & |
---|
238 | collision_kernel, curvature_solution_effects,& |
---|
239 | deallocate_memory, density_ratio, & |
---|
240 | dissipation_classes, dt_dopts, & |
---|
241 | dt_min_part, dt_prel, & |
---|
242 | dt_write_particle_data, & |
---|
243 | end_time_prel, initial_weighting_factor, & |
---|
244 | log_sigma, & |
---|
245 | max_number_particles_per_gridbox, merging, & |
---|
246 | min_nr_particle, & |
---|
247 | na, number_concentration, & |
---|
248 | number_of_particle_groups, & |
---|
249 | number_particles_per_gridbox, & |
---|
250 | particles_per_point, & |
---|
251 | particle_advection_start, & |
---|
252 | particle_maximum_age, pdx, pdy, pdz, psb, & |
---|
253 | psl, psn, psr, pss, pst, radius, & |
---|
254 | radius_classes, radius_merge, radius_split, & |
---|
255 | random_start_position, & |
---|
256 | read_particles_from_restartfile, rm, & |
---|
257 | seed_follows_topography, & |
---|
258 | splitting, splitting_factor, & |
---|
259 | splitting_factor_max, splitting_function, & |
---|
260 | splitting_mode, step_dealloc, & |
---|
261 | use_sgs_for_particles, & |
---|
262 | vertical_particle_advection, & |
---|
263 | weight_factor_merge, weight_factor_split, & |
---|
264 | write_particle_statistics |
---|
265 | |
---|
266 | |
---|
267 | NAMELIST /particle_parameters/ & |
---|
268 | aero_species, aero_type, aero_weight, & |
---|
269 | alloc_factor, bc_par_b, bc_par_lr, & |
---|
270 | bc_par_ns, bc_par_t, & |
---|
271 | collision_kernel, curvature_solution_effects,& |
---|
272 | deallocate_memory, density_ratio, & |
---|
273 | dissipation_classes, dt_dopts, & |
---|
274 | dt_min_part, dt_prel, & |
---|
275 | dt_write_particle_data, & |
---|
276 | end_time_prel, initial_weighting_factor, & |
---|
277 | log_sigma, & |
---|
278 | max_number_particles_per_gridbox, merging, & |
---|
279 | min_nr_particle, & |
---|
280 | na, number_concentration, & |
---|
281 | number_of_particle_groups, & |
---|
282 | number_particles_per_gridbox, & |
---|
283 | particles_per_point, & |
---|
284 | particle_advection_start, & |
---|
285 | particle_maximum_age, pdx, pdy, pdz, psb, & |
---|
286 | psl, psn, psr, pss, pst, radius, & |
---|
287 | radius_classes, radius_merge, radius_split, & |
---|
288 | random_start_position, & |
---|
289 | read_particles_from_restartfile, rm, & |
---|
290 | seed_follows_topography, & |
---|
291 | splitting, splitting_factor, & |
---|
292 | splitting_factor_max, splitting_function, & |
---|
293 | splitting_mode, step_dealloc, & |
---|
294 | use_sgs_for_particles, & |
---|
295 | vertical_particle_advection, & |
---|
296 | weight_factor_merge, weight_factor_split, & |
---|
297 | write_particle_statistics |
---|
298 | ! |
---|
299 | !-- Position the namelist-file at the beginning (it was already opened in |
---|
300 | !-- parin), search for the namelist-group of the package and position the |
---|
301 | !-- file at this line. Do the same for each optionally used package. |
---|
302 | line = ' ' |
---|
303 | |
---|
304 | |
---|
305 | #if defined( __dvrp_graphics ) |
---|
306 | REWIND ( 11 ) |
---|
307 | line = ' ' |
---|
308 | DO WHILE ( INDEX( line, '&dvrp_graphics_par' ) == 0 ) |
---|
309 | READ ( 11, '(A)', END=21 ) line |
---|
310 | ENDDO |
---|
311 | BACKSPACE ( 11 ) |
---|
312 | |
---|
313 | ! |
---|
314 | !-- Read user-defined namelist |
---|
315 | READ ( 11, dvrp_graphics_par, ERR = 20 ) |
---|
316 | |
---|
317 | GOTO 21 |
---|
318 | 20 BACKSPACE( 11 ) |
---|
319 | READ( 11 ,fmt='(A)') line |
---|
320 | CALL parin_fail_message( 'dvrp_graphics_par', line ) |
---|
321 | |
---|
322 | 21 CONTINUE |
---|
323 | #endif |
---|
324 | |
---|
325 | ! |
---|
326 | !-- Try to find particles package |
---|
327 | REWIND ( 11 ) |
---|
328 | line = ' ' |
---|
329 | DO WHILE ( INDEX( line, '&particle_parameters' ) == 0 ) |
---|
330 | READ ( 11, '(A)', END=12 ) line |
---|
331 | ENDDO |
---|
332 | BACKSPACE ( 11 ) |
---|
333 | |
---|
334 | ! |
---|
335 | !-- Read user-defined namelist |
---|
336 | READ ( 11, particle_parameters, ERR = 10 ) |
---|
337 | |
---|
338 | ! |
---|
339 | !-- Set flag that indicates that particles are switched on |
---|
340 | particle_advection = .TRUE. |
---|
341 | |
---|
342 | GOTO 14 |
---|
343 | |
---|
344 | 10 BACKSPACE( 11 ) |
---|
345 | READ( 11 , '(A)') line |
---|
346 | CALL parin_fail_message( 'particle_parameters', line ) |
---|
347 | |
---|
348 | ! |
---|
349 | !-- Try to find particles package (old namelist) |
---|
350 | 12 REWIND ( 11 ) |
---|
351 | line = ' ' |
---|
352 | DO WHILE ( INDEX( line, '&particles_par' ) == 0 ) |
---|
353 | READ ( 11, '(A)', END=14 ) line |
---|
354 | ENDDO |
---|
355 | BACKSPACE ( 11 ) |
---|
356 | |
---|
357 | ! |
---|
358 | !-- Read user-defined namelist |
---|
359 | READ ( 11, particles_par, ERR = 13, END = 14 ) |
---|
360 | |
---|
361 | |
---|
362 | message_string = 'namelist particles_par is deprecated and will be ' // & |
---|
363 | 'removed in near future. Please use namelist ' // & |
---|
364 | 'particle_parameters instead' |
---|
365 | CALL message( 'package_parin', 'PA0487', 0, 1, 0, 6, 0 ) |
---|
366 | |
---|
367 | ! |
---|
368 | !-- Set flag that indicates that particles are switched on |
---|
369 | particle_advection = .TRUE. |
---|
370 | |
---|
371 | GOTO 14 |
---|
372 | |
---|
373 | 13 BACKSPACE( 11 ) |
---|
374 | READ( 11 , '(A)') line |
---|
375 | CALL parin_fail_message( 'particles_par', line ) |
---|
376 | |
---|
377 | 14 CONTINUE |
---|
378 | |
---|
379 | END SUBROUTINE package_parin |
---|