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

Last change on this file since 1552 was 1552, checked in by maronga, 9 years ago

last commit documented

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