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