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

Last change on this file since 1763 was 1758, checked in by maronga, 8 years ago

last commit documented

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