source: palm/trunk/SOURCE/package_parin.f90 @ 1576

Last change on this file since 1576 was 1576, checked in by raasch, 9 years ago

last commit documented

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