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

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

last commit documented / copyright update

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