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