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

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

various bugfixes and modifications of the atmosphere-land-surface-radiation interaction. Completely re-written routine to calculate surface fluxes (surface_layer_fluxes.f90) that replaces prandtl_fluxes. Minor formatting corrections and renamings

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