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

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

Added support for RRTMG radiation code

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