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

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

last commit documented

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