1 | !> @file package_parin.f90 |
---|
2 | !--------------------------------------------------------------------------------! |
---|
3 | ! This file is part of PALM. |
---|
4 | ! |
---|
5 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
6 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
7 | ! either version 3 of the License, or (at your option) any later version. |
---|
8 | ! |
---|
9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
10 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
11 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
12 | ! |
---|
13 | ! You should have received a copy of the GNU General Public License along with |
---|
14 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
15 | ! |
---|
16 | ! Copyright 1997-2015 Leibniz Universitaet Hannover |
---|
17 | !--------------------------------------------------------------------------------! |
---|
18 | ! |
---|
19 | ! Current revisions: |
---|
20 | ! ----------------- |
---|
21 | ! |
---|
22 | ! |
---|
23 | ! Former revisions: |
---|
24 | ! ----------------- |
---|
25 | ! $Id: package_parin.f90 1787 2016-03-08 06:57:00Z raasch $ |
---|
26 | ! |
---|
27 | ! 1786 2016-03-08 05:49:27Z raasch |
---|
28 | ! cpp-direktives for spectra removed |
---|
29 | ! |
---|
30 | ! 1757 2016-02-22 15:49:32Z maronga |
---|
31 | ! Added parameter unscheduled_radiation_calls |
---|
32 | ! |
---|
33 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
34 | ! Added skip_time_do_lsm, skip_time_do_radiation, and emissivity |
---|
35 | ! |
---|
36 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
37 | ! Code annotations made doxygen readable |
---|
38 | ! |
---|
39 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
40 | ! Added several radiation_par parameters |
---|
41 | ! |
---|
42 | ! 1575 2015-03-27 09:56:27Z raasch |
---|
43 | ! +seed_follows_topography in particles_par |
---|
44 | ! |
---|
45 | ! 1553 2015-03-03 17:33:54Z maronga |
---|
46 | ! Resorting of lsm_par |
---|
47 | ! |
---|
48 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
49 | ! Several changes in the liste for land surface model and radiation model |
---|
50 | ! |
---|
51 | ! 1496 2014-12-02 17:25:50Z maronga |
---|
52 | ! Added support for the land surface model and radiation scheme |
---|
53 | ! |
---|
54 | ! 1484 2014-10-21 10:53:05Z kanani |
---|
55 | ! Changes due to new module structure of the plant canopy model: |
---|
56 | ! module plant_canopy_model_mod added, |
---|
57 | ! new package/namelist canopy_par added, i.e. the canopy model is no longer |
---|
58 | ! steered over the inipar-namelist, |
---|
59 | ! drag_coefficient, leaf_surface_concentration and scalar_exchange_coefficient |
---|
60 | ! renamed to canopy_drag_coeff, leaf_surface_conc and leaf_scalar_exch_coeff. |
---|
61 | ! Changed statement tags in CONTINUE-statement |
---|
62 | ! |
---|
63 | ! 1367 2014-04-23 15:18:30Z witha |
---|
64 | ! Bugfix: module kinds must be used |
---|
65 | ! |
---|
66 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
67 | ! +alloc_factor, + min_nr_particle |
---|
68 | ! -dt_sort_particles, -maximum_number_of_particles |
---|
69 | ! |
---|
70 | ! 1340 2014-03-25 19:45:13Z kanani |
---|
71 | ! REAL constants defined as wp-kinds |
---|
72 | ! |
---|
73 | ! 1324 2014-03-21 09:13:16Z suehring |
---|
74 | ! Bugfix: Missing variable dt_data_output output added to ONLY statement |
---|
75 | ! |
---|
76 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
77 | ! ONLY-attribute added to USE-statements, |
---|
78 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
79 | ! kinds are defined in new module kinds, |
---|
80 | ! old module precision_kind is removed, |
---|
81 | ! revision history before 2012 removed, |
---|
82 | ! comment fields (!:) to be used for variable explanations added to |
---|
83 | ! all variable declaration statements |
---|
84 | ! |
---|
85 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
86 | ! code put under GPL (PALM 3.9) |
---|
87 | ! |
---|
88 | ! 828 2012-02-21 12:00:36Z raasch |
---|
89 | ! +dissipation_classes, radius_classes in parpar |
---|
90 | ! |
---|
91 | ! 825 2012-02-19 03:03:44Z raasch |
---|
92 | ! wang_collision_kernel and turbulence_effects_on_collision in particles_par |
---|
93 | ! replaced by collision_kernel |
---|
94 | ! |
---|
95 | ! Revision 1.1 2000/12/28 13:21:57 raasch |
---|
96 | ! Initial revision |
---|
97 | ! |
---|
98 | ! |
---|
99 | ! Description: |
---|
100 | ! ------------ |
---|
101 | !> This subroutine reads from the NAMELIST file variables controling model |
---|
102 | !> software packages which are used optionally in the run. |
---|
103 | !> |
---|
104 | !> @todo Perform all actions in the respective submodules and remove |
---|
105 | !> package_parin |
---|
106 | !------------------------------------------------------------------------------! |
---|
107 | SUBROUTINE package_parin |
---|
108 | |
---|
109 | |
---|
110 | USE control_parameters, & |
---|
111 | ONLY: averaging_interval_sp, dt_data_output, dt_dopts, dt_dosp, & |
---|
112 | dt_dvrp, particle_maximum_age, skip_time_dosp, & |
---|
113 | threshold |
---|
114 | |
---|
115 | USE dvrp_variables, & |
---|
116 | ONLY: clip_dvrp_l, clip_dvrp_n, clip_dvrp_r, clip_dvrp_s, & |
---|
117 | cluster_size, color_interval, dvrpsize_interval, & |
---|
118 | dvrp_directory, dvrp_file, dvrp_host, dvrp_output, & |
---|
119 | dvrp_password, dvrp_username, groundplate_color, & |
---|
120 | isosurface_color, mode_dvrp, particle_color, & |
---|
121 | particle_dvrpsize, pathlines_fadeintime, & |
---|
122 | pathlines_fadeouttime, pathlines_linecount, & |
---|
123 | pathlines_maxhistory, pathlines_wavecount, & |
---|
124 | pathlines_wavetime, slicer_range_limits_dvrp, superelevation, & |
---|
125 | superelevation_x, superelevation_y, topography_color, & |
---|
126 | vc_alpha, vc_gradient_normals, vc_mode, vc_size_x, vc_size_y, & |
---|
127 | vc_size_z |
---|
128 | |
---|
129 | USE land_surface_model_mod, & |
---|
130 | ONLY: alpha_vangenuchten, c_surface, canopy_resistance_coefficient, & |
---|
131 | conserve_water_content, dewfall, field_capacity, & |
---|
132 | f_shortwave_incoming, hydraulic_conductivity, & |
---|
133 | lambda_surface_stable, lambda_surface_unstable, leaf_area_index, & |
---|
134 | land_surface, l_vangenuchten, min_canopy_resistance, & |
---|
135 | min_soil_resistance, n_vangenuchten, residual_moisture, & |
---|
136 | root_fraction, saturation_moisture, wilting_point, & |
---|
137 | skip_time_do_lsm, soil_moisture, soil_temperature, soil_type, & |
---|
138 | vegetation_coverage, veg_type, zs, z0_eb, z0h_eb |
---|
139 | |
---|
140 | USE kinds |
---|
141 | |
---|
142 | USE particle_attributes, & |
---|
143 | ONLY: alloc_factor, bc_par_b, bc_par_lr, bc_par_ns, bc_par_t, & |
---|
144 | collision_kernel, density_ratio, dissipation_classes, & |
---|
145 | dt_min_part, dt_prel, dt_write_particle_data, dvrp_psize, & |
---|
146 | end_time_prel, initial_weighting_factor, & |
---|
147 | maximum_number_of_tailpoints, & |
---|
148 | maximum_tailpoint_age, minimum_tailpoint_distance, & |
---|
149 | min_nr_particle, number_of_particle_groups, particles_per_point,& |
---|
150 | particle_advection, particle_advection_start, pdx, pdy, pdz, & |
---|
151 | psb, psl, psn, psr, pss, pst, radius, radius_classes, & |
---|
152 | random_start_position, read_particles_from_restartfile, & |
---|
153 | seed_follows_topography, skip_particles_for_tail, & |
---|
154 | use_particle_tails, use_sgs_for_particles, & |
---|
155 | vertical_particle_advection, write_particle_statistics |
---|
156 | |
---|
157 | USE plant_canopy_model_mod, & |
---|
158 | ONLY: alpha_lad, beta_lad, calc_beta_lad_profile, canopy_drag_coeff, & |
---|
159 | canopy_mode, cthf, lad_surface, & |
---|
160 | lad_vertical_gradient, lad_vertical_gradient_level, lai_beta, & |
---|
161 | leaf_scalar_exch_coeff, leaf_surface_conc, pch_index, & |
---|
162 | plant_canopy |
---|
163 | |
---|
164 | USE radiation_model_mod, & |
---|
165 | ONLY: albedo, albedo_type, albedo_lw_dif, albedo_lw_dir, albedo_sw_dif,& |
---|
166 | albedo_sw_dir, constant_albedo, day_init, dt_radiation, & |
---|
167 | emissivity, lambda, lw_radiation, net_radiation, radiation, & |
---|
168 | radiation_scheme, skip_time_do_radiation, sw_radiation, & |
---|
169 | time_utc_init, unscheduled_radiation_calls |
---|
170 | |
---|
171 | |
---|
172 | USE spectrum, & |
---|
173 | ONLY: comp_spectra_level, data_output_sp, plot_spectra_level, & |
---|
174 | spectra_direction |
---|
175 | |
---|
176 | IMPLICIT NONE |
---|
177 | |
---|
178 | CHARACTER (LEN=80) :: line !< |
---|
179 | |
---|
180 | NAMELIST /canopy_par/ alpha_lad, beta_lad, canopy_drag_coeff, & |
---|
181 | canopy_mode, cthf, & |
---|
182 | lad_surface, & |
---|
183 | lad_vertical_gradient, & |
---|
184 | lad_vertical_gradient_level, & |
---|
185 | lai_beta, & |
---|
186 | leaf_scalar_exch_coeff, & |
---|
187 | leaf_surface_conc, pch_index |
---|
188 | |
---|
189 | NAMELIST /dvrp_graphics_par/ clip_dvrp_l, clip_dvrp_n, clip_dvrp_r, & |
---|
190 | clip_dvrp_s, cluster_size, color_interval, & |
---|
191 | dt_dvrp, dvrpsize_interval, dvrp_directory, & |
---|
192 | dvrp_file, dvrp_host, dvrp_output, & |
---|
193 | dvrp_password, dvrp_psize, dvrp_username, & |
---|
194 | groundplate_color, isosurface_color, & |
---|
195 | mode_dvrp, particle_color, particle_dvrpsize,& |
---|
196 | pathlines_fadeintime, pathlines_fadeouttime, & |
---|
197 | pathlines_linecount, pathlines_maxhistory, & |
---|
198 | pathlines_wavecount, pathlines_wavetime, & |
---|
199 | slicer_range_limits_dvrp, superelevation, & |
---|
200 | superelevation_x, superelevation_y, & |
---|
201 | threshold, topography_color, vc_alpha, & |
---|
202 | vc_gradient_normals, vc_mode, vc_size_x, & |
---|
203 | vc_size_y, vc_size_z |
---|
204 | |
---|
205 | NAMELIST /lsm_par/ alpha_vangenuchten, c_surface, & |
---|
206 | canopy_resistance_coefficient, & |
---|
207 | conserve_water_content, dewfall, & |
---|
208 | f_shortwave_incoming, field_capacity, & |
---|
209 | hydraulic_conductivity, & |
---|
210 | lambda_surface_stable, & |
---|
211 | lambda_surface_unstable, leaf_area_index, & |
---|
212 | l_vangenuchten, min_canopy_resistance, & |
---|
213 | min_soil_resistance, n_vangenuchten, & |
---|
214 | residual_moisture, root_fraction, & |
---|
215 | saturation_moisture, skip_time_do_lsm, & |
---|
216 | soil_moisture, soil_temperature, soil_type, & |
---|
217 | vegetation_coverage, veg_type, wilting_point,& |
---|
218 | zs, z0_eb, z0h_eb |
---|
219 | |
---|
220 | |
---|
221 | |
---|
222 | NAMELIST /particles_par/ alloc_factor, bc_par_b, bc_par_lr, & |
---|
223 | bc_par_ns, bc_par_t, collision_kernel, & |
---|
224 | density_ratio, dissipation_classes, dt_dopts,& |
---|
225 | dt_min_part, dt_prel, & |
---|
226 | dt_write_particle_data, & |
---|
227 | end_time_prel, initial_weighting_factor, & |
---|
228 | maximum_number_of_tailpoints, & |
---|
229 | maximum_tailpoint_age, & |
---|
230 | minimum_tailpoint_distance, & |
---|
231 | min_nr_particle, & |
---|
232 | number_of_particle_groups, & |
---|
233 | particles_per_point, & |
---|
234 | particle_advection_start, & |
---|
235 | particle_maximum_age, pdx, pdy, pdz, psb, & |
---|
236 | psl, psn, psr, pss, pst, radius, & |
---|
237 | radius_classes, random_start_position, & |
---|
238 | read_particles_from_restartfile, & |
---|
239 | seed_follows_topography, & |
---|
240 | skip_particles_for_tail, & |
---|
241 | use_particle_tails, use_sgs_for_particles, & |
---|
242 | vertical_particle_advection, & |
---|
243 | write_particle_statistics |
---|
244 | |
---|
245 | NAMELIST /radiation_par/ albedo, albedo_type, albedo_lw_dir, & |
---|
246 | albedo_lw_dif, albedo_sw_dir, albedo_sw_dif, & |
---|
247 | constant_albedo, day_init, dt_radiation, & |
---|
248 | lambda, lw_radiation, net_radiation, & |
---|
249 | radiation_scheme, skip_time_do_radiation, & |
---|
250 | sw_radiation, time_utc_init, & |
---|
251 | unscheduled_radiation_calls |
---|
252 | |
---|
253 | NAMELIST /spectra_par/ averaging_interval_sp, comp_spectra_level, & |
---|
254 | data_output_sp, dt_dosp, plot_spectra_level, & |
---|
255 | skip_time_dosp, spectra_direction |
---|
256 | |
---|
257 | ! |
---|
258 | !-- Position the namelist-file at the beginning (it was already opened in |
---|
259 | !-- parin), search for the namelist-group of the package and position the |
---|
260 | !-- file at this line. Do the same for each optionally used package. |
---|
261 | line = ' ' |
---|
262 | |
---|
263 | ! |
---|
264 | !-- Try to find canopy package |
---|
265 | REWIND ( 11 ) |
---|
266 | line = ' ' |
---|
267 | DO WHILE ( INDEX( line, '&canopy_par' ) == 0 ) |
---|
268 | READ ( 11, '(A)', END=10 ) line |
---|
269 | ENDDO |
---|
270 | BACKSPACE ( 11 ) |
---|
271 | |
---|
272 | ! |
---|
273 | !-- Read user-defined namelist |
---|
274 | READ ( 11, canopy_par ) |
---|
275 | |
---|
276 | ! |
---|
277 | !-- Set flag that indicates that canopy model is switched on |
---|
278 | plant_canopy = .TRUE. |
---|
279 | |
---|
280 | ! |
---|
281 | !-- Set flag that indicates that the lad-profile shall be calculated by using |
---|
282 | !-- a beta probability density function |
---|
283 | IF ( alpha_lad /= 9999999.9_wp .AND. beta_lad /= 9999999.9_wp ) & |
---|
284 | calc_beta_lad_profile = .TRUE. |
---|
285 | |
---|
286 | 10 CONTINUE |
---|
287 | |
---|
288 | |
---|
289 | #if defined( __dvrp_graphics ) |
---|
290 | REWIND ( 11 ) |
---|
291 | line = ' ' |
---|
292 | DO WHILE ( INDEX( line, '&dvrp_graphics_par' ) == 0 ) |
---|
293 | READ ( 11, '(A)', END=20 ) line |
---|
294 | ENDDO |
---|
295 | BACKSPACE ( 11 ) |
---|
296 | |
---|
297 | ! |
---|
298 | !-- Read user-defined namelist |
---|
299 | READ ( 11, dvrp_graphics_par ) |
---|
300 | |
---|
301 | 20 CONTINUE |
---|
302 | #endif |
---|
303 | |
---|
304 | ! |
---|
305 | !-- Try to find particles package |
---|
306 | REWIND ( 11 ) |
---|
307 | line = ' ' |
---|
308 | DO WHILE ( INDEX( line, '&particles_par' ) == 0 ) |
---|
309 | READ ( 11, '(A)', END=30 ) line |
---|
310 | ENDDO |
---|
311 | BACKSPACE ( 11 ) |
---|
312 | |
---|
313 | ! |
---|
314 | !-- Read user-defined namelist |
---|
315 | READ ( 11, particles_par ) |
---|
316 | |
---|
317 | ! |
---|
318 | !-- Set flag that indicates that particles are switched on |
---|
319 | particle_advection = .TRUE. |
---|
320 | |
---|
321 | 30 CONTINUE |
---|
322 | |
---|
323 | REWIND ( 11 ) |
---|
324 | line = ' ' |
---|
325 | DO WHILE ( INDEX( line, '&spectra_par' ) == 0 ) |
---|
326 | READ ( 11, '(A)', END=40 ) line |
---|
327 | ENDDO |
---|
328 | BACKSPACE ( 11 ) |
---|
329 | |
---|
330 | ! |
---|
331 | !-- Read user-defined namelist |
---|
332 | READ ( 11, spectra_par ) |
---|
333 | |
---|
334 | ! |
---|
335 | !-- Default setting of dt_dosp here (instead of check_parameters), because its |
---|
336 | !-- current value is needed in init_pegrid |
---|
337 | IF ( dt_dosp == 9999999.9_wp ) dt_dosp = dt_data_output |
---|
338 | |
---|
339 | 40 CONTINUE |
---|
340 | |
---|
341 | ! |
---|
342 | !-- Try to find land surface model package |
---|
343 | REWIND ( 11 ) |
---|
344 | line = ' ' |
---|
345 | DO WHILE ( INDEX( line, '&lsm_par' ) == 0 ) |
---|
346 | READ ( 11, '(A)', END=50 ) line |
---|
347 | ENDDO |
---|
348 | BACKSPACE ( 11 ) |
---|
349 | |
---|
350 | ! |
---|
351 | !-- Read user-defined namelist |
---|
352 | READ ( 11, lsm_par ) |
---|
353 | |
---|
354 | ! |
---|
355 | !-- Set flag that indicates that the land surface model is switched on |
---|
356 | land_surface = .TRUE. |
---|
357 | |
---|
358 | 50 CONTINUE |
---|
359 | |
---|
360 | ! |
---|
361 | !-- Try to find radiation package |
---|
362 | REWIND ( 11 ) |
---|
363 | line = ' ' |
---|
364 | DO WHILE ( INDEX( line, '&radiation_par' ) == 0 ) |
---|
365 | READ ( 11, '(A)', END=51 ) line |
---|
366 | ENDDO |
---|
367 | BACKSPACE ( 11 ) |
---|
368 | |
---|
369 | ! |
---|
370 | !-- Read user-defined namelist |
---|
371 | READ ( 11, radiation_par ) |
---|
372 | |
---|
373 | ! |
---|
374 | !-- Set flag that indicates that the radiation scheme is switched on |
---|
375 | radiation = .TRUE. |
---|
376 | |
---|
377 | 51 CONTINUE |
---|
378 | |
---|
379 | |
---|
380 | END SUBROUTINE package_parin |
---|