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

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

added beta version of a land surface model and a simple radiation model for clear sky conditions

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