[1] | 1 | SUBROUTINE package_parin |
---|
| 2 | |
---|
[1036] | 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 | ! |
---|
[1310] | 17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1484] | 22 | ! Changes due to new module structure of the plant canopy model: |
---|
| 23 | ! module plant_canopy_model_mod added, |
---|
| 24 | ! new package/namelist canopy_par added, i.e. the canopy model is no longer |
---|
| 25 | ! steered over the inipar-namelist, |
---|
| 26 | ! drag_coefficient, leaf_surface_concentration and scalar_exchange_coefficient |
---|
| 27 | ! renamed to canopy_drag_coeff, leaf_surface_conc and leaf_scalar_exch_coeff. |
---|
| 28 | ! Changed statement tags in CONTINUE-statement |
---|
[1341] | 29 | ! |
---|
[1321] | 30 | ! Former revisions: |
---|
| 31 | ! ----------------- |
---|
| 32 | ! $Id: package_parin.f90 1484 2014-10-21 10:53:05Z kanani $ |
---|
| 33 | ! |
---|
[1368] | 34 | ! 1367 2014-04-23 15:18:30Z witha |
---|
| 35 | ! Bugfix: module kinds must be used |
---|
| 36 | ! |
---|
[1360] | 37 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
| 38 | ! +alloc_factor, + min_nr_particle |
---|
| 39 | ! -dt_sort_particles, -maximum_number_of_particles |
---|
| 40 | ! |
---|
[1341] | 41 | ! 1340 2014-03-25 19:45:13Z kanani |
---|
| 42 | ! REAL constants defined as wp-kinds |
---|
| 43 | ! |
---|
[1325] | 44 | ! 1324 2014-03-21 09:13:16Z suehring |
---|
| 45 | ! Bugfix: Missing variable dt_data_output output added to ONLY statement |
---|
| 46 | ! |
---|
[1321] | 47 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 48 | ! ONLY-attribute added to USE-statements, |
---|
| 49 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 50 | ! kinds are defined in new module kinds, |
---|
| 51 | ! old module precision_kind is removed, |
---|
| 52 | ! revision history before 2012 removed, |
---|
| 53 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 54 | ! all variable declaration statements |
---|
[392] | 55 | ! |
---|
[1037] | 56 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 57 | ! code put under GPL (PALM 3.9) |
---|
| 58 | ! |
---|
[829] | 59 | ! 828 2012-02-21 12:00:36Z raasch |
---|
| 60 | ! +dissipation_classes, radius_classes in parpar |
---|
| 61 | ! |
---|
[826] | 62 | ! 825 2012-02-19 03:03:44Z raasch |
---|
| 63 | ! wang_collision_kernel and turbulence_effects_on_collision in particles_par |
---|
| 64 | ! replaced by collision_kernel |
---|
| 65 | ! |
---|
[1] | 66 | ! Revision 1.1 2000/12/28 13:21:57 raasch |
---|
| 67 | ! Initial revision |
---|
| 68 | ! |
---|
| 69 | ! |
---|
| 70 | ! Description: |
---|
| 71 | ! ------------ |
---|
| 72 | ! This subroutine reads from the NAMELIST file variables controling model |
---|
| 73 | ! software packages which are used optionally in the run. |
---|
| 74 | !------------------------------------------------------------------------------! |
---|
| 75 | |
---|
[1320] | 76 | USE control_parameters, & |
---|
[1324] | 77 | ONLY: averaging_interval_sp, dt_data_output, dt_dopts, dt_dosp, & |
---|
| 78 | dt_dvrp, particle_maximum_age, skip_time_dosp, threshold |
---|
[1] | 79 | |
---|
[1320] | 80 | USE dvrp_variables, & |
---|
| 81 | ONLY: clip_dvrp_l, clip_dvrp_n, clip_dvrp_r, clip_dvrp_s, & |
---|
| 82 | cluster_size, color_interval, dvrpsize_interval, & |
---|
| 83 | dvrp_directory, dvrp_file, dvrp_host, dvrp_output, & |
---|
| 84 | dvrp_password, dvrp_username, groundplate_color, & |
---|
| 85 | isosurface_color, mode_dvrp, particle_color, & |
---|
| 86 | particle_dvrpsize, pathlines_fadeintime, & |
---|
| 87 | pathlines_fadeouttime, pathlines_linecount, & |
---|
| 88 | pathlines_maxhistory, pathlines_wavecount, & |
---|
| 89 | pathlines_wavetime, slicer_range_limits_dvrp, superelevation, & |
---|
| 90 | superelevation_x, superelevation_y, topography_color, & |
---|
| 91 | vc_alpha, vc_gradient_normals, vc_mode, vc_size_x, vc_size_y, & |
---|
| 92 | vc_size_z |
---|
| 93 | |
---|
[1367] | 94 | USE kinds |
---|
| 95 | |
---|
[1320] | 96 | USE particle_attributes, & |
---|
[1359] | 97 | ONLY: alloc_factor, bc_par_b, bc_par_lr, bc_par_ns, bc_par_t, & |
---|
| 98 | collision_kernel, density_ratio, dissipation_classes, & |
---|
| 99 | dt_min_part, dt_prel, dt_write_particle_data, dvrp_psize, & |
---|
[1320] | 100 | end_time_prel, initial_weighting_factor, & |
---|
[1359] | 101 | maximum_number_of_tailpoints, & |
---|
[1320] | 102 | maximum_tailpoint_age, minimum_tailpoint_distance, & |
---|
[1359] | 103 | min_nr_particle, number_of_particle_groups, particles_per_point,& |
---|
[1320] | 104 | particle_advection, particle_advection_start, pdx, pdy, pdz, & |
---|
| 105 | psb, psl, psn, psr, pss, pst, radius, radius_classes, & |
---|
| 106 | random_start_position, read_particles_from_restartfile, & |
---|
| 107 | skip_particles_for_tail, use_particle_tails, & |
---|
| 108 | use_sgs_for_particles, vertical_particle_advection, & |
---|
| 109 | write_particle_statistics |
---|
| 110 | |
---|
[1484] | 111 | USE plant_canopy_model_mod, & |
---|
| 112 | ONLY: alpha_lad, beta_lad, calc_beta_lad_profile, canopy_drag_coeff, & |
---|
| 113 | canopy_mode, cthf, lad_surface, & |
---|
| 114 | lad_vertical_gradient, lad_vertical_gradient_level, lai_beta, & |
---|
| 115 | leaf_scalar_exch_coeff, leaf_surface_conc, pch_index, & |
---|
| 116 | plant_canopy |
---|
| 117 | |
---|
[1320] | 118 | USE spectrum, & |
---|
| 119 | ONLY: comp_spectra_level, data_output_sp, plot_spectra_level, & |
---|
| 120 | spectra_direction |
---|
| 121 | |
---|
[1] | 122 | IMPLICIT NONE |
---|
| 123 | |
---|
[1320] | 124 | CHARACTER (LEN=80) :: line !: |
---|
[1] | 125 | |
---|
[1484] | 126 | NAMELIST /canopy_par/ alpha_lad, beta_lad, canopy_drag_coeff, & |
---|
| 127 | canopy_mode, cthf, & |
---|
| 128 | lad_surface, & |
---|
| 129 | lad_vertical_gradient, & |
---|
| 130 | lad_vertical_gradient_level, & |
---|
| 131 | lai_beta, & |
---|
| 132 | leaf_scalar_exch_coeff, & |
---|
| 133 | leaf_surface_conc, pch_index |
---|
| 134 | |
---|
[242] | 135 | NAMELIST /dvrp_graphics_par/ clip_dvrp_l, clip_dvrp_n, clip_dvrp_r, & |
---|
[264] | 136 | clip_dvrp_s, cluster_size, color_interval, & |
---|
| 137 | dt_dvrp, dvrpsize_interval, dvrp_directory, & |
---|
| 138 | dvrp_file, dvrp_host, dvrp_output, & |
---|
[336] | 139 | dvrp_password, dvrp_psize, dvrp_username, & |
---|
[284] | 140 | groundplate_color, isosurface_color, & |
---|
| 141 | mode_dvrp, particle_color, particle_dvrpsize,& |
---|
[264] | 142 | pathlines_fadeintime, pathlines_fadeouttime, & |
---|
| 143 | pathlines_linecount, pathlines_maxhistory, & |
---|
| 144 | pathlines_wavecount, pathlines_wavetime, & |
---|
| 145 | slicer_range_limits_dvrp, superelevation, & |
---|
| 146 | superelevation_x, superelevation_y, & |
---|
[284] | 147 | threshold, topography_color, vc_alpha, & |
---|
| 148 | vc_gradient_normals, vc_mode, vc_size_x, & |
---|
| 149 | vc_size_y, vc_size_z |
---|
[264] | 150 | |
---|
[1359] | 151 | NAMELIST /particles_par/ alloc_factor, bc_par_b, bc_par_lr, & |
---|
| 152 | bc_par_ns, bc_par_t, collision_kernel, & |
---|
| 153 | density_ratio, dissipation_classes, dt_dopts,& |
---|
| 154 | dt_min_part, dt_prel, & |
---|
[336] | 155 | dt_write_particle_data, & |
---|
[1] | 156 | end_time_prel, initial_weighting_factor, & |
---|
| 157 | maximum_number_of_tailpoints, & |
---|
| 158 | maximum_tailpoint_age, & |
---|
| 159 | minimum_tailpoint_distance, & |
---|
[1359] | 160 | min_nr_particle, & |
---|
[1] | 161 | number_of_particle_groups, & |
---|
| 162 | particles_per_point, & |
---|
| 163 | particle_advection_start, & |
---|
| 164 | particle_maximum_age, pdx, pdy, pdz, psb, & |
---|
[828] | 165 | psl, psn, psr, pss, pst, radius, & |
---|
| 166 | radius_classes, random_start_position, & |
---|
[1] | 167 | read_particles_from_restartfile, & |
---|
[790] | 168 | skip_particles_for_tail, & |
---|
| 169 | use_particle_tails, use_sgs_for_particles, & |
---|
[1] | 170 | vertical_particle_advection, & |
---|
| 171 | write_particle_statistics |
---|
[1320] | 172 | |
---|
[1] | 173 | NAMELIST /spectra_par/ averaging_interval_sp, comp_spectra_level, & |
---|
| 174 | data_output_sp, dt_dosp, plot_spectra_level, & |
---|
| 175 | skip_time_dosp, spectra_direction |
---|
| 176 | |
---|
| 177 | ! |
---|
| 178 | !-- Position the namelist-file at the beginning (it was already opened in |
---|
| 179 | !-- parin), search for the namelist-group of the package and position the |
---|
| 180 | !-- file at this line. Do the same for each optionally used package. |
---|
[1320] | 181 | line = ' ' |
---|
[1] | 182 | |
---|
[1484] | 183 | ! |
---|
| 184 | !-- Try to find canopy package |
---|
| 185 | REWIND ( 11 ) |
---|
| 186 | line = ' ' |
---|
| 187 | DO WHILE ( INDEX( line, '&canopy_par' ) == 0 ) |
---|
| 188 | READ ( 11, '(A)', END=10 ) line |
---|
| 189 | ENDDO |
---|
| 190 | BACKSPACE ( 11 ) |
---|
| 191 | |
---|
| 192 | ! |
---|
| 193 | !-- Read user-defined namelist |
---|
| 194 | READ ( 11, canopy_par ) |
---|
| 195 | |
---|
| 196 | ! |
---|
| 197 | !-- Set flag that indicates that canopy model is switched on |
---|
| 198 | plant_canopy = .TRUE. |
---|
| 199 | |
---|
| 200 | ! |
---|
| 201 | !-- Set flag that indicates that the lad-profile shall be calculated by using |
---|
| 202 | !-- a beta probability density function |
---|
| 203 | IF ( alpha_lad /= 9999999.9_wp .AND. beta_lad /= 9999999.9_wp ) & |
---|
| 204 | calc_beta_lad_profile = .TRUE. |
---|
| 205 | |
---|
| 206 | 10 CONTINUE |
---|
| 207 | |
---|
| 208 | |
---|
[1] | 209 | #if defined( __dvrp_graphics ) |
---|
| 210 | REWIND ( 11 ) |
---|
[1320] | 211 | line = ' ' |
---|
| 212 | DO WHILE ( INDEX( line, '&dvrp_graphics_par' ) == 0 ) |
---|
[1484] | 213 | READ ( 11, '(A)', END=20 ) line |
---|
[1] | 214 | ENDDO |
---|
| 215 | BACKSPACE ( 11 ) |
---|
| 216 | |
---|
| 217 | ! |
---|
| 218 | !-- Read user-defined namelist |
---|
| 219 | READ ( 11, dvrp_graphics_par ) |
---|
| 220 | |
---|
[1484] | 221 | 20 CONTINUE |
---|
[1] | 222 | #endif |
---|
| 223 | |
---|
[60] | 224 | ! |
---|
| 225 | !-- Try to find particles package |
---|
[1] | 226 | REWIND ( 11 ) |
---|
[1320] | 227 | line = ' ' |
---|
| 228 | DO WHILE ( INDEX( line, '&particles_par' ) == 0 ) |
---|
[1484] | 229 | READ ( 11, '(A)', END=30 ) line |
---|
[1] | 230 | ENDDO |
---|
| 231 | BACKSPACE ( 11 ) |
---|
| 232 | |
---|
| 233 | ! |
---|
| 234 | !-- Read user-defined namelist |
---|
| 235 | READ ( 11, particles_par ) |
---|
| 236 | |
---|
| 237 | ! |
---|
| 238 | !-- Set flag that indicates that particles are switched on |
---|
| 239 | particle_advection = .TRUE. |
---|
| 240 | |
---|
[1484] | 241 | 30 CONTINUE |
---|
[1] | 242 | |
---|
[60] | 243 | |
---|
[1] | 244 | #if defined( __spectra ) |
---|
| 245 | REWIND ( 11 ) |
---|
[1320] | 246 | line = ' ' |
---|
| 247 | DO WHILE ( INDEX( line, '&spectra_par' ) == 0 ) |
---|
[1484] | 248 | READ ( 11, '(A)', END=40 ) line |
---|
[1] | 249 | ENDDO |
---|
| 250 | BACKSPACE ( 11 ) |
---|
| 251 | |
---|
| 252 | ! |
---|
| 253 | !-- Read user-defined namelist |
---|
| 254 | READ ( 11, spectra_par ) |
---|
| 255 | |
---|
| 256 | ! |
---|
| 257 | !-- Default setting of dt_dosp here (instead of check_parameters), because its |
---|
| 258 | !-- current value is needed in init_pegrid |
---|
[1340] | 259 | IF ( dt_dosp == 9999999.9_wp ) dt_dosp = dt_data_output |
---|
[1] | 260 | |
---|
[1484] | 261 | 40 CONTINUE |
---|
[1] | 262 | #endif |
---|
| 263 | |
---|
| 264 | END SUBROUTINE package_parin |
---|