[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 | ! ----------------- |
---|
[1691] | 21 | ! Added skip_time_do_lsm, skip_time_do_radiation, and emissivity |
---|
[1586] | 22 | ! |
---|
[1485] | 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: package_parin.f90 1691 2015-10-26 16:17:44Z maronga $ |
---|
| 26 | ! |
---|
[1683] | 27 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 28 | ! Code annotations made doxygen readable |
---|
| 29 | ! |
---|
[1586] | 30 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
| 31 | ! Added several radiation_par parameters |
---|
| 32 | ! |
---|
[1576] | 33 | ! 1575 2015-03-27 09:56:27Z raasch |
---|
| 34 | ! +seed_follows_topography in particles_par |
---|
| 35 | ! |
---|
[1554] | 36 | ! 1553 2015-03-03 17:33:54Z maronga |
---|
| 37 | ! Resorting of lsm_par |
---|
| 38 | ! |
---|
[1552] | 39 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
| 40 | ! Several changes in the liste for land surface model and radiation model |
---|
| 41 | ! |
---|
[1497] | 42 | ! 1496 2014-12-02 17:25:50Z maronga |
---|
| 43 | ! Added support for the land surface model and radiation scheme |
---|
| 44 | ! |
---|
[1485] | 45 | ! 1484 2014-10-21 10:53:05Z kanani |
---|
[1484] | 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 |
---|
[1341] | 53 | ! |
---|
[1368] | 54 | ! 1367 2014-04-23 15:18:30Z witha |
---|
| 55 | ! Bugfix: module kinds must be used |
---|
| 56 | ! |
---|
[1360] | 57 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
| 58 | ! +alloc_factor, + min_nr_particle |
---|
| 59 | ! -dt_sort_particles, -maximum_number_of_particles |
---|
| 60 | ! |
---|
[1341] | 61 | ! 1340 2014-03-25 19:45:13Z kanani |
---|
| 62 | ! REAL constants defined as wp-kinds |
---|
| 63 | ! |
---|
[1325] | 64 | ! 1324 2014-03-21 09:13:16Z suehring |
---|
| 65 | ! Bugfix: Missing variable dt_data_output output added to ONLY statement |
---|
| 66 | ! |
---|
[1321] | 67 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 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 |
---|
[392] | 75 | ! |
---|
[1037] | 76 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 77 | ! code put under GPL (PALM 3.9) |
---|
| 78 | ! |
---|
[829] | 79 | ! 828 2012-02-21 12:00:36Z raasch |
---|
| 80 | ! +dissipation_classes, radius_classes in parpar |
---|
| 81 | ! |
---|
[826] | 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 | ! |
---|
[1] | 86 | ! Revision 1.1 2000/12/28 13:21:57 raasch |
---|
| 87 | ! Initial revision |
---|
| 88 | ! |
---|
| 89 | ! |
---|
| 90 | ! Description: |
---|
| 91 | ! ------------ |
---|
[1682] | 92 | !> This subroutine reads from the NAMELIST file variables controling model |
---|
| 93 | !> software packages which are used optionally in the run. |
---|
[1691] | 94 | !> |
---|
| 95 | !> @todo Perform all actions in the respective submodules and remove |
---|
| 96 | !> package_parin |
---|
[1] | 97 | !------------------------------------------------------------------------------! |
---|
[1682] | 98 | SUBROUTINE package_parin |
---|
| 99 | |
---|
[1] | 100 | |
---|
[1320] | 101 | USE control_parameters, & |
---|
[1324] | 102 | ONLY: averaging_interval_sp, dt_data_output, dt_dopts, dt_dosp, & |
---|
[1496] | 103 | dt_dvrp, particle_maximum_age, skip_time_dosp, & |
---|
| 104 | threshold |
---|
[1] | 105 | |
---|
[1320] | 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 | |
---|
[1496] | 120 | USE land_surface_model_mod, & |
---|
[1551] | 121 | ONLY: alpha_vangenuchten, c_surface, canopy_resistance_coefficient, & |
---|
[1691] | 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 |
---|
[1496] | 130 | |
---|
[1367] | 131 | USE kinds |
---|
| 132 | |
---|
[1320] | 133 | USE particle_attributes, & |
---|
[1359] | 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, & |
---|
[1320] | 137 | end_time_prel, initial_weighting_factor, & |
---|
[1359] | 138 | maximum_number_of_tailpoints, & |
---|
[1320] | 139 | maximum_tailpoint_age, minimum_tailpoint_distance, & |
---|
[1359] | 140 | min_nr_particle, number_of_particle_groups, particles_per_point,& |
---|
[1320] | 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, & |
---|
[1575] | 144 | seed_follows_topography, skip_particles_for_tail, & |
---|
| 145 | use_particle_tails, use_sgs_for_particles, & |
---|
| 146 | vertical_particle_advection, write_particle_statistics |
---|
[1320] | 147 | |
---|
[1484] | 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 | |
---|
[1496] | 155 | USE radiation_model_mod, & |
---|
[1585] | 156 | ONLY: albedo, albedo_type, albedo_lw_dif, albedo_lw_dir, albedo_sw_dif,& |
---|
[1691] | 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 |
---|
[1496] | 161 | |
---|
| 162 | |
---|
[1320] | 163 | USE spectrum, & |
---|
| 164 | ONLY: comp_spectra_level, data_output_sp, plot_spectra_level, & |
---|
| 165 | spectra_direction |
---|
| 166 | |
---|
[1] | 167 | IMPLICIT NONE |
---|
| 168 | |
---|
[1682] | 169 | CHARACTER (LEN=80) :: line !< |
---|
[1] | 170 | |
---|
[1484] | 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 | |
---|
[242] | 180 | NAMELIST /dvrp_graphics_par/ clip_dvrp_l, clip_dvrp_n, clip_dvrp_r, & |
---|
[264] | 181 | clip_dvrp_s, cluster_size, color_interval, & |
---|
| 182 | dt_dvrp, dvrpsize_interval, dvrp_directory, & |
---|
| 183 | dvrp_file, dvrp_host, dvrp_output, & |
---|
[336] | 184 | dvrp_password, dvrp_psize, dvrp_username, & |
---|
[284] | 185 | groundplate_color, isosurface_color, & |
---|
| 186 | mode_dvrp, particle_color, particle_dvrpsize,& |
---|
[264] | 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, & |
---|
[284] | 192 | threshold, topography_color, vc_alpha, & |
---|
| 193 | vc_gradient_normals, vc_mode, vc_size_x, & |
---|
| 194 | vc_size_y, vc_size_z |
---|
[264] | 195 | |
---|
[1551] | 196 | NAMELIST /lsm_par/ alpha_vangenuchten, c_surface, & |
---|
[1496] | 197 | canopy_resistance_coefficient, & |
---|
[1551] | 198 | conserve_water_content, dewfall, & |
---|
[1553] | 199 | f_shortwave_incoming, field_capacity, & |
---|
[1551] | 200 | hydraulic_conductivity, & |
---|
| 201 | lambda_surface_stable, & |
---|
| 202 | lambda_surface_unstable, leaf_area_index, & |
---|
| 203 | l_vangenuchten, min_canopy_resistance, & |
---|
[1553] | 204 | min_soil_resistance, n_vangenuchten, & |
---|
| 205 | residual_moisture, root_fraction, & |
---|
[1691] | 206 | saturation_moisture, skip_time_do_lsm, & |
---|
| 207 | soil_moisture, soil_temperature, soil_type, & |
---|
[1553] | 208 | vegetation_coverage, veg_type, wilting_point,& |
---|
| 209 | zs, z0_eb, z0h_eb |
---|
[1496] | 210 | |
---|
| 211 | |
---|
| 212 | |
---|
[1359] | 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, & |
---|
[336] | 217 | dt_write_particle_data, & |
---|
[1] | 218 | end_time_prel, initial_weighting_factor, & |
---|
| 219 | maximum_number_of_tailpoints, & |
---|
| 220 | maximum_tailpoint_age, & |
---|
| 221 | minimum_tailpoint_distance, & |
---|
[1359] | 222 | min_nr_particle, & |
---|
[1] | 223 | number_of_particle_groups, & |
---|
| 224 | particles_per_point, & |
---|
| 225 | particle_advection_start, & |
---|
| 226 | particle_maximum_age, pdx, pdy, pdz, psb, & |
---|
[828] | 227 | psl, psn, psr, pss, pst, radius, & |
---|
| 228 | radius_classes, random_start_position, & |
---|
[1] | 229 | read_particles_from_restartfile, & |
---|
[1575] | 230 | seed_follows_topography, & |
---|
[790] | 231 | skip_particles_for_tail, & |
---|
| 232 | use_particle_tails, use_sgs_for_particles, & |
---|
[1] | 233 | vertical_particle_advection, & |
---|
| 234 | write_particle_statistics |
---|
[1320] | 235 | |
---|
[1585] | 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, & |
---|
[1691] | 240 | radiation_scheme, skip_time_do_radiation, & |
---|
| 241 | sw_radiation, time_utc_init |
---|
[1496] | 242 | |
---|
[1] | 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. |
---|
[1320] | 251 | line = ' ' |
---|
[1] | 252 | |
---|
[1484] | 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 | |
---|
[1] | 279 | #if defined( __dvrp_graphics ) |
---|
| 280 | REWIND ( 11 ) |
---|
[1320] | 281 | line = ' ' |
---|
| 282 | DO WHILE ( INDEX( line, '&dvrp_graphics_par' ) == 0 ) |
---|
[1484] | 283 | READ ( 11, '(A)', END=20 ) line |
---|
[1] | 284 | ENDDO |
---|
| 285 | BACKSPACE ( 11 ) |
---|
| 286 | |
---|
| 287 | ! |
---|
| 288 | !-- Read user-defined namelist |
---|
| 289 | READ ( 11, dvrp_graphics_par ) |
---|
| 290 | |
---|
[1484] | 291 | 20 CONTINUE |
---|
[1] | 292 | #endif |
---|
| 293 | |
---|
[60] | 294 | ! |
---|
| 295 | !-- Try to find particles package |
---|
[1] | 296 | REWIND ( 11 ) |
---|
[1320] | 297 | line = ' ' |
---|
| 298 | DO WHILE ( INDEX( line, '&particles_par' ) == 0 ) |
---|
[1484] | 299 | READ ( 11, '(A)', END=30 ) line |
---|
[1] | 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 | |
---|
[1484] | 311 | 30 CONTINUE |
---|
[1] | 312 | |
---|
[60] | 313 | |
---|
[1] | 314 | #if defined( __spectra ) |
---|
| 315 | REWIND ( 11 ) |
---|
[1320] | 316 | line = ' ' |
---|
| 317 | DO WHILE ( INDEX( line, '&spectra_par' ) == 0 ) |
---|
[1484] | 318 | READ ( 11, '(A)', END=40 ) line |
---|
[1] | 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 |
---|
[1340] | 329 | IF ( dt_dosp == 9999999.9_wp ) dt_dosp = dt_data_output |
---|
[1] | 330 | |
---|
[1484] | 331 | 40 CONTINUE |
---|
[1] | 332 | #endif |
---|
| 333 | |
---|
[1496] | 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 | |
---|
[1] | 373 | END SUBROUTINE package_parin |
---|