[1] | 1 | SUBROUTINE check_parameters |
---|
| 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 | ! |
---|
| 17 | ! Copyright 1997-2012 Leibniz University Hannover |
---|
| 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1054] | 22 | ! |
---|
[1211] | 23 | ! |
---|
[1054] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: check_parameters.f90 1211 2013-08-14 13:46:36Z raasch $ |
---|
| 27 | ! |
---|
[1211] | 28 | ! 1210 2013-08-14 10:58:20Z raasch |
---|
| 29 | ! check for fftw |
---|
| 30 | ! |
---|
[1182] | 31 | ! 1179 2013-06-14 05:57:58Z raasch |
---|
| 32 | ! checks and settings of buoyancy parameters and switches revised, |
---|
| 33 | ! initial profile for rho added to hom (id=77) |
---|
| 34 | ! |
---|
[1175] | 35 | ! 1174 2013-05-31 10:28:08Z gryschka |
---|
| 36 | ! Bugfix in computing initial profiles for ug, vg, lad, q in case of Atmosphere |
---|
| 37 | ! |
---|
[1160] | 38 | ! 1159 2013-05-21 11:58:22Z fricke |
---|
| 39 | ! bc_lr/ns_dirneu/neudir removed |
---|
| 40 | ! |
---|
[1116] | 41 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 42 | ! unused variables removed |
---|
| 43 | ! drizzle can be used without precipitation |
---|
| 44 | ! |
---|
[1112] | 45 | ! 1111 2013-03-08 23:54:10Z raasch |
---|
| 46 | ! ibc_p_b = 2 removed |
---|
| 47 | ! |
---|
[1104] | 48 | ! 1103 2013-02-20 02:15:53Z raasch |
---|
| 49 | ! Bugfix: turbulent inflow must not require cyclic fill in restart runs |
---|
| 50 | ! |
---|
[1093] | 51 | ! 1092 2013-02-02 11:24:22Z raasch |
---|
| 52 | ! unused variables removed |
---|
| 53 | ! |
---|
[1070] | 54 | ! 1069 2012-11-28 16:18:43Z maronga |
---|
| 55 | ! allow usage of topography in combination with cloud physics |
---|
| 56 | ! |
---|
[1066] | 57 | ! 1065 2012-11-22 17:42:36Z hoffmann |
---|
| 58 | ! Bugfix: It is not allowed to use cloud_scheme = seifert_beheng without |
---|
| 59 | ! precipitation in order to save computational resources. |
---|
| 60 | ! |
---|
[1061] | 61 | ! 1060 2012-11-21 07:19:51Z raasch |
---|
| 62 | ! additional check for parameter turbulent_inflow |
---|
| 63 | ! |
---|
[1054] | 64 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
[1053] | 65 | ! necessary changes for the new two-moment cloud physics scheme added: |
---|
| 66 | ! - check cloud physics scheme (Kessler or Seifert and Beheng) |
---|
| 67 | ! - plant_canopy is not allowed |
---|
| 68 | ! - currently, only cache loop_optimization is allowed |
---|
| 69 | ! - initial profiles of nr, qr |
---|
| 70 | ! - boundary condition of nr, qr |
---|
| 71 | ! - check output quantities (qr, nr, prr) |
---|
[979] | 72 | ! |
---|
[1037] | 73 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 74 | ! code put under GPL (PALM 3.9) |
---|
| 75 | ! |
---|
[1035] | 76 | ! 1031/1034 2012-10-22 11:32:49Z raasch |
---|
| 77 | ! check of netcdf4 parallel file support |
---|
| 78 | ! |
---|
[1020] | 79 | ! 1019 2012-09-28 06:46:45Z raasch |
---|
| 80 | ! non-optimized version of prognostic_equations not allowed any more |
---|
| 81 | ! |
---|
[1017] | 82 | ! 1015 2012-09-27 09:23:24Z raasch |
---|
| 83 | ! acc allowed for loop optimization, |
---|
| 84 | ! checks for adjustment of mixing length to the Prandtl mixing length removed |
---|
| 85 | ! |
---|
[1004] | 86 | ! 1003 2012-09-14 14:35:53Z raasch |
---|
| 87 | ! checks for cases with unequal subdomain sizes removed |
---|
| 88 | ! |
---|
[1002] | 89 | ! 1001 2012-09-13 14:08:46Z raasch |
---|
| 90 | ! all actions concerning leapfrog- and upstream-spline-scheme removed |
---|
| 91 | ! |
---|
[997] | 92 | ! 996 2012-09-07 10:41:47Z raasch |
---|
| 93 | ! little reformatting |
---|
[1001] | 94 | |
---|
[979] | 95 | ! 978 2012-08-09 08:28:32Z fricke |
---|
[978] | 96 | ! setting of bc_lr/ns_dirneu/neudir |
---|
| 97 | ! outflow damping layer removed |
---|
| 98 | ! check for z0h* |
---|
| 99 | ! check for pt_damping_width |
---|
[667] | 100 | ! |
---|
[965] | 101 | ! 964 2012-07-26 09:14:24Z raasch |
---|
| 102 | ! check of old profil-parameters removed |
---|
| 103 | ! |
---|
[941] | 104 | ! 940 2012-07-09 14:31:00Z raasch |
---|
| 105 | ! checks for parameter neutral |
---|
| 106 | ! |
---|
[925] | 107 | ! 924 2012-06-06 07:44:41Z maronga |
---|
| 108 | ! Bugfix: preprocessor directives caused error during compilation |
---|
| 109 | ! |
---|
[893] | 110 | ! 892 2012-05-02 13:51:44Z maronga |
---|
| 111 | ! Bugfix for parameter file check ( excluding __netcdf4 ) |
---|
| 112 | ! |
---|
[867] | 113 | ! 866 2012-03-28 06:44:41Z raasch |
---|
| 114 | ! use only 60% of the geostrophic wind as translation speed in case of Galilean |
---|
| 115 | ! transformation and use_ug_for_galilei_tr = .T. in order to mimimize the |
---|
| 116 | ! timestep |
---|
| 117 | ! |
---|
[863] | 118 | ! 861 2012-03-26 14:18:34Z suehring |
---|
| 119 | ! Check for topography and ws-scheme removed. |
---|
| 120 | ! Check for loop_optimization = 'vector' and ws-scheme removed. |
---|
| 121 | ! |
---|
[846] | 122 | ! 845 2012-03-07 10:23:05Z maronga |
---|
| 123 | ! Bugfix: exclude __netcdf4 directive part from namelist file check compilation |
---|
| 124 | ! |
---|
[829] | 125 | ! 828 2012-02-21 12:00:36Z raasch |
---|
| 126 | ! check of collision_kernel extended |
---|
| 127 | ! |
---|
[826] | 128 | ! 825 2012-02-19 03:03:44Z raasch |
---|
| 129 | ! check for collision_kernel and curvature_solution_effects |
---|
| 130 | ! |
---|
[810] | 131 | ! 809 2012-01-30 13:32:58Z maronga |
---|
| 132 | ! Bugfix: replaced .AND. and .NOT. with && and ! in the preprocessor directives |
---|
| 133 | ! |
---|
[808] | 134 | ! 807 2012-01-25 11:53:51Z maronga |
---|
| 135 | ! New cpp directive "__check" implemented which is used by check_namelist_files |
---|
| 136 | ! |
---|
[775] | 137 | ! 774 2011-10-27 13:34:16Z letzel |
---|
| 138 | ! bugfix for prescribed u,v-profiles |
---|
| 139 | ! |
---|
[768] | 140 | ! 767 2011-10-14 06:39:12Z raasch |
---|
| 141 | ! Calculating u,v-profiles from given profiles by linear interpolation. |
---|
| 142 | ! bugfix: dirichlet_0 conditions for ug/vg moved from init_3d_model to here |
---|
| 143 | ! |
---|
[708] | 144 | ! 707 2011-03-29 11:39:40Z raasch |
---|
| 145 | ! setting of bc_lr/ns_dirrad/raddir |
---|
| 146 | ! |
---|
| 147 | ! 689 2011-02-20 19:31:12z gryschka |
---|
[690] | 148 | ! Bugfix for some logical expressions |
---|
| 149 | ! (syntax was not compatible with all compilers) |
---|
[687] | 150 | ! |
---|
[690] | 151 | ! 680 2011-02-04 23:16:06Z gryschka |
---|
[681] | 152 | ! init_vortex is not allowed with volume_flow_control |
---|
[668] | 153 | ! |
---|
[674] | 154 | ! 673 2011-01-18 16:19:48Z suehring |
---|
| 155 | ! Declaration of ws_scheme_sca and ws_scheme_mom added (moved from advec_ws). |
---|
| 156 | ! |
---|
[668] | 157 | ! 667 2010-12-23 12:06:00Z suehring/gryschka |
---|
[667] | 158 | ! Exchange of parameters between ocean and atmosphere via PE0 |
---|
| 159 | ! Check for illegal combination of ws-scheme and timestep scheme. |
---|
| 160 | ! Check for topography and ws-scheme. |
---|
| 161 | ! Check for not cyclic boundary conditions in combination with ws-scheme and |
---|
| 162 | ! loop_optimization = 'vector'. |
---|
| 163 | ! Check for call_psolver_at_all_substeps and ws-scheme for momentum_advec. |
---|
| 164 | ! Different processor/grid topology in atmosphere and ocean is now allowed! |
---|
| 165 | ! Bugfixes in checking for conserve_volume_flow_mode |
---|
[601] | 166 | ! 600 2010-11-24 16:10:51Z raasch |
---|
| 167 | ! change due to new default value of surface_waterflux |
---|
[581] | 168 | ! 580 2010-10-05 13:59:11Z heinze |
---|
[601] | 169 | ! renaming of ws_vertical_gradient_level to subs_vertical_gradient_level |
---|
[581] | 170 | ! |
---|
[568] | 171 | ! 567 2010-10-01 10:46:30Z helmke |
---|
| 172 | ! calculating masks changed |
---|
| 173 | ! |
---|
[565] | 174 | ! 564 2010-09-30 13:18:59Z helmke |
---|
| 175 | ! palm message identifiers of masked output changed, 20 replaced by max_masks |
---|
| 176 | ! |
---|
[554] | 177 | ! 553 2010-09-01 14:09:06Z weinreis |
---|
| 178 | ! masks is calculated and removed from inipar |
---|
[532] | 179 | ! |
---|
| 180 | ! 531 2010-04-21 06:47:21Z heinze |
---|
| 181 | ! Bugfix: unit of hyp changed to dbar |
---|
[392] | 182 | ! |
---|
[525] | 183 | ! 524 2010-03-30 02:04:51Z raasch |
---|
| 184 | ! Bugfix: "/" in netcdf profile variable names replaced by ":" |
---|
| 185 | ! |
---|
[494] | 186 | ! 493 2010-03-01 08:30:24Z raasch |
---|
| 187 | ! netcdf_data_format is checked |
---|
| 188 | ! |
---|
[449] | 189 | ! 411 2009-12-11 14:15:58Z heinze |
---|
| 190 | ! Enabled passive scalar/humidity wall fluxes for non-flat topography |
---|
| 191 | ! Initialization of large scale vertical motion (subsidence/ascent) |
---|
| 192 | ! |
---|
| 193 | ! 410 2009-12-04 17:05:40Z letzel |
---|
| 194 | ! masked data output |
---|
| 195 | ! |
---|
[392] | 196 | ! 388 2009-09-23 09:40:33Z raasch |
---|
[388] | 197 | ! Check profiles fpr prho and hyp. |
---|
[376] | 198 | ! Bugfix: output of averaged 2d/3d quantities requires that an avaraging |
---|
| 199 | ! interval has been set, respective error message is included |
---|
[366] | 200 | ! bc_lr_cyc and bc_ns_cyc are set, |
---|
[328] | 201 | ! initializing_actions='read_data_for_recycling' renamed to 'cyclic_fill' |
---|
[308] | 202 | ! Check for illegal entries in section_xy|xz|yz that exceed nz+1|ny+1|nx+1 |
---|
[291] | 203 | ! Coupling with independent precursor runs. |
---|
[264] | 204 | ! Check particle_color, particle_dvrpsize, color_interval, dvrpsize_interval |
---|
[232] | 205 | ! Bugfix: pressure included for profile output |
---|
[240] | 206 | ! Check pressure gradient conditions |
---|
[256] | 207 | ! topography_grid_convention moved from user_check_parameters |
---|
| 208 | ! 'single_street_canyon' |
---|
[367] | 209 | ! Added shf* and qsws* to the list of available output data |
---|
[226] | 210 | ! |
---|
| 211 | ! 222 2009-01-12 16:04:16Z letzel |
---|
[217] | 212 | ! +user_check_parameters |
---|
[213] | 213 | ! Output of messages replaced by message handling routine. |
---|
[206] | 214 | ! Implementation of an MPI-1 coupling: replaced myid with target_id, |
---|
| 215 | ! deleted __mpi2 directives |
---|
[222] | 216 | ! Check that PALM is called with mrun -K parallel for coupling |
---|
[198] | 217 | ! |
---|
| 218 | ! 197 2008-09-16 15:29:03Z raasch |
---|
[177] | 219 | ! Bug fix: Construction of vertical profiles when 10 gradients have been |
---|
[181] | 220 | ! specified in the parameter list (ug, vg, pt, q, sa, lad) |
---|
| 221 | ! |
---|
| 222 | ! Strict grid matching along z is not needed for mg-solver. |
---|
[153] | 223 | ! Leaf area density (LAD) explicitly set to its surface value at k=0 |
---|
[151] | 224 | ! Case of reading data for recycling included in initializing_actions, |
---|
[197] | 225 | ! check of turbulent_inflow and calculation of recycling_plane. |
---|
| 226 | ! q*2 profile added |
---|
[139] | 227 | ! |
---|
| 228 | ! 138 2007-11-28 10:03:58Z letzel |
---|
[138] | 229 | ! Plant canopy added |
---|
[132] | 230 | ! Allow new case bc_uv_t = 'dirichlet_0' for channel flow. |
---|
[116] | 231 | ! Multigrid solver allows topography, checking of dt_sort_particles |
---|
[121] | 232 | ! Bugfix: initializing u_init and v_init in case of ocean runs |
---|
[110] | 233 | ! |
---|
| 234 | ! 109 2007-08-28 15:26:47Z letzel |
---|
[102] | 235 | ! Check coupling_mode and set default (obligatory) values (like boundary |
---|
[106] | 236 | ! conditions for temperature and fluxes) in case of coupled runs. |
---|
| 237 | ! +profiles for w*p* and w"e |
---|
[104] | 238 | ! Bugfix: Error message concerning output of particle concentration (pc) |
---|
| 239 | ! modified |
---|
[108] | 240 | ! More checks and more default values for coupled runs |
---|
| 241 | ! allow data_output_pr= q, wq, w"q", w*q* for humidity = .T. (instead of |
---|
| 242 | ! cloud_physics = .T.) |
---|
| 243 | ! Rayleigh damping for ocean fixed. |
---|
[109] | 244 | ! Check and, if necessary, set default value for dt_coupling |
---|
[98] | 245 | ! |
---|
| 246 | ! 97 2007-06-21 08:23:15Z raasch |
---|
[97] | 247 | ! Initial salinity profile is calculated, salinity boundary conditions are |
---|
| 248 | ! checked, |
---|
[94] | 249 | ! z_max_do1d is checked only in case of ocean = .f., |
---|
[97] | 250 | ! +initial temperature and geostrophic velocity profiles for the ocean version, |
---|
| 251 | ! use_pt_reference renamed use_reference |
---|
[77] | 252 | ! |
---|
[90] | 253 | ! 89 2007-05-25 12:08:31Z raasch |
---|
| 254 | ! Check for user-defined profiles |
---|
| 255 | ! |
---|
[77] | 256 | ! 75 2007-03-22 09:54:05Z raasch |
---|
[51] | 257 | ! "by_user" allowed as initializing action, -data_output_ts, |
---|
[63] | 258 | ! leapfrog with non-flat topography not allowed any more, loop_optimization |
---|
[75] | 259 | ! and pt_reference are checked, moisture renamed humidity, |
---|
[72] | 260 | ! output of precipitation amount/rate and roughnes length + check |
---|
[73] | 261 | ! possible negative humidities are avoided in initial profile, |
---|
[75] | 262 | ! dirichlet/neumann changed to dirichlet/radiation, etc., |
---|
| 263 | ! revision added to run_description_header |
---|
[1] | 264 | ! |
---|
[39] | 265 | ! 20 2007-02-26 00:12:32Z raasch |
---|
| 266 | ! Temperature and humidity gradients at top are now calculated for nzt+1, |
---|
| 267 | ! top_heatflux and respective boundary condition bc_pt_t is checked |
---|
| 268 | ! |
---|
[3] | 269 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 270 | ! |
---|
[1] | 271 | ! Revision 1.61 2006/08/04 14:20:25 raasch |
---|
| 272 | ! do2d_unit and do3d_unit now defined as 2d-arrays, check of |
---|
| 273 | ! use_upstream_for_tke, default value for dt_dopts, |
---|
| 274 | ! generation of file header moved from routines palm and header to here |
---|
| 275 | ! |
---|
| 276 | ! Revision 1.1 1997/08/26 06:29:23 raasch |
---|
| 277 | ! Initial revision |
---|
| 278 | ! |
---|
| 279 | ! |
---|
| 280 | ! Description: |
---|
| 281 | ! ------------ |
---|
| 282 | ! Check control parameters and deduce further quantities. |
---|
| 283 | !------------------------------------------------------------------------------! |
---|
| 284 | |
---|
| 285 | USE arrays_3d |
---|
[824] | 286 | USE cloud_parameters |
---|
[1] | 287 | USE constants |
---|
| 288 | USE control_parameters |
---|
[264] | 289 | USE dvrp_variables |
---|
[1] | 290 | USE grid_variables |
---|
| 291 | USE indices |
---|
| 292 | USE model_1d |
---|
| 293 | USE netcdf_control |
---|
| 294 | USE particle_attributes |
---|
| 295 | USE pegrid |
---|
| 296 | USE profil_parameter |
---|
[411] | 297 | USE subsidence_mod |
---|
[1] | 298 | USE statistics |
---|
| 299 | USE transpose_indices |
---|
| 300 | |
---|
| 301 | IMPLICIT NONE |
---|
| 302 | |
---|
| 303 | CHARACTER (LEN=1) :: sq |
---|
| 304 | CHARACTER (LEN=6) :: var |
---|
| 305 | CHARACTER (LEN=7) :: unit |
---|
| 306 | CHARACTER (LEN=8) :: date |
---|
| 307 | CHARACTER (LEN=10) :: time |
---|
[102] | 308 | CHARACTER (LEN=40) :: coupling_string |
---|
[1] | 309 | CHARACTER (LEN=100) :: action |
---|
| 310 | |
---|
[1092] | 311 | INTEGER :: i, ilen, iremote = 0, j, k, kk, position, prec |
---|
[1] | 312 | LOGICAL :: found, ldum |
---|
[1092] | 313 | REAL :: gradient, remote = 0.0, simulation_time_since_reference |
---|
[1] | 314 | |
---|
| 315 | ! |
---|
| 316 | !-- Warning, if host is not set |
---|
| 317 | IF ( host(1:1) == ' ' ) THEN |
---|
[213] | 318 | message_string = '"host" is not set. Please check that environment ' // & |
---|
| 319 | 'variable "localhost" & is set before running PALM' |
---|
[226] | 320 | CALL message( 'check_parameters', 'PA0001', 0, 0, 0, 6, 0 ) |
---|
[1] | 321 | ENDIF |
---|
| 322 | |
---|
| 323 | ! |
---|
[102] | 324 | !-- Check the coupling mode |
---|
| 325 | IF ( coupling_mode /= 'uncoupled' .AND. & |
---|
| 326 | coupling_mode /= 'atmosphere_to_ocean' .AND. & |
---|
| 327 | coupling_mode /= 'ocean_to_atmosphere' ) THEN |
---|
[213] | 328 | message_string = 'illegal coupling mode: ' // TRIM( coupling_mode ) |
---|
[226] | 329 | CALL message( 'check_parameters', 'PA0002', 1, 2, 0, 6, 0 ) |
---|
[102] | 330 | ENDIF |
---|
| 331 | |
---|
| 332 | ! |
---|
[108] | 333 | !-- Check dt_coupling, restart_time, dt_restart, end_time, dx, dy, nx and ny |
---|
[667] | 334 | IF ( coupling_mode /= 'uncoupled') THEN |
---|
[213] | 335 | |
---|
[108] | 336 | IF ( dt_coupling == 9999999.9 ) THEN |
---|
[213] | 337 | message_string = 'dt_coupling is not set but required for coup' // & |
---|
| 338 | 'ling mode "' // TRIM( coupling_mode ) // '"' |
---|
[226] | 339 | CALL message( 'check_parameters', 'PA0003', 1, 2, 0, 6, 0 ) |
---|
[108] | 340 | ENDIF |
---|
[213] | 341 | |
---|
[206] | 342 | #if defined( __parallel ) |
---|
[807] | 343 | |
---|
| 344 | ! |
---|
| 345 | !-- NOTE: coupled runs have not been implemented in the check_namelist_files |
---|
| 346 | !-- program. |
---|
| 347 | !-- check_namelist_files will need the following information of the other |
---|
| 348 | !-- model (atmosphere/ocean). |
---|
[845] | 349 | ! dt_coupling = remote |
---|
| 350 | ! dt_max = remote |
---|
| 351 | ! restart_time = remote |
---|
| 352 | ! dt_restart= remote |
---|
| 353 | ! simulation_time_since_reference = remote |
---|
| 354 | ! dx = remote |
---|
[807] | 355 | |
---|
| 356 | |
---|
[809] | 357 | #if ! defined( __check ) |
---|
[667] | 358 | IF ( myid == 0 ) THEN |
---|
| 359 | CALL MPI_SEND( dt_coupling, 1, MPI_REAL, target_id, 11, comm_inter, & |
---|
| 360 | ierr ) |
---|
| 361 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 11, comm_inter, & |
---|
| 362 | status, ierr ) |
---|
| 363 | ENDIF |
---|
| 364 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[807] | 365 | #endif |
---|
[108] | 366 | IF ( dt_coupling /= remote ) THEN |
---|
[213] | 367 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
| 368 | '": dt_coupling = ', dt_coupling, '& is not equal to ', & |
---|
| 369 | 'dt_coupling_remote = ', remote |
---|
[226] | 370 | CALL message( 'check_parameters', 'PA0004', 1, 2, 0, 6, 0 ) |
---|
[108] | 371 | ENDIF |
---|
[109] | 372 | IF ( dt_coupling <= 0.0 ) THEN |
---|
[809] | 373 | #if ! defined( __check ) |
---|
[667] | 374 | IF ( myid == 0 ) THEN |
---|
| 375 | CALL MPI_SEND( dt_max, 1, MPI_REAL, target_id, 19, comm_inter, ierr ) |
---|
| 376 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 19, comm_inter, & |
---|
| 377 | status, ierr ) |
---|
| 378 | ENDIF |
---|
| 379 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[807] | 380 | #endif |
---|
[109] | 381 | dt_coupling = MAX( dt_max, remote ) |
---|
[213] | 382 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
| 383 | '": dt_coupling <= 0.0 & is not allowed and is reset to ', & |
---|
| 384 | 'MAX(dt_max(A,O)) = ', dt_coupling |
---|
[226] | 385 | CALL message( 'check_parameters', 'PA0005', 0, 1, 0, 6, 0 ) |
---|
[109] | 386 | ENDIF |
---|
[809] | 387 | #if ! defined( __check ) |
---|
[667] | 388 | IF ( myid == 0 ) THEN |
---|
| 389 | CALL MPI_SEND( restart_time, 1, MPI_REAL, target_id, 12, comm_inter, & |
---|
| 390 | ierr ) |
---|
| 391 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 12, comm_inter, & |
---|
| 392 | status, ierr ) |
---|
| 393 | ENDIF |
---|
| 394 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[807] | 395 | #endif |
---|
[108] | 396 | IF ( restart_time /= remote ) THEN |
---|
[213] | 397 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
| 398 | '": restart_time = ', restart_time, '& is not equal to ', & |
---|
| 399 | 'restart_time_remote = ', remote |
---|
[226] | 400 | CALL message( 'check_parameters', 'PA0006', 1, 2, 0, 6, 0 ) |
---|
[108] | 401 | ENDIF |
---|
[809] | 402 | #if ! defined( __check ) |
---|
[667] | 403 | IF ( myid == 0 ) THEN |
---|
| 404 | CALL MPI_SEND( dt_restart, 1, MPI_REAL, target_id, 13, comm_inter, & |
---|
| 405 | ierr ) |
---|
| 406 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 13, comm_inter, & |
---|
| 407 | status, ierr ) |
---|
| 408 | ENDIF |
---|
| 409 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[807] | 410 | #endif |
---|
[108] | 411 | IF ( dt_restart /= remote ) THEN |
---|
[213] | 412 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
| 413 | '": dt_restart = ', dt_restart, '& is not equal to ', & |
---|
| 414 | 'dt_restart_remote = ', remote |
---|
[226] | 415 | CALL message( 'check_parameters', 'PA0007', 1, 2, 0, 6, 0 ) |
---|
[108] | 416 | ENDIF |
---|
[213] | 417 | |
---|
[291] | 418 | simulation_time_since_reference = end_time - coupling_start_time |
---|
[809] | 419 | #if ! defined( __check ) |
---|
[667] | 420 | IF ( myid == 0 ) THEN |
---|
| 421 | CALL MPI_SEND( simulation_time_since_reference, 1, MPI_REAL, target_id, & |
---|
| 422 | 14, comm_inter, ierr ) |
---|
| 423 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 14, comm_inter, & |
---|
| 424 | status, ierr ) |
---|
| 425 | ENDIF |
---|
| 426 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[807] | 427 | #endif |
---|
[291] | 428 | IF ( simulation_time_since_reference /= remote ) THEN |
---|
[213] | 429 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
[291] | 430 | '": simulation_time_since_reference = ', & |
---|
| 431 | simulation_time_since_reference, '& is not equal to ', & |
---|
| 432 | 'simulation_time_since_reference_remote = ', remote |
---|
[226] | 433 | CALL message( 'check_parameters', 'PA0008', 1, 2, 0, 6, 0 ) |
---|
[108] | 434 | ENDIF |
---|
[213] | 435 | |
---|
[809] | 436 | #if ! defined( __check ) |
---|
[667] | 437 | IF ( myid == 0 ) THEN |
---|
| 438 | CALL MPI_SEND( dx, 1, MPI_REAL, target_id, 15, comm_inter, ierr ) |
---|
| 439 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 15, comm_inter, & |
---|
| 440 | status, ierr ) |
---|
[108] | 441 | ENDIF |
---|
[667] | 442 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[213] | 443 | |
---|
[807] | 444 | #endif |
---|
[667] | 445 | IF ( coupling_mode == 'atmosphere_to_ocean') THEN |
---|
| 446 | |
---|
| 447 | IF ( dx < remote ) THEN |
---|
| 448 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 449 | TRIM( coupling_mode ), & |
---|
| 450 | '": dx in Atmosphere is not equal to or not larger then dx in ocean' |
---|
| 451 | CALL message( 'check_parameters', 'PA0009', 1, 2, 0, 6, 0 ) |
---|
| 452 | ENDIF |
---|
| 453 | |
---|
| 454 | IF ( (nx_a+1)*dx /= (nx_o+1)*remote ) THEN |
---|
| 455 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 456 | TRIM( coupling_mode ), & |
---|
| 457 | '": Domain size in x-direction is not equal in ocean and atmosphere' |
---|
| 458 | CALL message( 'check_parameters', 'PA0010', 1, 2, 0, 6, 0 ) |
---|
| 459 | ENDIF |
---|
| 460 | |
---|
[108] | 461 | ENDIF |
---|
[213] | 462 | |
---|
[809] | 463 | #if ! defined( __check ) |
---|
[667] | 464 | IF ( myid == 0) THEN |
---|
| 465 | CALL MPI_SEND( dy, 1, MPI_REAL, target_id, 16, comm_inter, ierr ) |
---|
| 466 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 16, comm_inter, & |
---|
| 467 | status, ierr ) |
---|
[108] | 468 | ENDIF |
---|
[667] | 469 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[807] | 470 | #endif |
---|
[667] | 471 | IF ( coupling_mode == 'atmosphere_to_ocean') THEN |
---|
| 472 | |
---|
| 473 | IF ( dy < remote ) THEN |
---|
| 474 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 475 | TRIM( coupling_mode ), & |
---|
| 476 | '": dy in Atmosphere is not equal to or not larger then dy in ocean' |
---|
| 477 | CALL message( 'check_parameters', 'PA0011', 1, 2, 0, 6, 0 ) |
---|
| 478 | ENDIF |
---|
| 479 | |
---|
| 480 | IF ( (ny_a+1)*dy /= (ny_o+1)*remote ) THEN |
---|
| 481 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 482 | TRIM( coupling_mode ), & |
---|
| 483 | '": Domain size in y-direction is not equal in ocean and atmosphere' |
---|
| 484 | CALL message( 'check_parameters', 'PA0012', 1, 2, 0, 6, 0 ) |
---|
| 485 | ENDIF |
---|
| 486 | |
---|
| 487 | IF ( MOD(nx_o+1,nx_a+1) /= 0 ) THEN |
---|
| 488 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 489 | TRIM( coupling_mode ), & |
---|
| 490 | '": nx+1 in ocean is not divisible without remainder with nx+1 in', & |
---|
| 491 | ' atmosphere' |
---|
| 492 | CALL message( 'check_parameters', 'PA0339', 1, 2, 0, 6, 0 ) |
---|
| 493 | ENDIF |
---|
| 494 | |
---|
| 495 | IF ( MOD(ny_o+1,ny_a+1) /= 0 ) THEN |
---|
| 496 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 497 | TRIM( coupling_mode ), & |
---|
| 498 | '": ny+1 in ocean is not divisible without remainder with ny+1 in', & |
---|
| 499 | ' atmosphere' |
---|
| 500 | CALL message( 'check_parameters', 'PA0340', 1, 2, 0, 6, 0 ) |
---|
| 501 | ENDIF |
---|
| 502 | |
---|
[108] | 503 | ENDIF |
---|
[222] | 504 | #else |
---|
| 505 | WRITE( message_string, * ) 'coupling requires PALM to be called with', & |
---|
| 506 | ' ''mrun -K parallel''' |
---|
[226] | 507 | CALL message( 'check_parameters', 'PA0141', 1, 2, 0, 6, 0 ) |
---|
[108] | 508 | #endif |
---|
| 509 | ENDIF |
---|
| 510 | |
---|
[809] | 511 | #if defined( __parallel ) && ! defined ( __check ) |
---|
[108] | 512 | ! |
---|
| 513 | !-- Exchange via intercommunicator |
---|
[667] | 514 | IF ( coupling_mode == 'atmosphere_to_ocean' .AND. myid == 0 ) THEN |
---|
[206] | 515 | CALL MPI_SEND( humidity, 1, MPI_LOGICAL, target_id, 19, comm_inter, & |
---|
| 516 | ierr ) |
---|
[667] | 517 | ELSEIF ( coupling_mode == 'ocean_to_atmosphere' .AND. myid == 0) THEN |
---|
[206] | 518 | CALL MPI_RECV( humidity_remote, 1, MPI_LOGICAL, target_id, 19, & |
---|
| 519 | comm_inter, status, ierr ) |
---|
[108] | 520 | ENDIF |
---|
[667] | 521 | CALL MPI_BCAST( humidity_remote, 1, MPI_LOGICAL, 0, comm2d, ierr) |
---|
| 522 | |
---|
[108] | 523 | #endif |
---|
| 524 | |
---|
| 525 | |
---|
| 526 | ! |
---|
[1] | 527 | !-- Generate the file header which is used as a header for most of PALM's |
---|
| 528 | !-- output files |
---|
| 529 | CALL DATE_AND_TIME( date, time ) |
---|
| 530 | run_date = date(7:8)//'-'//date(5:6)//'-'//date(3:4) |
---|
| 531 | run_time = time(1:2)//':'//time(3:4)//':'//time(5:6) |
---|
[102] | 532 | IF ( coupling_mode == 'uncoupled' ) THEN |
---|
| 533 | coupling_string = '' |
---|
| 534 | ELSEIF ( coupling_mode == 'atmosphere_to_ocean' ) THEN |
---|
| 535 | coupling_string = ' coupled (atmosphere)' |
---|
| 536 | ELSEIF ( coupling_mode == 'ocean_to_atmosphere' ) THEN |
---|
| 537 | coupling_string = ' coupled (ocean)' |
---|
| 538 | ENDIF |
---|
[1] | 539 | |
---|
[102] | 540 | WRITE ( run_description_header, & |
---|
| 541 | '(A,2X,A,2X,A,A,A,I2.2,A,2X,A,A,2X,A,1X,A)' ) & |
---|
| 542 | TRIM( version ), TRIM( revision ), 'run: ', & |
---|
| 543 | TRIM( run_identifier ), '.', runnr, TRIM( coupling_string ), & |
---|
| 544 | 'host: ', TRIM( host ), run_date, run_time |
---|
[1] | 545 | |
---|
| 546 | ! |
---|
[63] | 547 | !-- Check the general loop optimization method |
---|
| 548 | IF ( loop_optimization == 'default' ) THEN |
---|
| 549 | IF ( host(1:3) == 'nec' ) THEN |
---|
| 550 | loop_optimization = 'vector' |
---|
| 551 | ELSE |
---|
| 552 | loop_optimization = 'cache' |
---|
| 553 | ENDIF |
---|
| 554 | ENDIF |
---|
| 555 | |
---|
[1015] | 556 | SELECT CASE ( TRIM( loop_optimization ) ) |
---|
| 557 | |
---|
[1019] | 558 | CASE ( 'acc', 'cache', 'vector' ) |
---|
[1015] | 559 | CONTINUE |
---|
| 560 | |
---|
| 561 | CASE DEFAULT |
---|
| 562 | message_string = 'illegal value given for loop_optimization: "' // & |
---|
| 563 | TRIM( loop_optimization ) // '"' |
---|
| 564 | CALL message( 'check_parameters', 'PA0013', 1, 2, 0, 6, 0 ) |
---|
| 565 | |
---|
| 566 | END SELECT |
---|
| 567 | |
---|
[63] | 568 | ! |
---|
[1] | 569 | !-- Check topography setting (check for illegal parameter combinations) |
---|
| 570 | IF ( topography /= 'flat' ) THEN |
---|
| 571 | action = ' ' |
---|
[861] | 572 | IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme') THEN |
---|
[1] | 573 | WRITE( action, '(A,A)' ) 'scalar_advec = ', scalar_advec |
---|
| 574 | ENDIF |
---|
[861] | 575 | IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' ) & |
---|
| 576 | THEN |
---|
[1] | 577 | WRITE( action, '(A,A)' ) 'momentum_advec = ', momentum_advec |
---|
| 578 | ENDIF |
---|
[114] | 579 | IF ( psolver == 'sor' ) THEN |
---|
[1] | 580 | WRITE( action, '(A,A)' ) 'psolver = ', psolver |
---|
| 581 | ENDIF |
---|
| 582 | IF ( sloping_surface ) THEN |
---|
| 583 | WRITE( action, '(A)' ) 'sloping surface = .TRUE.' |
---|
| 584 | ENDIF |
---|
| 585 | IF ( galilei_transformation ) THEN |
---|
| 586 | WRITE( action, '(A)' ) 'galilei_transformation = .TRUE.' |
---|
| 587 | ENDIF |
---|
[1115] | 588 | IF ( cloud_physics ) THEN |
---|
| 589 | WRITE( action, '(A)' ) 'cloud_physics = .TRUE.' |
---|
| 590 | ENDIF |
---|
[1] | 591 | IF ( cloud_droplets ) THEN |
---|
[1115] | 592 | WRITE( action, '(A)' ) 'cloud_droplets = .TRUE.' |
---|
[1] | 593 | ENDIF |
---|
| 594 | IF ( .NOT. prandtl_layer ) THEN |
---|
| 595 | WRITE( action, '(A)' ) 'prandtl_layer = .FALSE.' |
---|
| 596 | ENDIF |
---|
| 597 | IF ( action /= ' ' ) THEN |
---|
[213] | 598 | message_string = 'a non-flat topography does not allow ' // & |
---|
| 599 | TRIM( action ) |
---|
[226] | 600 | CALL message( 'check_parameters', 'PA0014', 1, 2, 0, 6, 0 ) |
---|
[1] | 601 | ENDIF |
---|
[256] | 602 | ! |
---|
| 603 | !-- In case of non-flat topography, check whether the convention how to |
---|
| 604 | !-- define the topography grid has been set correctly, or whether the default |
---|
| 605 | !-- is applicable. If this is not possible, abort. |
---|
| 606 | IF ( TRIM( topography_grid_convention ) == ' ' ) THEN |
---|
| 607 | IF ( TRIM( topography ) /= 'single_building' .AND. & |
---|
| 608 | TRIM( topography ) /= 'single_street_canyon' .AND. & |
---|
| 609 | TRIM( topography ) /= 'read_from_file' ) THEN |
---|
| 610 | !-- The default value is not applicable here, because it is only valid |
---|
| 611 | !-- for the two standard cases 'single_building' and 'read_from_file' |
---|
| 612 | !-- defined in init_grid. |
---|
| 613 | WRITE( message_string, * ) & |
---|
| 614 | 'The value for "topography_grid_convention" ', & |
---|
| 615 | 'is not set. Its default value is & only valid for ', & |
---|
| 616 | '"topography" = ''single_building'', ', & |
---|
| 617 | '''single_street_canyon'' & or ''read_from_file''.', & |
---|
| 618 | ' & Choose ''cell_edge'' or ''cell_center''.' |
---|
| 619 | CALL message( 'user_check_parameters', 'PA0239', 1, 2, 0, 6, 0 ) |
---|
| 620 | ELSE |
---|
| 621 | !-- The default value is applicable here. |
---|
| 622 | !-- Set convention according to topography. |
---|
| 623 | IF ( TRIM( topography ) == 'single_building' .OR. & |
---|
| 624 | TRIM( topography ) == 'single_street_canyon' ) THEN |
---|
| 625 | topography_grid_convention = 'cell_edge' |
---|
| 626 | ELSEIF ( TRIM( topography ) == 'read_from_file' ) THEN |
---|
| 627 | topography_grid_convention = 'cell_center' |
---|
| 628 | ENDIF |
---|
| 629 | ENDIF |
---|
| 630 | ELSEIF ( TRIM( topography_grid_convention ) /= 'cell_edge' .AND. & |
---|
| 631 | TRIM( topography_grid_convention ) /= 'cell_center' ) THEN |
---|
| 632 | WRITE( message_string, * ) & |
---|
| 633 | 'The value for "topography_grid_convention" is ', & |
---|
| 634 | 'not recognized. & Choose ''cell_edge'' or ''cell_center''.' |
---|
| 635 | CALL message( 'user_check_parameters', 'PA0240', 1, 2, 0, 6, 0 ) |
---|
| 636 | ENDIF |
---|
| 637 | |
---|
[1] | 638 | ENDIF |
---|
[94] | 639 | |
---|
[1] | 640 | ! |
---|
[94] | 641 | !-- Check ocean setting |
---|
| 642 | IF ( ocean ) THEN |
---|
[332] | 643 | |
---|
[94] | 644 | action = ' ' |
---|
| 645 | IF ( action /= ' ' ) THEN |
---|
[213] | 646 | message_string = 'ocean = .T. does not allow ' // TRIM( action ) |
---|
[226] | 647 | CALL message( 'check_parameters', 'PA0015', 1, 2, 0, 6, 0 ) |
---|
[94] | 648 | ENDIF |
---|
| 649 | |
---|
[332] | 650 | ELSEIF ( TRIM( coupling_mode ) == 'uncoupled' .AND. & |
---|
| 651 | TRIM( coupling_char ) == '_O' ) THEN |
---|
[343] | 652 | |
---|
[94] | 653 | ! |
---|
[332] | 654 | !-- Check whether an (uncoupled) atmospheric run has been declared as an |
---|
| 655 | !-- ocean run (this setting is done via mrun-option -y) |
---|
[343] | 656 | |
---|
[291] | 657 | message_string = 'ocean = .F. does not allow coupling_char = "' // & |
---|
| 658 | TRIM( coupling_char ) // '" set by mrun-option "-y"' |
---|
| 659 | CALL message( 'check_parameters', 'PA0317', 1, 2, 0, 6, 0 ) |
---|
[332] | 660 | |
---|
[291] | 661 | ENDIF |
---|
| 662 | ! |
---|
[1053] | 663 | !-- Check cloud scheme |
---|
| 664 | IF ( cloud_scheme == 'seifert_beheng' ) THEN |
---|
| 665 | icloud_scheme = 0 |
---|
| 666 | ELSEIF ( cloud_scheme == 'kessler' ) THEN |
---|
| 667 | icloud_scheme = 1 |
---|
| 668 | ELSE |
---|
| 669 | message_string = 'unknown cloud microphysics scheme cloud_scheme ="' // & |
---|
| 670 | TRIM( cloud_scheme ) // '"' |
---|
| 671 | CALL message( 'check_parameters', 'PA0357', 1, 2, 0, 6, 0 ) |
---|
| 672 | ENDIF |
---|
| 673 | ! |
---|
[1] | 674 | !-- Check whether there are any illegal values |
---|
| 675 | !-- Pressure solver: |
---|
| 676 | IF ( psolver /= 'poisfft' .AND. psolver /= 'poisfft_hybrid' .AND. & |
---|
| 677 | psolver /= 'sor' .AND. psolver /= 'multigrid' ) THEN |
---|
[213] | 678 | message_string = 'unknown solver for perturbation pressure: psolver' // & |
---|
| 679 | ' = "' // TRIM( psolver ) // '"' |
---|
[226] | 680 | CALL message( 'check_parameters', 'PA0016', 1, 2, 0, 6, 0 ) |
---|
[1] | 681 | ENDIF |
---|
| 682 | |
---|
| 683 | #if defined( __parallel ) |
---|
| 684 | IF ( psolver == 'poisfft_hybrid' .AND. pdims(2) /= 1 ) THEN |
---|
[213] | 685 | message_string = 'psolver = "' // TRIM( psolver ) // '" only works ' // & |
---|
| 686 | 'for a 1d domain-decomposition along x & please do' // & |
---|
| 687 | ' not set npey/=1 in the parameter file' |
---|
[226] | 688 | CALL message( 'check_parameters', 'PA0017', 1, 2, 0, 6, 0 ) |
---|
[1] | 689 | ENDIF |
---|
| 690 | #else |
---|
| 691 | IF ( psolver == 'poisfft_hybrid' ) THEN |
---|
[213] | 692 | message_string = 'psolver = "' // TRIM( psolver ) // '" only works' // & |
---|
| 693 | ' for a parallel environment' |
---|
[226] | 694 | CALL message( 'check_parameters', 'PA0019', 1, 2, 0, 6, 0 ) |
---|
[1] | 695 | ENDIF |
---|
| 696 | #endif |
---|
| 697 | |
---|
| 698 | IF ( psolver == 'multigrid' ) THEN |
---|
| 699 | IF ( cycle_mg == 'w' ) THEN |
---|
| 700 | gamma_mg = 2 |
---|
| 701 | ELSEIF ( cycle_mg == 'v' ) THEN |
---|
| 702 | gamma_mg = 1 |
---|
| 703 | ELSE |
---|
[213] | 704 | message_string = 'unknown multigrid cycle: cycle_mg = "' // & |
---|
| 705 | TRIM( cycle_mg ) // '"' |
---|
[226] | 706 | CALL message( 'check_parameters', 'PA0020', 1, 2, 0, 6, 0 ) |
---|
[1] | 707 | ENDIF |
---|
| 708 | ENDIF |
---|
| 709 | |
---|
| 710 | IF ( fft_method /= 'singleton-algorithm' .AND. & |
---|
| 711 | fft_method /= 'temperton-algorithm' .AND. & |
---|
[1210] | 712 | fft_method /= 'fftw' .AND. & |
---|
[1] | 713 | fft_method /= 'system-specific' ) THEN |
---|
[213] | 714 | message_string = 'unknown fft-algorithm: fft_method = "' // & |
---|
| 715 | TRIM( fft_method ) // '"' |
---|
[226] | 716 | CALL message( 'check_parameters', 'PA0021', 1, 2, 0, 6, 0 ) |
---|
[1] | 717 | ENDIF |
---|
[667] | 718 | |
---|
| 719 | IF( momentum_advec == 'ws-scheme' .AND. & |
---|
[688] | 720 | .NOT. call_psolver_at_all_substeps ) THEN |
---|
[667] | 721 | message_string = 'psolver must be called at each RK3 substep when "'//& |
---|
| 722 | TRIM(momentum_advec) // ' "is used for momentum_advec' |
---|
[685] | 723 | CALL message( 'check_parameters', 'PA0344', 1, 2, 0, 6, 0 ) |
---|
[667] | 724 | END IF |
---|
[1] | 725 | ! |
---|
| 726 | !-- Advection schemes: |
---|
[1001] | 727 | IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' ) & |
---|
| 728 | THEN |
---|
[214] | 729 | message_string = 'unknown advection scheme: momentum_advec = "' // & |
---|
| 730 | TRIM( momentum_advec ) // '"' |
---|
[226] | 731 | CALL message( 'check_parameters', 'PA0022', 1, 2, 0, 6, 0 ) |
---|
[1] | 732 | ENDIF |
---|
[1001] | 733 | IF ( ( momentum_advec == 'ws-scheme' .OR. scalar_advec == 'ws-scheme' ) & |
---|
| 734 | .AND. ( timestep_scheme == 'euler' .OR. & |
---|
| 735 | timestep_scheme == 'runge-kutta-2' ) ) & |
---|
| 736 | THEN |
---|
[667] | 737 | message_string = 'momentum_advec or scalar_advec = "' & |
---|
| 738 | // TRIM( momentum_advec ) // '" is not allowed with timestep_scheme = "' // & |
---|
| 739 | TRIM( timestep_scheme ) // '"' |
---|
[226] | 740 | CALL message( 'check_parameters', 'PA0023', 1, 2, 0, 6, 0 ) |
---|
[1] | 741 | ENDIF |
---|
[667] | 742 | IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme' .AND. & |
---|
[1001] | 743 | scalar_advec /= 'bc-scheme' ) & |
---|
| 744 | THEN |
---|
[214] | 745 | message_string = 'unknown advection scheme: scalar_advec = "' // & |
---|
| 746 | TRIM( scalar_advec ) // '"' |
---|
[226] | 747 | CALL message( 'check_parameters', 'PA0024', 1, 2, 0, 6, 0 ) |
---|
[1] | 748 | ENDIF |
---|
[1019] | 749 | IF ( scalar_advec == 'bc-scheme' .AND. loop_optimization == 'cache' ) & |
---|
| 750 | THEN |
---|
| 751 | message_string = 'advection_scheme scalar_advec = "' & |
---|
| 752 | // TRIM( scalar_advec ) // '" not implemented for & loop_optimization = "' // & |
---|
| 753 | TRIM( loop_optimization ) // '"' |
---|
| 754 | CALL message( 'check_parameters', 'PA0026', 1, 2, 0, 6, 0 ) |
---|
| 755 | ENDIF |
---|
[1] | 756 | |
---|
| 757 | IF ( use_sgs_for_particles .AND. .NOT. use_upstream_for_tke ) THEN |
---|
| 758 | use_upstream_for_tke = .TRUE. |
---|
[214] | 759 | message_string = 'use_upstream_for_tke set .TRUE. because ' // & |
---|
| 760 | 'use_sgs_for_particles = .TRUE.' |
---|
[226] | 761 | CALL message( 'check_parameters', 'PA0025', 0, 1, 0, 6, 0 ) |
---|
[1] | 762 | ENDIF |
---|
| 763 | |
---|
[824] | 764 | IF ( use_sgs_for_particles .AND. curvature_solution_effects ) THEN |
---|
| 765 | message_string = 'use_sgs_for_particles = .TRUE. not allowed with ' // & |
---|
| 766 | 'curvature_solution_effects = .TRUE.' |
---|
| 767 | CALL message( 'check_parameters', 'PA0349', 1, 2, 0, 6, 0 ) |
---|
| 768 | ENDIF |
---|
| 769 | |
---|
[1] | 770 | ! |
---|
[1019] | 771 | !-- Set LOGICAL switches to enhance performance |
---|
| 772 | IF ( momentum_advec == 'ws-scheme' ) ws_scheme_mom = .TRUE. |
---|
| 773 | IF ( scalar_advec == 'ws-scheme' ) ws_scheme_sca = .TRUE. |
---|
| 774 | |
---|
| 775 | ! |
---|
[1] | 776 | !-- Timestep schemes: |
---|
| 777 | SELECT CASE ( TRIM( timestep_scheme ) ) |
---|
| 778 | |
---|
| 779 | CASE ( 'euler' ) |
---|
| 780 | intermediate_timestep_count_max = 1 |
---|
| 781 | |
---|
| 782 | CASE ( 'runge-kutta-2' ) |
---|
| 783 | intermediate_timestep_count_max = 2 |
---|
| 784 | |
---|
| 785 | CASE ( 'runge-kutta-3' ) |
---|
| 786 | intermediate_timestep_count_max = 3 |
---|
| 787 | |
---|
| 788 | CASE DEFAULT |
---|
[214] | 789 | message_string = 'unknown timestep scheme: timestep_scheme = "' // & |
---|
| 790 | TRIM( timestep_scheme ) // '"' |
---|
[226] | 791 | CALL message( 'check_parameters', 'PA0027', 1, 2, 0, 6, 0 ) |
---|
[1] | 792 | |
---|
| 793 | END SELECT |
---|
| 794 | |
---|
[667] | 795 | IF ( (momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme') & |
---|
| 796 | .AND. timestep_scheme(1:5) == 'runge' ) THEN |
---|
[214] | 797 | message_string = 'momentum advection scheme "' // & |
---|
| 798 | TRIM( momentum_advec ) // '" & does not work with ' // & |
---|
| 799 | 'timestep_scheme "' // TRIM( timestep_scheme ) // '"' |
---|
[226] | 800 | CALL message( 'check_parameters', 'PA0029', 1, 2, 0, 6, 0 ) |
---|
[1] | 801 | ENDIF |
---|
| 802 | |
---|
[825] | 803 | ! |
---|
| 804 | !-- Collision kernels: |
---|
| 805 | SELECT CASE ( TRIM( collision_kernel ) ) |
---|
| 806 | |
---|
[828] | 807 | CASE ( 'hall', 'hall_fast' ) |
---|
[825] | 808 | hall_kernel = .TRUE. |
---|
| 809 | |
---|
| 810 | CASE ( 'palm' ) |
---|
| 811 | palm_kernel = .TRUE. |
---|
| 812 | |
---|
[828] | 813 | CASE ( 'wang', 'wang_fast' ) |
---|
[825] | 814 | wang_kernel = .TRUE. |
---|
| 815 | |
---|
| 816 | CASE ( 'none' ) |
---|
| 817 | |
---|
| 818 | |
---|
| 819 | CASE DEFAULT |
---|
| 820 | message_string = 'unknown collision kernel: collision_kernel = "' // & |
---|
| 821 | TRIM( collision_kernel ) // '"' |
---|
| 822 | CALL message( 'check_parameters', 'PA0350', 1, 2, 0, 6, 0 ) |
---|
| 823 | |
---|
| 824 | END SELECT |
---|
[828] | 825 | IF ( collision_kernel(6:9) == 'fast' ) use_kernel_tables = .TRUE. |
---|
[825] | 826 | |
---|
[147] | 827 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND. & |
---|
[328] | 828 | TRIM( initializing_actions ) /= 'cyclic_fill' ) THEN |
---|
[1] | 829 | ! |
---|
[214] | 830 | !-- No restart run: several initialising actions are possible |
---|
[1] | 831 | action = initializing_actions |
---|
| 832 | DO WHILE ( TRIM( action ) /= '' ) |
---|
| 833 | position = INDEX( action, ' ' ) |
---|
| 834 | SELECT CASE ( action(1:position-1) ) |
---|
| 835 | |
---|
| 836 | CASE ( 'set_constant_profiles', 'set_1d-model_profiles', & |
---|
[46] | 837 | 'by_user', 'initialize_vortex', 'initialize_ptanom' ) |
---|
[1] | 838 | action = action(position+1:) |
---|
| 839 | |
---|
| 840 | CASE DEFAULT |
---|
[214] | 841 | message_string = 'initializing_action = "' // & |
---|
| 842 | TRIM( action ) // '" unkown or not allowed' |
---|
[226] | 843 | CALL message( 'check_parameters', 'PA0030', 1, 2, 0, 6, 0 ) |
---|
[1] | 844 | |
---|
| 845 | END SELECT |
---|
| 846 | ENDDO |
---|
| 847 | ENDIF |
---|
[214] | 848 | |
---|
[680] | 849 | IF ( TRIM( initializing_actions ) == 'initialize_vortex' .AND. & |
---|
| 850 | conserve_volume_flow ) THEN |
---|
| 851 | message_string = 'initializing_actions = "initialize_vortex"' // & |
---|
| 852 | ' ist not allowed with conserve_volume_flow = .T.' |
---|
| 853 | CALL message( 'check_parameters', 'PA0343', 1, 2, 0, 6, 0 ) |
---|
| 854 | ENDIF |
---|
| 855 | |
---|
| 856 | |
---|
[1] | 857 | IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. & |
---|
| 858 | INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN |
---|
[214] | 859 | message_string = 'initializing_actions = "set_constant_profiles"' // & |
---|
| 860 | ' and "set_1d-model_profiles" are not allowed ' // & |
---|
| 861 | 'simultaneously' |
---|
[226] | 862 | CALL message( 'check_parameters', 'PA0031', 1, 2, 0, 6, 0 ) |
---|
[1] | 863 | ENDIF |
---|
[214] | 864 | |
---|
[46] | 865 | IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. & |
---|
| 866 | INDEX( initializing_actions, 'by_user' ) /= 0 ) THEN |
---|
[214] | 867 | message_string = 'initializing_actions = "set_constant_profiles"' // & |
---|
| 868 | ' and "by_user" are not allowed simultaneously' |
---|
[226] | 869 | CALL message( 'check_parameters', 'PA0032', 1, 2, 0, 6, 0 ) |
---|
[46] | 870 | ENDIF |
---|
[214] | 871 | |
---|
[46] | 872 | IF ( INDEX( initializing_actions, 'by_user' ) /= 0 .AND. & |
---|
| 873 | INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN |
---|
[214] | 874 | message_string = 'initializing_actions = "by_user" and ' // & |
---|
| 875 | '"set_1d-model_profiles" are not allowed simultaneously' |
---|
[226] | 876 | CALL message( 'check_parameters', 'PA0033', 1, 2, 0, 6, 0 ) |
---|
[46] | 877 | ENDIF |
---|
[1] | 878 | |
---|
[75] | 879 | IF ( cloud_physics .AND. .NOT. humidity ) THEN |
---|
[214] | 880 | WRITE( message_string, * ) 'cloud_physics = ', cloud_physics, ' is ', & |
---|
| 881 | 'not allowed with humidity = ', humidity |
---|
[226] | 882 | CALL message( 'check_parameters', 'PA0034', 1, 2, 0, 6, 0 ) |
---|
[1] | 883 | ENDIF |
---|
| 884 | |
---|
[72] | 885 | IF ( precipitation .AND. .NOT. cloud_physics ) THEN |
---|
[214] | 886 | WRITE( message_string, * ) 'precipitation = ', precipitation, ' is ', & |
---|
| 887 | 'not allowed with cloud_physics = ', cloud_physics |
---|
[226] | 888 | CALL message( 'check_parameters', 'PA0035', 1, 2, 0, 6, 0 ) |
---|
[72] | 889 | ENDIF |
---|
| 890 | |
---|
[75] | 891 | IF ( humidity .AND. sloping_surface ) THEN |
---|
[214] | 892 | message_string = 'humidity = .TRUE. and sloping_surface = .TRUE. ' // & |
---|
| 893 | 'are not allowed simultaneously' |
---|
[226] | 894 | CALL message( 'check_parameters', 'PA0036', 1, 2, 0, 6, 0 ) |
---|
[1] | 895 | ENDIF |
---|
| 896 | |
---|
[75] | 897 | IF ( passive_scalar .AND. humidity ) THEN |
---|
[214] | 898 | message_string = 'humidity = .TRUE. and passive_scalar = .TRUE. ' // & |
---|
| 899 | 'is not allowed simultaneously' |
---|
[226] | 900 | CALL message( 'check_parameters', 'PA0038', 1, 2, 0, 6, 0 ) |
---|
[1] | 901 | ENDIF |
---|
| 902 | |
---|
[138] | 903 | IF ( plant_canopy .AND. ( drag_coefficient == 0.0 ) ) THEN |
---|
[214] | 904 | message_string = 'plant_canopy = .TRUE. requires a non-zero drag ' // & |
---|
| 905 | 'coefficient & given value is drag_coefficient = 0.0' |
---|
[226] | 906 | CALL message( 'check_parameters', 'PA0041', 1, 2, 0, 6, 0 ) |
---|
[138] | 907 | ENDIF |
---|
| 908 | |
---|
[1053] | 909 | IF ( plant_canopy .AND. cloud_physics .AND. icloud_scheme == 0 ) THEN |
---|
| 910 | message_string = 'plant_canopy = .TRUE. requires cloud_scheme /=' // & |
---|
| 911 | ' seifert_beheng' |
---|
| 912 | CALL message( 'check_parameters', 'PA0360', 1, 2, 0, 6, 0 ) |
---|
| 913 | ENDIF |
---|
| 914 | |
---|
| 915 | IF ( loop_optimization /= 'cache' .AND. cloud_physics .AND. & |
---|
| 916 | icloud_scheme == 0 ) THEN |
---|
| 917 | message_string = 'cloud_scheme = seifert_beheng requires ' // & |
---|
| 918 | 'loop_optimization = cache' |
---|
| 919 | CALL message( 'check_parameters', 'PA0362', 1, 2, 0, 6, 0 ) |
---|
| 920 | ENDIF |
---|
| 921 | |
---|
[1115] | 922 | ! IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & |
---|
| 923 | ! .NOT. precipitation .AND. .NOT. drizzle ) THEN |
---|
| 924 | ! message_string = 'cloud_scheme = seifert_beheng requires ' // & |
---|
| 925 | ! 'precipitation = .TRUE. or drizzle = .TRUE.' |
---|
| 926 | ! CALL message( 'check_parameters', 'PA0363', 1, 2, 0, 6, 0 ) |
---|
| 927 | ! ENDIF |
---|
[1065] | 928 | |
---|
[1] | 929 | ! |
---|
| 930 | !-- In case of no model continuation run, check initialising parameters and |
---|
| 931 | !-- deduce further quantities |
---|
| 932 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN |
---|
| 933 | |
---|
| 934 | ! |
---|
[767] | 935 | !-- Initial profiles for 1D and 3D model, respectively (u,v further below) |
---|
[1] | 936 | pt_init = pt_surface |
---|
[1053] | 937 | IF ( humidity ) THEN |
---|
| 938 | q_init = q_surface |
---|
| 939 | ENDIF |
---|
[94] | 940 | IF ( ocean ) sa_init = sa_surface |
---|
| 941 | IF ( passive_scalar ) q_init = s_surface |
---|
[138] | 942 | IF ( plant_canopy ) lad = 0.0 |
---|
[1] | 943 | |
---|
| 944 | ! |
---|
| 945 | !-- |
---|
| 946 | !-- If required, compute initial profile of the geostrophic wind |
---|
| 947 | !-- (component ug) |
---|
| 948 | i = 1 |
---|
| 949 | gradient = 0.0 |
---|
[97] | 950 | |
---|
| 951 | IF ( .NOT. ocean ) THEN |
---|
| 952 | |
---|
| 953 | ug_vertical_gradient_level_ind(1) = 0 |
---|
| 954 | ug(0) = ug_surface |
---|
| 955 | DO k = 1, nzt+1 |
---|
[177] | 956 | IF ( i < 11 ) THEN |
---|
| 957 | IF ( ug_vertical_gradient_level(i) < zu(k) .AND. & |
---|
| 958 | ug_vertical_gradient_level(i) >= 0.0 ) THEN |
---|
| 959 | gradient = ug_vertical_gradient(i) / 100.0 |
---|
| 960 | ug_vertical_gradient_level_ind(i) = k - 1 |
---|
| 961 | i = i + 1 |
---|
[1] | 962 | ENDIF |
---|
[177] | 963 | ENDIF |
---|
[97] | 964 | IF ( gradient /= 0.0 ) THEN |
---|
| 965 | IF ( k /= 1 ) THEN |
---|
| 966 | ug(k) = ug(k-1) + dzu(k) * gradient |
---|
| 967 | ELSE |
---|
[1174] | 968 | ug(k) = ug_surface + dzu(k) * gradient |
---|
[97] | 969 | ENDIF |
---|
[1] | 970 | ELSE |
---|
[97] | 971 | ug(k) = ug(k-1) |
---|
[1] | 972 | ENDIF |
---|
[97] | 973 | ENDDO |
---|
[1] | 974 | |
---|
[97] | 975 | ELSE |
---|
| 976 | |
---|
| 977 | ug_vertical_gradient_level_ind(1) = nzt+1 |
---|
[121] | 978 | ug(nzt+1) = ug_surface |
---|
[667] | 979 | DO k = nzt, nzb, -1 |
---|
[177] | 980 | IF ( i < 11 ) THEN |
---|
| 981 | IF ( ug_vertical_gradient_level(i) > zu(k) .AND. & |
---|
| 982 | ug_vertical_gradient_level(i) <= 0.0 ) THEN |
---|
| 983 | gradient = ug_vertical_gradient(i) / 100.0 |
---|
| 984 | ug_vertical_gradient_level_ind(i) = k + 1 |
---|
| 985 | i = i + 1 |
---|
[97] | 986 | ENDIF |
---|
| 987 | ENDIF |
---|
| 988 | IF ( gradient /= 0.0 ) THEN |
---|
| 989 | IF ( k /= nzt ) THEN |
---|
| 990 | ug(k) = ug(k+1) - dzu(k+1) * gradient |
---|
| 991 | ELSE |
---|
| 992 | ug(k) = ug_surface - 0.5 * dzu(k+1) * gradient |
---|
| 993 | ug(k+1) = ug_surface + 0.5 * dzu(k+1) * gradient |
---|
| 994 | ENDIF |
---|
| 995 | ELSE |
---|
| 996 | ug(k) = ug(k+1) |
---|
| 997 | ENDIF |
---|
| 998 | ENDDO |
---|
| 999 | |
---|
| 1000 | ENDIF |
---|
| 1001 | |
---|
[1] | 1002 | ! |
---|
[767] | 1003 | !-- In case of no given gradients for ug, choose a zero gradient |
---|
[97] | 1004 | IF ( ug_vertical_gradient_level(1) == -9999999.9 ) THEN |
---|
[1] | 1005 | ug_vertical_gradient_level(1) = 0.0 |
---|
| 1006 | ENDIF |
---|
| 1007 | |
---|
| 1008 | ! |
---|
| 1009 | !-- |
---|
| 1010 | !-- If required, compute initial profile of the geostrophic wind |
---|
| 1011 | !-- (component vg) |
---|
| 1012 | i = 1 |
---|
| 1013 | gradient = 0.0 |
---|
[97] | 1014 | |
---|
| 1015 | IF ( .NOT. ocean ) THEN |
---|
| 1016 | |
---|
| 1017 | vg_vertical_gradient_level_ind(1) = 0 |
---|
| 1018 | vg(0) = vg_surface |
---|
| 1019 | DO k = 1, nzt+1 |
---|
[177] | 1020 | IF ( i < 11 ) THEN |
---|
| 1021 | IF ( vg_vertical_gradient_level(i) < zu(k) .AND. & |
---|
| 1022 | vg_vertical_gradient_level(i) >= 0.0 ) THEN |
---|
| 1023 | gradient = vg_vertical_gradient(i) / 100.0 |
---|
| 1024 | vg_vertical_gradient_level_ind(i) = k - 1 |
---|
| 1025 | i = i + 1 |
---|
[1] | 1026 | ENDIF |
---|
| 1027 | ENDIF |
---|
[97] | 1028 | IF ( gradient /= 0.0 ) THEN |
---|
| 1029 | IF ( k /= 1 ) THEN |
---|
| 1030 | vg(k) = vg(k-1) + dzu(k) * gradient |
---|
| 1031 | ELSE |
---|
[1174] | 1032 | vg(k) = vg_surface + dzu(k) * gradient |
---|
[97] | 1033 | ENDIF |
---|
[1] | 1034 | ELSE |
---|
[97] | 1035 | vg(k) = vg(k-1) |
---|
[1] | 1036 | ENDIF |
---|
[97] | 1037 | ENDDO |
---|
[1] | 1038 | |
---|
[97] | 1039 | ELSE |
---|
| 1040 | |
---|
[121] | 1041 | vg_vertical_gradient_level_ind(1) = nzt+1 |
---|
| 1042 | vg(nzt+1) = vg_surface |
---|
[667] | 1043 | DO k = nzt, nzb, -1 |
---|
[177] | 1044 | IF ( i < 11 ) THEN |
---|
| 1045 | IF ( vg_vertical_gradient_level(i) > zu(k) .AND. & |
---|
| 1046 | vg_vertical_gradient_level(i) <= 0.0 ) THEN |
---|
| 1047 | gradient = vg_vertical_gradient(i) / 100.0 |
---|
| 1048 | vg_vertical_gradient_level_ind(i) = k + 1 |
---|
| 1049 | i = i + 1 |
---|
[97] | 1050 | ENDIF |
---|
| 1051 | ENDIF |
---|
| 1052 | IF ( gradient /= 0.0 ) THEN |
---|
| 1053 | IF ( k /= nzt ) THEN |
---|
| 1054 | vg(k) = vg(k+1) - dzu(k+1) * gradient |
---|
| 1055 | ELSE |
---|
| 1056 | vg(k) = vg_surface - 0.5 * dzu(k+1) * gradient |
---|
| 1057 | vg(k+1) = vg_surface + 0.5 * dzu(k+1) * gradient |
---|
| 1058 | ENDIF |
---|
| 1059 | ELSE |
---|
| 1060 | vg(k) = vg(k+1) |
---|
| 1061 | ENDIF |
---|
| 1062 | ENDDO |
---|
| 1063 | |
---|
| 1064 | ENDIF |
---|
| 1065 | |
---|
[1] | 1066 | ! |
---|
[767] | 1067 | !-- In case of no given gradients for vg, choose a zero gradient |
---|
[97] | 1068 | IF ( vg_vertical_gradient_level(1) == -9999999.9 ) THEN |
---|
[1] | 1069 | vg_vertical_gradient_level(1) = 0.0 |
---|
| 1070 | ENDIF |
---|
| 1071 | |
---|
| 1072 | ! |
---|
[767] | 1073 | !-- Let the initial wind profiles be the calculated ug/vg profiles or |
---|
| 1074 | !-- interpolate them from wind profile data (if given) |
---|
| 1075 | IF ( u_profile(1) == 9999999.9 .AND. v_profile(1) == 9999999.9 ) THEN |
---|
| 1076 | |
---|
| 1077 | u_init = ug |
---|
| 1078 | v_init = vg |
---|
| 1079 | |
---|
| 1080 | ELSEIF ( u_profile(1) == 0.0 .AND. v_profile(1) == 0.0 ) THEN |
---|
| 1081 | |
---|
| 1082 | IF ( uv_heights(1) /= 0.0 ) THEN |
---|
| 1083 | message_string = 'uv_heights(1) must be 0.0' |
---|
| 1084 | CALL message( 'check_parameters', 'PA0345', 1, 2, 0, 6, 0 ) |
---|
| 1085 | ENDIF |
---|
| 1086 | |
---|
| 1087 | use_prescribed_profile_data = .TRUE. |
---|
| 1088 | |
---|
| 1089 | kk = 1 |
---|
| 1090 | u_init(0) = 0.0 |
---|
| 1091 | v_init(0) = 0.0 |
---|
| 1092 | |
---|
| 1093 | DO k = 1, nz+1 |
---|
| 1094 | |
---|
| 1095 | IF ( kk < 100 ) THEN |
---|
| 1096 | DO WHILE ( uv_heights(kk+1) <= zu(k) ) |
---|
| 1097 | kk = kk + 1 |
---|
| 1098 | IF ( kk == 100 ) EXIT |
---|
| 1099 | ENDDO |
---|
| 1100 | ENDIF |
---|
| 1101 | |
---|
[774] | 1102 | IF ( kk < 100 .AND. uv_heights(kk+1) /= 9999999.9 ) THEN |
---|
[767] | 1103 | u_init(k) = u_profile(kk) + ( zu(k) - uv_heights(kk) ) / & |
---|
| 1104 | ( uv_heights(kk+1) - uv_heights(kk) ) * & |
---|
| 1105 | ( u_profile(kk+1) - u_profile(kk) ) |
---|
| 1106 | v_init(k) = v_profile(kk) + ( zu(k) - uv_heights(kk) ) / & |
---|
| 1107 | ( uv_heights(kk+1) - uv_heights(kk) ) * & |
---|
| 1108 | ( v_profile(kk+1) - v_profile(kk) ) |
---|
| 1109 | ELSE |
---|
| 1110 | u_init(k) = u_profile(kk) |
---|
| 1111 | v_init(k) = v_profile(kk) |
---|
| 1112 | ENDIF |
---|
| 1113 | |
---|
| 1114 | ENDDO |
---|
| 1115 | |
---|
| 1116 | ELSE |
---|
| 1117 | |
---|
| 1118 | message_string = 'u_profile(1) and v_profile(1) must be 0.0' |
---|
| 1119 | CALL message( 'check_parameters', 'PA0346', 1, 2, 0, 6, 0 ) |
---|
| 1120 | |
---|
| 1121 | ENDIF |
---|
| 1122 | |
---|
| 1123 | ! |
---|
[94] | 1124 | !-- Compute initial temperature profile using the given temperature gradients |
---|
[940] | 1125 | IF ( .NOT. neutral ) THEN |
---|
[94] | 1126 | |
---|
[940] | 1127 | i = 1 |
---|
| 1128 | gradient = 0.0 |
---|
[94] | 1129 | |
---|
[940] | 1130 | IF ( .NOT. ocean ) THEN |
---|
| 1131 | |
---|
| 1132 | pt_vertical_gradient_level_ind(1) = 0 |
---|
| 1133 | DO k = 1, nzt+1 |
---|
| 1134 | IF ( i < 11 ) THEN |
---|
| 1135 | IF ( pt_vertical_gradient_level(i) < zu(k) .AND. & |
---|
| 1136 | pt_vertical_gradient_level(i) >= 0.0 ) THEN |
---|
| 1137 | gradient = pt_vertical_gradient(i) / 100.0 |
---|
| 1138 | pt_vertical_gradient_level_ind(i) = k - 1 |
---|
| 1139 | i = i + 1 |
---|
| 1140 | ENDIF |
---|
[1] | 1141 | ENDIF |
---|
[940] | 1142 | IF ( gradient /= 0.0 ) THEN |
---|
| 1143 | IF ( k /= 1 ) THEN |
---|
| 1144 | pt_init(k) = pt_init(k-1) + dzu(k) * gradient |
---|
| 1145 | ELSE |
---|
[1174] | 1146 | pt_init(k) = pt_surface + dzu(k) * gradient |
---|
[940] | 1147 | ENDIF |
---|
[94] | 1148 | ELSE |
---|
[940] | 1149 | pt_init(k) = pt_init(k-1) |
---|
[94] | 1150 | ENDIF |
---|
[940] | 1151 | ENDDO |
---|
[1] | 1152 | |
---|
[940] | 1153 | ELSE |
---|
[94] | 1154 | |
---|
[940] | 1155 | pt_vertical_gradient_level_ind(1) = nzt+1 |
---|
| 1156 | DO k = nzt, 0, -1 |
---|
| 1157 | IF ( i < 11 ) THEN |
---|
| 1158 | IF ( pt_vertical_gradient_level(i) > zu(k) .AND. & |
---|
| 1159 | pt_vertical_gradient_level(i) <= 0.0 ) THEN |
---|
| 1160 | gradient = pt_vertical_gradient(i) / 100.0 |
---|
| 1161 | pt_vertical_gradient_level_ind(i) = k + 1 |
---|
| 1162 | i = i + 1 |
---|
| 1163 | ENDIF |
---|
[94] | 1164 | ENDIF |
---|
[940] | 1165 | IF ( gradient /= 0.0 ) THEN |
---|
| 1166 | IF ( k /= nzt ) THEN |
---|
| 1167 | pt_init(k) = pt_init(k+1) - dzu(k+1) * gradient |
---|
| 1168 | ELSE |
---|
| 1169 | pt_init(k) = pt_surface - 0.5 * dzu(k+1) * gradient |
---|
| 1170 | pt_init(k+1) = pt_surface + 0.5 * dzu(k+1) * gradient |
---|
| 1171 | ENDIF |
---|
[94] | 1172 | ELSE |
---|
[940] | 1173 | pt_init(k) = pt_init(k+1) |
---|
[94] | 1174 | ENDIF |
---|
[940] | 1175 | ENDDO |
---|
[94] | 1176 | |
---|
[940] | 1177 | ENDIF |
---|
| 1178 | |
---|
[94] | 1179 | ENDIF |
---|
| 1180 | |
---|
[1] | 1181 | ! |
---|
| 1182 | !-- In case of no given temperature gradients, choose gradient of neutral |
---|
| 1183 | !-- stratification |
---|
[94] | 1184 | IF ( pt_vertical_gradient_level(1) == -9999999.9 ) THEN |
---|
[1] | 1185 | pt_vertical_gradient_level(1) = 0.0 |
---|
| 1186 | ENDIF |
---|
| 1187 | |
---|
| 1188 | ! |
---|
[94] | 1189 | !-- Store temperature gradient at the top boundary for possible Neumann |
---|
[1] | 1190 | !-- boundary condition |
---|
[19] | 1191 | bc_pt_t_val = ( pt_init(nzt+1) - pt_init(nzt) ) / dzu(nzt+1) |
---|
[1] | 1192 | |
---|
| 1193 | ! |
---|
| 1194 | !-- If required, compute initial humidity or scalar profile using the given |
---|
| 1195 | !-- humidity/scalar gradient. In case of scalar transport, initially store |
---|
| 1196 | !-- values of the scalar parameters on humidity parameters |
---|
| 1197 | IF ( passive_scalar ) THEN |
---|
| 1198 | bc_q_b = bc_s_b |
---|
| 1199 | bc_q_t = bc_s_t |
---|
| 1200 | q_surface = s_surface |
---|
| 1201 | q_surface_initial_change = s_surface_initial_change |
---|
| 1202 | q_vertical_gradient = s_vertical_gradient |
---|
| 1203 | q_vertical_gradient_level = s_vertical_gradient_level |
---|
| 1204 | surface_waterflux = surface_scalarflux |
---|
[407] | 1205 | wall_humidityflux = wall_scalarflux |
---|
[1] | 1206 | ENDIF |
---|
| 1207 | |
---|
[75] | 1208 | IF ( humidity .OR. passive_scalar ) THEN |
---|
[1] | 1209 | |
---|
| 1210 | i = 1 |
---|
| 1211 | gradient = 0.0 |
---|
| 1212 | q_vertical_gradient_level_ind(1) = 0 |
---|
| 1213 | DO k = 1, nzt+1 |
---|
[177] | 1214 | IF ( i < 11 ) THEN |
---|
| 1215 | IF ( q_vertical_gradient_level(i) < zu(k) .AND. & |
---|
| 1216 | q_vertical_gradient_level(i) >= 0.0 ) THEN |
---|
| 1217 | gradient = q_vertical_gradient(i) / 100.0 |
---|
| 1218 | q_vertical_gradient_level_ind(i) = k - 1 |
---|
| 1219 | i = i + 1 |
---|
[1] | 1220 | ENDIF |
---|
| 1221 | ENDIF |
---|
| 1222 | IF ( gradient /= 0.0 ) THEN |
---|
| 1223 | IF ( k /= 1 ) THEN |
---|
| 1224 | q_init(k) = q_init(k-1) + dzu(k) * gradient |
---|
| 1225 | ELSE |
---|
[1174] | 1226 | q_init(k) = q_init(k-1) + dzu(k) * gradient |
---|
[1] | 1227 | ENDIF |
---|
| 1228 | ELSE |
---|
| 1229 | q_init(k) = q_init(k-1) |
---|
| 1230 | ENDIF |
---|
[72] | 1231 | ! |
---|
| 1232 | !-- Avoid negative humidities |
---|
| 1233 | IF ( q_init(k) < 0.0 ) THEN |
---|
| 1234 | q_init(k) = 0.0 |
---|
| 1235 | ENDIF |
---|
[1] | 1236 | ENDDO |
---|
| 1237 | |
---|
| 1238 | ! |
---|
| 1239 | !-- In case of no given humidity gradients, choose zero gradient |
---|
| 1240 | !-- conditions |
---|
| 1241 | IF ( q_vertical_gradient_level(1) == -1.0 ) THEN |
---|
| 1242 | q_vertical_gradient_level(1) = 0.0 |
---|
| 1243 | ENDIF |
---|
| 1244 | ! |
---|
[1053] | 1245 | !-- Store humidity, rain water content and rain drop concentration |
---|
| 1246 | !-- gradient at the top boundary for possile Neumann boundary condition |
---|
| 1247 | bc_q_t_val = ( q_init(nzt+1) - q_init(nzt) ) / dzu(nzt+1) |
---|
[1] | 1248 | ENDIF |
---|
| 1249 | |
---|
[94] | 1250 | ! |
---|
| 1251 | !-- If required, compute initial salinity profile using the given salinity |
---|
| 1252 | !-- gradients |
---|
| 1253 | IF ( ocean ) THEN |
---|
| 1254 | |
---|
| 1255 | i = 1 |
---|
| 1256 | gradient = 0.0 |
---|
| 1257 | |
---|
| 1258 | sa_vertical_gradient_level_ind(1) = nzt+1 |
---|
| 1259 | DO k = nzt, 0, -1 |
---|
[177] | 1260 | IF ( i < 11 ) THEN |
---|
| 1261 | IF ( sa_vertical_gradient_level(i) > zu(k) .AND. & |
---|
| 1262 | sa_vertical_gradient_level(i) <= 0.0 ) THEN |
---|
| 1263 | gradient = sa_vertical_gradient(i) / 100.0 |
---|
| 1264 | sa_vertical_gradient_level_ind(i) = k + 1 |
---|
| 1265 | i = i + 1 |
---|
[94] | 1266 | ENDIF |
---|
| 1267 | ENDIF |
---|
| 1268 | IF ( gradient /= 0.0 ) THEN |
---|
| 1269 | IF ( k /= nzt ) THEN |
---|
| 1270 | sa_init(k) = sa_init(k+1) - dzu(k+1) * gradient |
---|
| 1271 | ELSE |
---|
| 1272 | sa_init(k) = sa_surface - 0.5 * dzu(k+1) * gradient |
---|
| 1273 | sa_init(k+1) = sa_surface + 0.5 * dzu(k+1) * gradient |
---|
| 1274 | ENDIF |
---|
| 1275 | ELSE |
---|
| 1276 | sa_init(k) = sa_init(k+1) |
---|
| 1277 | ENDIF |
---|
| 1278 | ENDDO |
---|
| 1279 | |
---|
| 1280 | ENDIF |
---|
| 1281 | |
---|
[138] | 1282 | ! |
---|
[388] | 1283 | !-- If required compute the profile of leaf area density used in the plant |
---|
| 1284 | !-- canopy model |
---|
[138] | 1285 | IF ( plant_canopy ) THEN |
---|
| 1286 | |
---|
| 1287 | i = 1 |
---|
| 1288 | gradient = 0.0 |
---|
[1] | 1289 | |
---|
[138] | 1290 | IF ( .NOT. ocean ) THEN |
---|
[153] | 1291 | |
---|
| 1292 | lad(0) = lad_surface |
---|
[138] | 1293 | |
---|
| 1294 | lad_vertical_gradient_level_ind(1) = 0 |
---|
| 1295 | DO k = 1, pch_index |
---|
[177] | 1296 | IF ( i < 11 ) THEN |
---|
| 1297 | IF ( lad_vertical_gradient_level(i) < zu(k) .AND. & |
---|
| 1298 | lad_vertical_gradient_level(i) >= 0.0 ) THEN |
---|
| 1299 | gradient = lad_vertical_gradient(i) |
---|
| 1300 | lad_vertical_gradient_level_ind(i) = k - 1 |
---|
| 1301 | i = i + 1 |
---|
[138] | 1302 | ENDIF |
---|
| 1303 | ENDIF |
---|
| 1304 | IF ( gradient /= 0.0 ) THEN |
---|
| 1305 | IF ( k /= 1 ) THEN |
---|
| 1306 | lad(k) = lad(k-1) + dzu(k) * gradient |
---|
| 1307 | ELSE |
---|
[1174] | 1308 | lad(k) = lad_surface + dzu(k) *gradient |
---|
[138] | 1309 | ENDIF |
---|
| 1310 | ELSE |
---|
| 1311 | lad(k) = lad(k-1) |
---|
| 1312 | ENDIF |
---|
| 1313 | ENDDO |
---|
| 1314 | |
---|
| 1315 | ENDIF |
---|
| 1316 | |
---|
[1] | 1317 | ! |
---|
[388] | 1318 | !-- In case of no given leaf area density gradients, choose a vanishing |
---|
| 1319 | !-- gradient |
---|
[138] | 1320 | IF ( lad_vertical_gradient_level(1) == -9999999.9 ) THEN |
---|
| 1321 | lad_vertical_gradient_level(1) = 0.0 |
---|
| 1322 | ENDIF |
---|
| 1323 | |
---|
| 1324 | ENDIF |
---|
| 1325 | |
---|
| 1326 | ENDIF |
---|
[411] | 1327 | |
---|
| 1328 | ! |
---|
| 1329 | !-- Initialize large scale subsidence if required |
---|
[580] | 1330 | IF ( subs_vertical_gradient_level(1) /= -9999999.9 ) THEN |
---|
[411] | 1331 | large_scale_subsidence = .TRUE. |
---|
| 1332 | CALL init_w_subsidence |
---|
[1179] | 1333 | ENDIF |
---|
[667] | 1334 | |
---|
[138] | 1335 | ! |
---|
[1] | 1336 | !-- Compute Coriolis parameter |
---|
| 1337 | f = 2.0 * omega * SIN( phi / 180.0 * pi ) |
---|
| 1338 | fs = 2.0 * omega * COS( phi / 180.0 * pi ) |
---|
| 1339 | |
---|
| 1340 | ! |
---|
[1179] | 1341 | !-- Check and set buoyancy related parameters and switches |
---|
| 1342 | IF ( reference_state == 'horizontal_average' ) THEN |
---|
| 1343 | CONTINUE |
---|
| 1344 | ELSEIF ( reference_state == 'initial_profile' ) THEN |
---|
| 1345 | use_initial_profile_as_reference = .TRUE. |
---|
| 1346 | ELSEIF ( reference_state == 'single_value' ) THEN |
---|
| 1347 | use_single_reference_value = .TRUE. |
---|
| 1348 | IF ( pt_reference == 9999999.9 ) pt_reference = pt_surface |
---|
| 1349 | vpt_reference = pt_reference * ( 1.0 + 0.61 * q_surface ) |
---|
| 1350 | ELSE |
---|
| 1351 | message_string = 'illegal value for reference_state: "' // & |
---|
| 1352 | TRIM( reference_state ) // '"' |
---|
| 1353 | CALL message( 'check_parameters', 'PA0056', 1, 2, 0, 6, 0 ) |
---|
| 1354 | ENDIF |
---|
[57] | 1355 | |
---|
| 1356 | ! |
---|
[1179] | 1357 | !-- Ocean runs always use reference values in the buoyancy term |
---|
| 1358 | IF ( ocean ) THEN |
---|
| 1359 | reference_state = 'single_value' |
---|
| 1360 | use_single_reference_value = .TRUE. |
---|
| 1361 | ENDIF |
---|
[97] | 1362 | |
---|
| 1363 | ! |
---|
| 1364 | !-- Sign of buoyancy/stability terms |
---|
| 1365 | IF ( ocean ) atmos_ocean_sign = -1.0 |
---|
| 1366 | |
---|
| 1367 | ! |
---|
[108] | 1368 | !-- Ocean version must use flux boundary conditions at the top |
---|
| 1369 | IF ( ocean .AND. .NOT. use_top_fluxes ) THEN |
---|
[215] | 1370 | message_string = 'use_top_fluxes must be .TRUE. in ocean version' |
---|
[226] | 1371 | CALL message( 'check_parameters', 'PA0042', 1, 2, 0, 6, 0 ) |
---|
[108] | 1372 | ENDIF |
---|
[97] | 1373 | |
---|
| 1374 | ! |
---|
[1] | 1375 | !-- In case of a given slope, compute the relevant quantities |
---|
| 1376 | IF ( alpha_surface /= 0.0 ) THEN |
---|
| 1377 | IF ( ABS( alpha_surface ) > 90.0 ) THEN |
---|
[215] | 1378 | WRITE( message_string, * ) 'ABS( alpha_surface = ', alpha_surface, & |
---|
| 1379 | ' ) must be < 90.0' |
---|
[226] | 1380 | CALL message( 'check_parameters', 'PA0043', 1, 2, 0, 6, 0 ) |
---|
[1] | 1381 | ENDIF |
---|
| 1382 | sloping_surface = .TRUE. |
---|
| 1383 | cos_alpha_surface = COS( alpha_surface / 180.0 * pi ) |
---|
| 1384 | sin_alpha_surface = SIN( alpha_surface / 180.0 * pi ) |
---|
| 1385 | ENDIF |
---|
| 1386 | |
---|
| 1387 | ! |
---|
| 1388 | !-- Check time step and cfl_factor |
---|
| 1389 | IF ( dt /= -1.0 ) THEN |
---|
| 1390 | IF ( dt <= 0.0 .AND. dt /= -1.0 ) THEN |
---|
[215] | 1391 | WRITE( message_string, * ) 'dt = ', dt , ' <= 0.0' |
---|
[226] | 1392 | CALL message( 'check_parameters', 'PA0044', 1, 2, 0, 6, 0 ) |
---|
[1] | 1393 | ENDIF |
---|
| 1394 | dt_3d = dt |
---|
| 1395 | dt_fixed = .TRUE. |
---|
| 1396 | ENDIF |
---|
| 1397 | |
---|
| 1398 | IF ( cfl_factor <= 0.0 .OR. cfl_factor > 1.0 ) THEN |
---|
| 1399 | IF ( cfl_factor == -1.0 ) THEN |
---|
[1001] | 1400 | IF ( timestep_scheme == 'runge-kutta-2' ) THEN |
---|
[1] | 1401 | cfl_factor = 0.8 |
---|
[1001] | 1402 | ELSEIF ( timestep_scheme == 'runge-kutta-3' ) THEN |
---|
| 1403 | cfl_factor = 0.9 |
---|
[1] | 1404 | ELSE |
---|
[1001] | 1405 | cfl_factor = 0.9 |
---|
[1] | 1406 | ENDIF |
---|
| 1407 | ELSE |
---|
[215] | 1408 | WRITE( message_string, * ) 'cfl_factor = ', cfl_factor, & |
---|
| 1409 | ' out of range & 0.0 < cfl_factor <= 1.0 is required' |
---|
[226] | 1410 | CALL message( 'check_parameters', 'PA0045', 1, 2, 0, 6, 0 ) |
---|
[1] | 1411 | ENDIF |
---|
| 1412 | ENDIF |
---|
| 1413 | |
---|
| 1414 | ! |
---|
| 1415 | !-- Store simulated time at begin |
---|
| 1416 | simulated_time_at_begin = simulated_time |
---|
| 1417 | |
---|
| 1418 | ! |
---|
[291] | 1419 | !-- Store reference time for coupled runs and change the coupling flag, |
---|
| 1420 | !-- if ... |
---|
| 1421 | IF ( simulated_time == 0.0 ) THEN |
---|
| 1422 | IF ( coupling_start_time == 0.0 ) THEN |
---|
| 1423 | time_since_reference_point = 0.0 |
---|
| 1424 | ELSEIF ( time_since_reference_point < 0.0 ) THEN |
---|
| 1425 | run_coupled = .FALSE. |
---|
| 1426 | ENDIF |
---|
| 1427 | ENDIF |
---|
| 1428 | |
---|
| 1429 | ! |
---|
[1] | 1430 | !-- Set wind speed in the Galilei-transformed system |
---|
| 1431 | IF ( galilei_transformation ) THEN |
---|
[1053] | 1432 | IF ( use_ug_for_galilei_tr .AND. & |
---|
| 1433 | ug_vertical_gradient_level(1) == 0.0 .AND. & |
---|
| 1434 | ug_vertical_gradient(1) == 0.0 .AND. & |
---|
| 1435 | vg_vertical_gradient_level(1) == 0.0 .AND. & |
---|
| 1436 | vg_vertical_gradient(1) == 0.0 ) THEN |
---|
[866] | 1437 | u_gtrans = ug_surface * 0.6 |
---|
| 1438 | v_gtrans = vg_surface * 0.6 |
---|
[1053] | 1439 | ELSEIF ( use_ug_for_galilei_tr .AND. & |
---|
| 1440 | ( ug_vertical_gradient_level(1) /= 0.0 .OR. & |
---|
| 1441 | ug_vertical_gradient(1) /= 0.0 ) ) THEN |
---|
[215] | 1442 | message_string = 'baroclinicity (ug) not allowed simultaneously' // & |
---|
| 1443 | ' with galilei transformation' |
---|
[226] | 1444 | CALL message( 'check_parameters', 'PA0046', 1, 2, 0, 6, 0 ) |
---|
[1053] | 1445 | ELSEIF ( use_ug_for_galilei_tr .AND. & |
---|
| 1446 | ( vg_vertical_gradient_level(1) /= 0.0 .OR. & |
---|
| 1447 | vg_vertical_gradient(1) /= 0.0 ) ) THEN |
---|
[215] | 1448 | message_string = 'baroclinicity (vg) not allowed simultaneously' // & |
---|
| 1449 | ' with galilei transformation' |
---|
[226] | 1450 | CALL message( 'check_parameters', 'PA0047', 1, 2, 0, 6, 0 ) |
---|
[1] | 1451 | ELSE |
---|
[215] | 1452 | message_string = 'variable translation speed used for galilei-' // & |
---|
| 1453 | 'transformation, which may cause & instabilities in stably ' // & |
---|
| 1454 | 'stratified regions' |
---|
[226] | 1455 | CALL message( 'check_parameters', 'PA0048', 0, 1, 0, 6, 0 ) |
---|
[1] | 1456 | ENDIF |
---|
| 1457 | ENDIF |
---|
| 1458 | |
---|
| 1459 | ! |
---|
| 1460 | !-- In case of using a prandtl-layer, calculated (or prescribed) surface |
---|
| 1461 | !-- fluxes have to be used in the diffusion-terms |
---|
| 1462 | IF ( prandtl_layer ) use_surface_fluxes = .TRUE. |
---|
| 1463 | |
---|
| 1464 | ! |
---|
| 1465 | !-- Check boundary conditions and set internal variables: |
---|
| 1466 | !-- Lateral boundary conditions |
---|
[73] | 1467 | IF ( bc_lr /= 'cyclic' .AND. bc_lr /= 'dirichlet/radiation' .AND. & |
---|
[1159] | 1468 | bc_lr /= 'radiation/dirichlet' ) THEN |
---|
[215] | 1469 | message_string = 'unknown boundary condition: bc_lr = "' // & |
---|
| 1470 | TRIM( bc_lr ) // '"' |
---|
[226] | 1471 | CALL message( 'check_parameters', 'PA0049', 1, 2, 0, 6, 0 ) |
---|
[1] | 1472 | ENDIF |
---|
[73] | 1473 | IF ( bc_ns /= 'cyclic' .AND. bc_ns /= 'dirichlet/radiation' .AND. & |
---|
[1159] | 1474 | bc_ns /= 'radiation/dirichlet' ) THEN |
---|
[215] | 1475 | message_string = 'unknown boundary condition: bc_ns = "' // & |
---|
| 1476 | TRIM( bc_ns ) // '"' |
---|
[226] | 1477 | CALL message( 'check_parameters', 'PA0050', 1, 2, 0, 6, 0 ) |
---|
[1] | 1478 | ENDIF |
---|
| 1479 | |
---|
| 1480 | ! |
---|
[366] | 1481 | !-- Internal variables used for speed optimization in if clauses |
---|
[707] | 1482 | IF ( bc_lr /= 'cyclic' ) bc_lr_cyc = .FALSE. |
---|
| 1483 | IF ( bc_lr == 'dirichlet/radiation' ) bc_lr_dirrad = .TRUE. |
---|
| 1484 | IF ( bc_lr == 'radiation/dirichlet' ) bc_lr_raddir = .TRUE. |
---|
| 1485 | IF ( bc_ns /= 'cyclic' ) bc_ns_cyc = .FALSE. |
---|
| 1486 | IF ( bc_ns == 'dirichlet/radiation' ) bc_ns_dirrad = .TRUE. |
---|
| 1487 | IF ( bc_ns == 'radiation/dirichlet' ) bc_ns_raddir = .TRUE. |
---|
[366] | 1488 | |
---|
| 1489 | ! |
---|
[1] | 1490 | !-- Non-cyclic lateral boundaries require the multigrid method and Piascek- |
---|
[667] | 1491 | !-- Willimas or Wicker - Skamarock advection scheme. Several schemes |
---|
| 1492 | !-- and tools do not work with non-cyclic boundary conditions. |
---|
[1] | 1493 | IF ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic' ) THEN |
---|
| 1494 | IF ( psolver /= 'multigrid' ) THEN |
---|
[215] | 1495 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
| 1496 | 'psolver = "' // TRIM( psolver ) // '"' |
---|
[226] | 1497 | CALL message( 'check_parameters', 'PA0051', 1, 2, 0, 6, 0 ) |
---|
[1] | 1498 | ENDIF |
---|
[667] | 1499 | IF ( momentum_advec /= 'pw-scheme' .AND. & |
---|
| 1500 | momentum_advec /= 'ws-scheme') THEN |
---|
[215] | 1501 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
| 1502 | 'momentum_advec = "' // TRIM( momentum_advec ) // '"' |
---|
[226] | 1503 | CALL message( 'check_parameters', 'PA0052', 1, 2, 0, 6, 0 ) |
---|
[1] | 1504 | ENDIF |
---|
[667] | 1505 | IF ( scalar_advec /= 'pw-scheme' .AND. & |
---|
| 1506 | scalar_advec /= 'ws-scheme' ) THEN |
---|
[215] | 1507 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
| 1508 | 'scalar_advec = "' // TRIM( scalar_advec ) // '"' |
---|
[226] | 1509 | CALL message( 'check_parameters', 'PA0053', 1, 2, 0, 6, 0 ) |
---|
[1] | 1510 | ENDIF |
---|
| 1511 | IF ( galilei_transformation ) THEN |
---|
[215] | 1512 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
| 1513 | 'galilei_transformation = .T.' |
---|
[226] | 1514 | CALL message( 'check_parameters', 'PA0054', 1, 2, 0, 6, 0 ) |
---|
[1] | 1515 | ENDIF |
---|
| 1516 | ENDIF |
---|
| 1517 | |
---|
| 1518 | ! |
---|
| 1519 | !-- Bottom boundary condition for the turbulent Kinetic energy |
---|
| 1520 | IF ( bc_e_b == 'neumann' ) THEN |
---|
| 1521 | ibc_e_b = 1 |
---|
| 1522 | ELSEIF ( bc_e_b == '(u*)**2+neumann' ) THEN |
---|
| 1523 | ibc_e_b = 2 |
---|
[1015] | 1524 | IF ( prandtl_layer ) THEN |
---|
| 1525 | message_string = 'adjust mixing length = FALSE and bc_e_b = "' // & |
---|
[215] | 1526 | TRIM( bc_e_b ) // '"' |
---|
[226] | 1527 | CALL message( 'check_parameters', 'PA0056', 0, 1, 0, 6, 0 ) |
---|
[1] | 1528 | ENDIF |
---|
| 1529 | IF ( .NOT. prandtl_layer ) THEN |
---|
| 1530 | bc_e_b = 'neumann' |
---|
| 1531 | ibc_e_b = 1 |
---|
[215] | 1532 | message_string = 'boundary condition bc_e_b changed to "' // & |
---|
| 1533 | TRIM( bc_e_b ) // '"' |
---|
[226] | 1534 | CALL message( 'check_parameters', 'PA0057', 0, 1, 0, 6, 0 ) |
---|
[1] | 1535 | ENDIF |
---|
| 1536 | ELSE |
---|
[215] | 1537 | message_string = 'unknown boundary condition: bc_e_b = "' // & |
---|
| 1538 | TRIM( bc_e_b ) // '"' |
---|
[226] | 1539 | CALL message( 'check_parameters', 'PA0058', 1, 2, 0, 6, 0 ) |
---|
[1] | 1540 | ENDIF |
---|
| 1541 | |
---|
| 1542 | ! |
---|
| 1543 | !-- Boundary conditions for perturbation pressure |
---|
| 1544 | IF ( bc_p_b == 'dirichlet' ) THEN |
---|
| 1545 | ibc_p_b = 0 |
---|
| 1546 | ELSEIF ( bc_p_b == 'neumann' ) THEN |
---|
| 1547 | ibc_p_b = 1 |
---|
| 1548 | ELSE |
---|
[215] | 1549 | message_string = 'unknown boundary condition: bc_p_b = "' // & |
---|
| 1550 | TRIM( bc_p_b ) // '"' |
---|
[226] | 1551 | CALL message( 'check_parameters', 'PA0059', 1, 2, 0, 6, 0 ) |
---|
[1] | 1552 | ENDIF |
---|
[1111] | 1553 | |
---|
[1] | 1554 | IF ( bc_p_t == 'dirichlet' ) THEN |
---|
| 1555 | ibc_p_t = 0 |
---|
| 1556 | ELSEIF ( bc_p_t == 'neumann' ) THEN |
---|
| 1557 | ibc_p_t = 1 |
---|
| 1558 | ELSE |
---|
[215] | 1559 | message_string = 'unknown boundary condition: bc_p_t = "' // & |
---|
| 1560 | TRIM( bc_p_t ) // '"' |
---|
[226] | 1561 | CALL message( 'check_parameters', 'PA0061', 1, 2, 0, 6, 0 ) |
---|
[1] | 1562 | ENDIF |
---|
| 1563 | |
---|
| 1564 | ! |
---|
| 1565 | !-- Boundary conditions for potential temperature |
---|
[102] | 1566 | IF ( coupling_mode == 'atmosphere_to_ocean' ) THEN |
---|
| 1567 | ibc_pt_b = 2 |
---|
[1] | 1568 | ELSE |
---|
[102] | 1569 | IF ( bc_pt_b == 'dirichlet' ) THEN |
---|
| 1570 | ibc_pt_b = 0 |
---|
| 1571 | ELSEIF ( bc_pt_b == 'neumann' ) THEN |
---|
| 1572 | ibc_pt_b = 1 |
---|
| 1573 | ELSE |
---|
[215] | 1574 | message_string = 'unknown boundary condition: bc_pt_b = "' // & |
---|
| 1575 | TRIM( bc_pt_b ) // '"' |
---|
[226] | 1576 | CALL message( 'check_parameters', 'PA0062', 1, 2, 0, 6, 0 ) |
---|
[1] | 1577 | ENDIF |
---|
| 1578 | ENDIF |
---|
[102] | 1579 | |
---|
[1] | 1580 | IF ( bc_pt_t == 'dirichlet' ) THEN |
---|
| 1581 | ibc_pt_t = 0 |
---|
| 1582 | ELSEIF ( bc_pt_t == 'neumann' ) THEN |
---|
| 1583 | ibc_pt_t = 1 |
---|
[19] | 1584 | ELSEIF ( bc_pt_t == 'initial_gradient' ) THEN |
---|
| 1585 | ibc_pt_t = 2 |
---|
[1] | 1586 | ELSE |
---|
[215] | 1587 | message_string = 'unknown boundary condition: bc_pt_t = "' // & |
---|
| 1588 | TRIM( bc_pt_t ) // '"' |
---|
[226] | 1589 | CALL message( 'check_parameters', 'PA0063', 1, 2, 0, 6, 0 ) |
---|
[1] | 1590 | ENDIF |
---|
| 1591 | |
---|
[20] | 1592 | IF ( surface_heatflux == 9999999.9 ) constant_heatflux = .FALSE. |
---|
| 1593 | IF ( top_heatflux == 9999999.9 ) constant_top_heatflux = .FALSE. |
---|
[940] | 1594 | |
---|
| 1595 | IF ( neutral ) THEN |
---|
| 1596 | |
---|
| 1597 | IF ( surface_heatflux /= 0.0 .AND. surface_heatflux /= 9999999.9 ) & |
---|
| 1598 | THEN |
---|
| 1599 | message_string = 'heatflux must not be set for pure neutral flow' |
---|
| 1600 | CALL message( 'check_parameters', 'PA0351', 1, 2, 0, 6, 0 ) |
---|
| 1601 | ENDIF |
---|
| 1602 | |
---|
| 1603 | IF ( top_heatflux /= 0.0 .AND. top_heatflux /= 9999999.9 ) & |
---|
| 1604 | THEN |
---|
| 1605 | message_string = 'heatflux must not be set for pure neutral flow' |
---|
| 1606 | CALL message( 'check_parameters', 'PA0351', 1, 2, 0, 6, 0 ) |
---|
| 1607 | ENDIF |
---|
| 1608 | |
---|
| 1609 | ENDIF |
---|
| 1610 | |
---|
[103] | 1611 | IF ( top_momentumflux_u /= 9999999.9 .AND. & |
---|
| 1612 | top_momentumflux_v /= 9999999.9 ) THEN |
---|
| 1613 | constant_top_momentumflux = .TRUE. |
---|
| 1614 | ELSEIF ( .NOT. ( top_momentumflux_u == 9999999.9 .AND. & |
---|
[215] | 1615 | top_momentumflux_v == 9999999.9 ) ) THEN |
---|
| 1616 | message_string = 'both, top_momentumflux_u AND top_momentumflux_v ' // & |
---|
| 1617 | 'must be set' |
---|
[226] | 1618 | CALL message( 'check_parameters', 'PA0064', 1, 2, 0, 6, 0 ) |
---|
[103] | 1619 | ENDIF |
---|
[1] | 1620 | |
---|
| 1621 | ! |
---|
| 1622 | !-- A given surface temperature implies Dirichlet boundary condition for |
---|
| 1623 | !-- temperature. In this case specification of a constant heat flux is |
---|
| 1624 | !-- forbidden. |
---|
| 1625 | IF ( ibc_pt_b == 0 .AND. constant_heatflux .AND. & |
---|
| 1626 | surface_heatflux /= 0.0 ) THEN |
---|
[215] | 1627 | message_string = 'boundary_condition: bc_pt_b = "' // TRIM( bc_pt_b ) //& |
---|
| 1628 | '& is not allowed with constant_heatflux = .TRUE.' |
---|
[226] | 1629 | CALL message( 'check_parameters', 'PA0065', 1, 2, 0, 6, 0 ) |
---|
[1] | 1630 | ENDIF |
---|
| 1631 | IF ( constant_heatflux .AND. pt_surface_initial_change /= 0.0 ) THEN |
---|
[215] | 1632 | WRITE ( message_string, * ) 'constant_heatflux = .TRUE. is not allo', & |
---|
| 1633 | 'wed with pt_surface_initial_change (/=0) = ', & |
---|
| 1634 | pt_surface_initial_change |
---|
[226] | 1635 | CALL message( 'check_parameters', 'PA0066', 1, 2, 0, 6, 0 ) |
---|
[1] | 1636 | ENDIF |
---|
| 1637 | |
---|
| 1638 | ! |
---|
[19] | 1639 | !-- A given temperature at the top implies Dirichlet boundary condition for |
---|
| 1640 | !-- temperature. In this case specification of a constant heat flux is |
---|
| 1641 | !-- forbidden. |
---|
| 1642 | IF ( ibc_pt_t == 0 .AND. constant_top_heatflux .AND. & |
---|
| 1643 | top_heatflux /= 0.0 ) THEN |
---|
[215] | 1644 | message_string = 'boundary_condition: bc_pt_t = "' // TRIM( bc_pt_t ) //& |
---|
| 1645 | '" is not allowed with constant_top_heatflux = .TRUE.' |
---|
[226] | 1646 | CALL message( 'check_parameters', 'PA0067', 1, 2, 0, 6, 0 ) |
---|
[19] | 1647 | ENDIF |
---|
| 1648 | |
---|
| 1649 | ! |
---|
[95] | 1650 | !-- Boundary conditions for salinity |
---|
| 1651 | IF ( ocean ) THEN |
---|
| 1652 | IF ( bc_sa_t == 'dirichlet' ) THEN |
---|
| 1653 | ibc_sa_t = 0 |
---|
| 1654 | ELSEIF ( bc_sa_t == 'neumann' ) THEN |
---|
| 1655 | ibc_sa_t = 1 |
---|
| 1656 | ELSE |
---|
[215] | 1657 | message_string = 'unknown boundary condition: bc_sa_t = "' // & |
---|
| 1658 | TRIM( bc_sa_t ) // '"' |
---|
[226] | 1659 | CALL message( 'check_parameters', 'PA0068', 1, 2, 0, 6, 0 ) |
---|
[95] | 1660 | ENDIF |
---|
| 1661 | |
---|
| 1662 | IF ( top_salinityflux == 9999999.9 ) constant_top_salinityflux = .FALSE. |
---|
[97] | 1663 | IF ( ibc_sa_t == 1 .AND. top_salinityflux == 9999999.9 ) THEN |
---|
[215] | 1664 | message_string = 'boundary condition: bc_sa_t = "' // & |
---|
| 1665 | TRIM( bc_sa_t ) // '" requires to set ' // & |
---|
| 1666 | 'top_salinityflux' |
---|
[226] | 1667 | CALL message( 'check_parameters', 'PA0069', 1, 2, 0, 6, 0 ) |
---|
[97] | 1668 | ENDIF |
---|
[95] | 1669 | |
---|
| 1670 | ! |
---|
| 1671 | !-- A fixed salinity at the top implies Dirichlet boundary condition for |
---|
| 1672 | !-- salinity. In this case specification of a constant salinity flux is |
---|
| 1673 | !-- forbidden. |
---|
| 1674 | IF ( ibc_sa_t == 0 .AND. constant_top_salinityflux .AND. & |
---|
| 1675 | top_salinityflux /= 0.0 ) THEN |
---|
[215] | 1676 | message_string = 'boundary condition: bc_sa_t = "' // & |
---|
| 1677 | TRIM( bc_sa_t ) // '" is not allowed with ' // & |
---|
| 1678 | 'constant_top_salinityflux = .TRUE.' |
---|
[226] | 1679 | CALL message( 'check_parameters', 'PA0070', 1, 2, 0, 6, 0 ) |
---|
[95] | 1680 | ENDIF |
---|
| 1681 | |
---|
| 1682 | ENDIF |
---|
| 1683 | |
---|
| 1684 | ! |
---|
[75] | 1685 | !-- In case of humidity or passive scalar, set boundary conditions for total |
---|
[1] | 1686 | !-- water content / scalar |
---|
[75] | 1687 | IF ( humidity .OR. passive_scalar ) THEN |
---|
| 1688 | IF ( humidity ) THEN |
---|
[1] | 1689 | sq = 'q' |
---|
| 1690 | ELSE |
---|
| 1691 | sq = 's' |
---|
| 1692 | ENDIF |
---|
| 1693 | IF ( bc_q_b == 'dirichlet' ) THEN |
---|
| 1694 | ibc_q_b = 0 |
---|
| 1695 | ELSEIF ( bc_q_b == 'neumann' ) THEN |
---|
| 1696 | ibc_q_b = 1 |
---|
| 1697 | ELSE |
---|
[215] | 1698 | message_string = 'unknown boundary condition: bc_' // TRIM( sq ) // & |
---|
| 1699 | '_b ="' // TRIM( bc_q_b ) // '"' |
---|
[226] | 1700 | CALL message( 'check_parameters', 'PA0071', 1, 2, 0, 6, 0 ) |
---|
[1] | 1701 | ENDIF |
---|
| 1702 | IF ( bc_q_t == 'dirichlet' ) THEN |
---|
| 1703 | ibc_q_t = 0 |
---|
| 1704 | ELSEIF ( bc_q_t == 'neumann' ) THEN |
---|
| 1705 | ibc_q_t = 1 |
---|
| 1706 | ELSE |
---|
[215] | 1707 | message_string = 'unknown boundary condition: bc_' // TRIM( sq ) // & |
---|
| 1708 | '_t ="' // TRIM( bc_q_t ) // '"' |
---|
[226] | 1709 | CALL message( 'check_parameters', 'PA0072', 1, 2, 0, 6, 0 ) |
---|
[1] | 1710 | ENDIF |
---|
| 1711 | |
---|
[600] | 1712 | IF ( surface_waterflux == 9999999.9 ) constant_waterflux = .FALSE. |
---|
[1] | 1713 | |
---|
| 1714 | ! |
---|
| 1715 | !-- A given surface humidity implies Dirichlet boundary condition for |
---|
[75] | 1716 | !-- humidity. In this case specification of a constant water flux is |
---|
[1] | 1717 | !-- forbidden. |
---|
| 1718 | IF ( ibc_q_b == 0 .AND. constant_waterflux ) THEN |
---|
[215] | 1719 | message_string = 'boundary condition: bc_' // TRIM( sq ) // '_b ' // & |
---|
| 1720 | '= "' // TRIM( bc_q_b ) // '" is not allowed wi' // & |
---|
| 1721 | 'th prescribed surface flux' |
---|
[226] | 1722 | CALL message( 'check_parameters', 'PA0073', 1, 2, 0, 6, 0 ) |
---|
[1] | 1723 | ENDIF |
---|
| 1724 | IF ( constant_waterflux .AND. q_surface_initial_change /= 0.0 ) THEN |
---|
[215] | 1725 | WRITE( message_string, * ) 'a prescribed surface flux is not allo', & |
---|
| 1726 | 'wed with ', sq, '_surface_initial_change (/=0) = ', & |
---|
| 1727 | q_surface_initial_change |
---|
[226] | 1728 | CALL message( 'check_parameters', 'PA0074', 1, 2, 0, 6, 0 ) |
---|
[1] | 1729 | ENDIF |
---|
[1053] | 1730 | |
---|
[1] | 1731 | ENDIF |
---|
| 1732 | ! |
---|
| 1733 | !-- Boundary conditions for horizontal components of wind speed |
---|
| 1734 | IF ( bc_uv_b == 'dirichlet' ) THEN |
---|
| 1735 | ibc_uv_b = 0 |
---|
| 1736 | ELSEIF ( bc_uv_b == 'neumann' ) THEN |
---|
| 1737 | ibc_uv_b = 1 |
---|
| 1738 | IF ( prandtl_layer ) THEN |
---|
[215] | 1739 | message_string = 'boundary condition: bc_uv_b = "' // & |
---|
| 1740 | TRIM( bc_uv_b ) // '" is not allowed with prandtl_layer = .TRUE.' |
---|
[226] | 1741 | CALL message( 'check_parameters', 'PA0075', 1, 2, 0, 6, 0 ) |
---|
[1] | 1742 | ENDIF |
---|
| 1743 | ELSE |
---|
[215] | 1744 | message_string = 'unknown boundary condition: bc_uv_b = "' // & |
---|
| 1745 | TRIM( bc_uv_b ) // '"' |
---|
[226] | 1746 | CALL message( 'check_parameters', 'PA0076', 1, 2, 0, 6, 0 ) |
---|
[1] | 1747 | ENDIF |
---|
[667] | 1748 | ! |
---|
| 1749 | !-- In case of coupled simulations u and v at the ground in atmosphere will be |
---|
| 1750 | !-- assigned with the u and v values of the ocean surface |
---|
| 1751 | IF ( coupling_mode == 'atmosphere_to_ocean' ) THEN |
---|
| 1752 | ibc_uv_b = 2 |
---|
| 1753 | ENDIF |
---|
[215] | 1754 | |
---|
[108] | 1755 | IF ( coupling_mode == 'ocean_to_atmosphere' ) THEN |
---|
| 1756 | bc_uv_t = 'neumann' |
---|
[1] | 1757 | ibc_uv_t = 1 |
---|
| 1758 | ELSE |
---|
[132] | 1759 | IF ( bc_uv_t == 'dirichlet' .OR. bc_uv_t == 'dirichlet_0' ) THEN |
---|
[108] | 1760 | ibc_uv_t = 0 |
---|
[767] | 1761 | IF ( bc_uv_t == 'dirichlet_0' ) THEN |
---|
| 1762 | ! |
---|
| 1763 | !-- Velocities for the initial u,v-profiles are set zero at the top |
---|
| 1764 | !-- in case of dirichlet_0 conditions |
---|
| 1765 | u_init(nzt+1) = 0.0 |
---|
| 1766 | v_init(nzt+1) = 0.0 |
---|
| 1767 | ENDIF |
---|
[108] | 1768 | ELSEIF ( bc_uv_t == 'neumann' ) THEN |
---|
| 1769 | ibc_uv_t = 1 |
---|
| 1770 | ELSE |
---|
[215] | 1771 | message_string = 'unknown boundary condition: bc_uv_t = "' // & |
---|
| 1772 | TRIM( bc_uv_t ) // '"' |
---|
[226] | 1773 | CALL message( 'check_parameters', 'PA0077', 1, 2, 0, 6, 0 ) |
---|
[1] | 1774 | ENDIF |
---|
| 1775 | ENDIF |
---|
| 1776 | |
---|
| 1777 | ! |
---|
| 1778 | !-- Compute and check, respectively, the Rayleigh Damping parameter |
---|
| 1779 | IF ( rayleigh_damping_factor == -1.0 ) THEN |
---|
[1001] | 1780 | rayleigh_damping_factor = 0.0 |
---|
[1] | 1781 | ELSE |
---|
| 1782 | IF ( rayleigh_damping_factor < 0.0 .OR. rayleigh_damping_factor > 1.0 ) & |
---|
| 1783 | THEN |
---|
[215] | 1784 | WRITE( message_string, * ) 'rayleigh_damping_factor = ', & |
---|
| 1785 | rayleigh_damping_factor, ' out of range [0.0,1.0]' |
---|
[226] | 1786 | CALL message( 'check_parameters', 'PA0078', 1, 2, 0, 6, 0 ) |
---|
[1] | 1787 | ENDIF |
---|
| 1788 | ENDIF |
---|
| 1789 | |
---|
| 1790 | IF ( rayleigh_damping_height == -1.0 ) THEN |
---|
[108] | 1791 | IF ( .NOT. ocean ) THEN |
---|
| 1792 | rayleigh_damping_height = 0.66666666666 * zu(nzt) |
---|
| 1793 | ELSE |
---|
| 1794 | rayleigh_damping_height = 0.66666666666 * zu(nzb) |
---|
| 1795 | ENDIF |
---|
[1] | 1796 | ELSE |
---|
[108] | 1797 | IF ( .NOT. ocean ) THEN |
---|
| 1798 | IF ( rayleigh_damping_height < 0.0 .OR. & |
---|
| 1799 | rayleigh_damping_height > zu(nzt) ) THEN |
---|
[215] | 1800 | WRITE( message_string, * ) 'rayleigh_damping_height = ', & |
---|
| 1801 | rayleigh_damping_height, ' out of range [0.0,', zu(nzt), ']' |
---|
[226] | 1802 | CALL message( 'check_parameters', 'PA0079', 1, 2, 0, 6, 0 ) |
---|
[1] | 1803 | ENDIF |
---|
[108] | 1804 | ELSE |
---|
| 1805 | IF ( rayleigh_damping_height > 0.0 .OR. & |
---|
| 1806 | rayleigh_damping_height < zu(nzb) ) THEN |
---|
[215] | 1807 | WRITE( message_string, * ) 'rayleigh_damping_height = ', & |
---|
| 1808 | rayleigh_damping_height, ' out of range [0.0,', zu(nzb), ']' |
---|
[226] | 1809 | CALL message( 'check_parameters', 'PA0079', 1, 2, 0, 6, 0 ) |
---|
[108] | 1810 | ENDIF |
---|
[1] | 1811 | ENDIF |
---|
| 1812 | ENDIF |
---|
| 1813 | |
---|
| 1814 | ! |
---|
| 1815 | !-- Check number of chosen statistic regions. More than 10 regions are not |
---|
| 1816 | !-- allowed, because so far no more than 10 corresponding output files can |
---|
| 1817 | !-- be opened (cf. check_open) |
---|
| 1818 | IF ( statistic_regions > 9 .OR. statistic_regions < 0 ) THEN |
---|
[215] | 1819 | WRITE ( message_string, * ) 'number of statistic_regions = ', & |
---|
| 1820 | statistic_regions+1, ' but only 10 regions are allowed' |
---|
[226] | 1821 | CALL message( 'check_parameters', 'PA0082', 1, 2, 0, 6, 0 ) |
---|
[1] | 1822 | ENDIF |
---|
| 1823 | IF ( normalizing_region > statistic_regions .OR. & |
---|
| 1824 | normalizing_region < 0) THEN |
---|
[215] | 1825 | WRITE ( message_string, * ) 'normalizing_region = ', & |
---|
| 1826 | normalizing_region, ' must be >= 0 and <= ',statistic_regions, & |
---|
| 1827 | ' (value of statistic_regions)' |
---|
[226] | 1828 | CALL message( 'check_parameters', 'PA0083', 1, 2, 0, 6, 0 ) |
---|
[1] | 1829 | ENDIF |
---|
| 1830 | |
---|
| 1831 | ! |
---|
[116] | 1832 | !-- Check the interval for sorting particles. |
---|
| 1833 | !-- Using particles as cloud droplets requires sorting after each timestep. |
---|
| 1834 | IF ( dt_sort_particles /= 0.0 .AND. cloud_droplets ) THEN |
---|
| 1835 | dt_sort_particles = 0.0 |
---|
[215] | 1836 | message_string = 'dt_sort_particles is reset to 0.0 because of cloud' //& |
---|
| 1837 | '_droplets = .TRUE.' |
---|
[226] | 1838 | CALL message( 'check_parameters', 'PA0084', 0, 1, 0, 6, 0 ) |
---|
[116] | 1839 | ENDIF |
---|
| 1840 | |
---|
| 1841 | ! |
---|
[1] | 1842 | !-- Set the default intervals for data output, if necessary |
---|
| 1843 | !-- NOTE: dt_dosp has already been set in package_parin |
---|
| 1844 | IF ( dt_data_output /= 9999999.9 ) THEN |
---|
| 1845 | IF ( dt_dopr == 9999999.9 ) dt_dopr = dt_data_output |
---|
| 1846 | IF ( dt_dopts == 9999999.9 ) dt_dopts = dt_data_output |
---|
| 1847 | IF ( dt_do2d_xy == 9999999.9 ) dt_do2d_xy = dt_data_output |
---|
| 1848 | IF ( dt_do2d_xz == 9999999.9 ) dt_do2d_xz = dt_data_output |
---|
| 1849 | IF ( dt_do2d_yz == 9999999.9 ) dt_do2d_yz = dt_data_output |
---|
| 1850 | IF ( dt_do3d == 9999999.9 ) dt_do3d = dt_data_output |
---|
| 1851 | IF ( dt_data_output_av == 9999999.9 ) dt_data_output_av = dt_data_output |
---|
[564] | 1852 | DO mid = 1, max_masks |
---|
[410] | 1853 | IF ( dt_domask(mid) == 9999999.9 ) dt_domask(mid) = dt_data_output |
---|
| 1854 | ENDDO |
---|
[1] | 1855 | ENDIF |
---|
| 1856 | |
---|
| 1857 | ! |
---|
| 1858 | !-- Set the default skip time intervals for data output, if necessary |
---|
| 1859 | IF ( skip_time_dopr == 9999999.9 ) & |
---|
| 1860 | skip_time_dopr = skip_time_data_output |
---|
| 1861 | IF ( skip_time_dosp == 9999999.9 ) & |
---|
| 1862 | skip_time_dosp = skip_time_data_output |
---|
| 1863 | IF ( skip_time_do2d_xy == 9999999.9 ) & |
---|
| 1864 | skip_time_do2d_xy = skip_time_data_output |
---|
| 1865 | IF ( skip_time_do2d_xz == 9999999.9 ) & |
---|
| 1866 | skip_time_do2d_xz = skip_time_data_output |
---|
| 1867 | IF ( skip_time_do2d_yz == 9999999.9 ) & |
---|
| 1868 | skip_time_do2d_yz = skip_time_data_output |
---|
| 1869 | IF ( skip_time_do3d == 9999999.9 ) & |
---|
| 1870 | skip_time_do3d = skip_time_data_output |
---|
| 1871 | IF ( skip_time_data_output_av == 9999999.9 ) & |
---|
| 1872 | skip_time_data_output_av = skip_time_data_output |
---|
[564] | 1873 | DO mid = 1, max_masks |
---|
[410] | 1874 | IF ( skip_time_domask(mid) == 9999999.9 ) & |
---|
| 1875 | skip_time_domask(mid) = skip_time_data_output |
---|
| 1876 | ENDDO |
---|
[1] | 1877 | |
---|
| 1878 | ! |
---|
| 1879 | !-- Check the average intervals (first for 3d-data, then for profiles and |
---|
| 1880 | !-- spectra) |
---|
| 1881 | IF ( averaging_interval > dt_data_output_av ) THEN |
---|
[215] | 1882 | WRITE( message_string, * ) 'averaging_interval = ', & |
---|
| 1883 | averaging_interval, ' must be <= dt_data_output = ', dt_data_output |
---|
[226] | 1884 | CALL message( 'check_parameters', 'PA0085', 1, 2, 0, 6, 0 ) |
---|
[1] | 1885 | ENDIF |
---|
| 1886 | |
---|
| 1887 | IF ( averaging_interval_pr == 9999999.9 ) THEN |
---|
| 1888 | averaging_interval_pr = averaging_interval |
---|
| 1889 | ENDIF |
---|
| 1890 | |
---|
| 1891 | IF ( averaging_interval_pr > dt_dopr ) THEN |
---|
[215] | 1892 | WRITE( message_string, * ) 'averaging_interval_pr = ', & |
---|
| 1893 | averaging_interval_pr, ' must be <= dt_dopr = ', dt_dopr |
---|
[226] | 1894 | CALL message( 'check_parameters', 'PA0086', 1, 2, 0, 6, 0 ) |
---|
[1] | 1895 | ENDIF |
---|
| 1896 | |
---|
| 1897 | IF ( averaging_interval_sp == 9999999.9 ) THEN |
---|
| 1898 | averaging_interval_sp = averaging_interval |
---|
| 1899 | ENDIF |
---|
| 1900 | |
---|
| 1901 | IF ( averaging_interval_sp > dt_dosp ) THEN |
---|
[215] | 1902 | WRITE( message_string, * ) 'averaging_interval_sp = ', & |
---|
| 1903 | averaging_interval_sp, ' must be <= dt_dosp = ', dt_dosp |
---|
[226] | 1904 | CALL message( 'check_parameters', 'PA0087', 1, 2, 0, 6, 0 ) |
---|
[1] | 1905 | ENDIF |
---|
| 1906 | |
---|
| 1907 | ! |
---|
| 1908 | !-- Set the default interval for profiles entering the temporal average |
---|
| 1909 | IF ( dt_averaging_input_pr == 9999999.9 ) THEN |
---|
| 1910 | dt_averaging_input_pr = dt_averaging_input |
---|
| 1911 | ENDIF |
---|
| 1912 | |
---|
| 1913 | ! |
---|
| 1914 | !-- Set the default interval for the output of timeseries to a reasonable |
---|
| 1915 | !-- value (tries to minimize the number of calls of flow_statistics) |
---|
| 1916 | IF ( dt_dots == 9999999.9 ) THEN |
---|
| 1917 | IF ( averaging_interval_pr == 0.0 ) THEN |
---|
| 1918 | dt_dots = MIN( dt_run_control, dt_dopr ) |
---|
| 1919 | ELSE |
---|
| 1920 | dt_dots = MIN( dt_run_control, dt_averaging_input_pr ) |
---|
| 1921 | ENDIF |
---|
| 1922 | ENDIF |
---|
| 1923 | |
---|
| 1924 | ! |
---|
| 1925 | !-- Check the sample rate for averaging (first for 3d-data, then for profiles) |
---|
| 1926 | IF ( dt_averaging_input > averaging_interval ) THEN |
---|
[215] | 1927 | WRITE( message_string, * ) 'dt_averaging_input = ', & |
---|
| 1928 | dt_averaging_input, ' must be <= averaging_interval = ', & |
---|
| 1929 | averaging_interval |
---|
[226] | 1930 | CALL message( 'check_parameters', 'PA0088', 1, 2, 0, 6, 0 ) |
---|
[1] | 1931 | ENDIF |
---|
| 1932 | |
---|
| 1933 | IF ( dt_averaging_input_pr > averaging_interval_pr ) THEN |
---|
[215] | 1934 | WRITE( message_string, * ) 'dt_averaging_input_pr = ', & |
---|
| 1935 | dt_averaging_input_pr, ' must be <= averaging_interval_pr = ', & |
---|
| 1936 | averaging_interval_pr |
---|
[226] | 1937 | CALL message( 'check_parameters', 'PA0089', 1, 2, 0, 6, 0 ) |
---|
[1] | 1938 | ENDIF |
---|
| 1939 | |
---|
| 1940 | ! |
---|
[72] | 1941 | !-- Set the default value for the integration interval of precipitation amount |
---|
| 1942 | IF ( precipitation ) THEN |
---|
| 1943 | IF ( precipitation_amount_interval == 9999999.9 ) THEN |
---|
| 1944 | precipitation_amount_interval = dt_do2d_xy |
---|
| 1945 | ELSE |
---|
| 1946 | IF ( precipitation_amount_interval > dt_do2d_xy ) THEN |
---|
[215] | 1947 | WRITE( message_string, * ) 'precipitation_amount_interval = ', & |
---|
| 1948 | precipitation_amount_interval, ' must not be larger than ', & |
---|
| 1949 | 'dt_do2d_xy = ', dt_do2d_xy |
---|
[226] | 1950 | CALL message( 'check_parameters', 'PA0090', 1, 2, 0, 6, 0 ) |
---|
[72] | 1951 | ENDIF |
---|
| 1952 | ENDIF |
---|
| 1953 | ENDIF |
---|
| 1954 | |
---|
| 1955 | ! |
---|
[1] | 1956 | !-- Determine the number of output profiles and check whether they are |
---|
| 1957 | !-- permissible |
---|
| 1958 | DO WHILE ( data_output_pr(dopr_n+1) /= ' ' ) |
---|
| 1959 | |
---|
| 1960 | dopr_n = dopr_n + 1 |
---|
| 1961 | i = dopr_n |
---|
| 1962 | |
---|
| 1963 | ! |
---|
| 1964 | !-- Determine internal profile number (for hom, homs) |
---|
| 1965 | !-- and store height levels |
---|
| 1966 | SELECT CASE ( TRIM( data_output_pr(i) ) ) |
---|
| 1967 | |
---|
| 1968 | CASE ( 'u', '#u' ) |
---|
| 1969 | dopr_index(i) = 1 |
---|
[87] | 1970 | dopr_unit(i) = 'm/s' |
---|
[1] | 1971 | hom(:,2,1,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1972 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1973 | dopr_initial_index(i) = 5 |
---|
| 1974 | hom(:,2,5,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1975 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1976 | ENDIF |
---|
| 1977 | |
---|
| 1978 | CASE ( 'v', '#v' ) |
---|
| 1979 | dopr_index(i) = 2 |
---|
[87] | 1980 | dopr_unit(i) = 'm/s' |
---|
| 1981 | hom(:,2,2,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 1982 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1983 | dopr_initial_index(i) = 6 |
---|
| 1984 | hom(:,2,6,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1985 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1986 | ENDIF |
---|
| 1987 | |
---|
| 1988 | CASE ( 'w' ) |
---|
| 1989 | dopr_index(i) = 3 |
---|
[87] | 1990 | dopr_unit(i) = 'm/s' |
---|
| 1991 | hom(:,2,3,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[1] | 1992 | |
---|
| 1993 | CASE ( 'pt', '#pt' ) |
---|
| 1994 | IF ( .NOT. cloud_physics ) THEN |
---|
| 1995 | dopr_index(i) = 4 |
---|
[87] | 1996 | dopr_unit(i) = 'K' |
---|
[1] | 1997 | hom(:,2,4,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1998 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1999 | dopr_initial_index(i) = 7 |
---|
| 2000 | hom(:,2,7,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[87] | 2001 | hom(nzb,2,7,:) = 0.0 ! because zu(nzb) is negative |
---|
[1] | 2002 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2003 | ENDIF |
---|
| 2004 | ELSE |
---|
| 2005 | dopr_index(i) = 43 |
---|
[87] | 2006 | dopr_unit(i) = 'K' |
---|
[1] | 2007 | hom(:,2,43,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2008 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2009 | dopr_initial_index(i) = 28 |
---|
| 2010 | hom(:,2,28,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[87] | 2011 | hom(nzb,2,28,:) = 0.0 ! because zu(nzb) is negative |
---|
[1] | 2012 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2013 | ENDIF |
---|
| 2014 | ENDIF |
---|
| 2015 | |
---|
| 2016 | CASE ( 'e' ) |
---|
| 2017 | dopr_index(i) = 8 |
---|
[87] | 2018 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 2019 | hom(:,2,8,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2020 | hom(nzb,2,8,:) = 0.0 |
---|
| 2021 | |
---|
| 2022 | CASE ( 'km', '#km' ) |
---|
| 2023 | dopr_index(i) = 9 |
---|
[87] | 2024 | dopr_unit(i) = 'm2/s' |
---|
[1] | 2025 | hom(:,2,9,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2026 | hom(nzb,2,9,:) = 0.0 |
---|
| 2027 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2028 | dopr_initial_index(i) = 23 |
---|
| 2029 | hom(:,2,23,:) = hom(:,2,9,:) |
---|
| 2030 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2031 | ENDIF |
---|
| 2032 | |
---|
| 2033 | CASE ( 'kh', '#kh' ) |
---|
| 2034 | dopr_index(i) = 10 |
---|
[87] | 2035 | dopr_unit(i) = 'm2/s' |
---|
[1] | 2036 | hom(:,2,10,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2037 | hom(nzb,2,10,:) = 0.0 |
---|
| 2038 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2039 | dopr_initial_index(i) = 24 |
---|
| 2040 | hom(:,2,24,:) = hom(:,2,10,:) |
---|
| 2041 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2042 | ENDIF |
---|
| 2043 | |
---|
| 2044 | CASE ( 'l', '#l' ) |
---|
| 2045 | dopr_index(i) = 11 |
---|
[87] | 2046 | dopr_unit(i) = 'm' |
---|
[1] | 2047 | hom(:,2,11,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2048 | hom(nzb,2,11,:) = 0.0 |
---|
| 2049 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2050 | dopr_initial_index(i) = 25 |
---|
| 2051 | hom(:,2,25,:) = hom(:,2,11,:) |
---|
| 2052 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2053 | ENDIF |
---|
| 2054 | |
---|
| 2055 | CASE ( 'w"u"' ) |
---|
| 2056 | dopr_index(i) = 12 |
---|
[87] | 2057 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 2058 | hom(:,2,12,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2059 | IF ( prandtl_layer ) hom(nzb,2,12,:) = zu(1) |
---|
| 2060 | |
---|
| 2061 | CASE ( 'w*u*' ) |
---|
| 2062 | dopr_index(i) = 13 |
---|
[87] | 2063 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 2064 | hom(:,2,13,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2065 | |
---|
| 2066 | CASE ( 'w"v"' ) |
---|
| 2067 | dopr_index(i) = 14 |
---|
[87] | 2068 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 2069 | hom(:,2,14,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2070 | IF ( prandtl_layer ) hom(nzb,2,14,:) = zu(1) |
---|
| 2071 | |
---|
| 2072 | CASE ( 'w*v*' ) |
---|
| 2073 | dopr_index(i) = 15 |
---|
[87] | 2074 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 2075 | hom(:,2,15,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2076 | |
---|
| 2077 | CASE ( 'w"pt"' ) |
---|
| 2078 | dopr_index(i) = 16 |
---|
[87] | 2079 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2080 | hom(:,2,16,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2081 | |
---|
| 2082 | CASE ( 'w*pt*' ) |
---|
| 2083 | dopr_index(i) = 17 |
---|
[87] | 2084 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2085 | hom(:,2,17,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2086 | |
---|
| 2087 | CASE ( 'wpt' ) |
---|
| 2088 | dopr_index(i) = 18 |
---|
[87] | 2089 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2090 | hom(:,2,18,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2091 | |
---|
| 2092 | CASE ( 'wu' ) |
---|
| 2093 | dopr_index(i) = 19 |
---|
[87] | 2094 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 2095 | hom(:,2,19,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2096 | IF ( prandtl_layer ) hom(nzb,2,19,:) = zu(1) |
---|
| 2097 | |
---|
| 2098 | CASE ( 'wv' ) |
---|
| 2099 | dopr_index(i) = 20 |
---|
[87] | 2100 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 2101 | hom(:,2,20,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2102 | IF ( prandtl_layer ) hom(nzb,2,20,:) = zu(1) |
---|
| 2103 | |
---|
| 2104 | CASE ( 'w*pt*BC' ) |
---|
| 2105 | dopr_index(i) = 21 |
---|
[87] | 2106 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2107 | hom(:,2,21,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2108 | |
---|
| 2109 | CASE ( 'wptBC' ) |
---|
| 2110 | dopr_index(i) = 22 |
---|
[87] | 2111 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2112 | hom(:,2,22,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2113 | |
---|
[96] | 2114 | CASE ( 'sa', '#sa' ) |
---|
| 2115 | IF ( .NOT. ocean ) THEN |
---|
[215] | 2116 | message_string = 'data_output_pr = ' // & |
---|
| 2117 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2118 | 'lemented for ocean = .FALSE.' |
---|
[226] | 2119 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
[96] | 2120 | ELSE |
---|
| 2121 | dopr_index(i) = 23 |
---|
| 2122 | dopr_unit(i) = 'psu' |
---|
| 2123 | hom(:,2,23,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2124 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2125 | dopr_initial_index(i) = 26 |
---|
| 2126 | hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2127 | hom(nzb,2,26,:) = 0.0 ! weil zu(nzb) negativ ist |
---|
| 2128 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2129 | ENDIF |
---|
| 2130 | ENDIF |
---|
| 2131 | |
---|
[1] | 2132 | CASE ( 'u*2' ) |
---|
| 2133 | dopr_index(i) = 30 |
---|
[87] | 2134 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 2135 | hom(:,2,30,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2136 | |
---|
| 2137 | CASE ( 'v*2' ) |
---|
| 2138 | dopr_index(i) = 31 |
---|
[87] | 2139 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 2140 | hom(:,2,31,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2141 | |
---|
| 2142 | CASE ( 'w*2' ) |
---|
| 2143 | dopr_index(i) = 32 |
---|
[87] | 2144 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 2145 | hom(:,2,32,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2146 | |
---|
| 2147 | CASE ( 'pt*2' ) |
---|
| 2148 | dopr_index(i) = 33 |
---|
[87] | 2149 | dopr_unit(i) = 'K2' |
---|
[1] | 2150 | hom(:,2,33,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2151 | |
---|
| 2152 | CASE ( 'e*' ) |
---|
| 2153 | dopr_index(i) = 34 |
---|
[87] | 2154 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 2155 | hom(:,2,34,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2156 | |
---|
| 2157 | CASE ( 'w*2pt*' ) |
---|
| 2158 | dopr_index(i) = 35 |
---|
[87] | 2159 | dopr_unit(i) = 'K m2/s2' |
---|
[1] | 2160 | hom(:,2,35,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2161 | |
---|
| 2162 | CASE ( 'w*pt*2' ) |
---|
| 2163 | dopr_index(i) = 36 |
---|
[87] | 2164 | dopr_unit(i) = 'K2 m/s' |
---|
[1] | 2165 | hom(:,2,36,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2166 | |
---|
| 2167 | CASE ( 'w*e*' ) |
---|
| 2168 | dopr_index(i) = 37 |
---|
[87] | 2169 | dopr_unit(i) = 'm3/s3' |
---|
[1] | 2170 | hom(:,2,37,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2171 | |
---|
| 2172 | CASE ( 'w*3' ) |
---|
| 2173 | dopr_index(i) = 38 |
---|
[87] | 2174 | dopr_unit(i) = 'm3/s3' |
---|
[1] | 2175 | hom(:,2,38,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2176 | |
---|
| 2177 | CASE ( 'Sw' ) |
---|
| 2178 | dopr_index(i) = 39 |
---|
[89] | 2179 | dopr_unit(i) = 'none' |
---|
[1] | 2180 | hom(:,2,39,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2181 | |
---|
[232] | 2182 | CASE ( 'p' ) |
---|
| 2183 | dopr_index(i) = 40 |
---|
| 2184 | dopr_unit(i) = 'Pa' |
---|
| 2185 | hom(:,2,40,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2186 | |
---|
[1] | 2187 | CASE ( 'q', '#q' ) |
---|
[108] | 2188 | IF ( .NOT. humidity ) THEN |
---|
[215] | 2189 | message_string = 'data_output_pr = ' // & |
---|
| 2190 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2191 | 'lemented for humidity = .FALSE.' |
---|
[226] | 2192 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
[1] | 2193 | ELSE |
---|
| 2194 | dopr_index(i) = 41 |
---|
[87] | 2195 | dopr_unit(i) = 'kg/kg' |
---|
| 2196 | hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 2197 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2198 | dopr_initial_index(i) = 26 |
---|
| 2199 | hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2200 | hom(nzb,2,26,:) = 0.0 ! weil zu(nzb) negativ ist |
---|
| 2201 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2202 | ENDIF |
---|
| 2203 | ENDIF |
---|
| 2204 | |
---|
| 2205 | CASE ( 's', '#s' ) |
---|
| 2206 | IF ( .NOT. passive_scalar ) THEN |
---|
[215] | 2207 | message_string = 'data_output_pr = ' // & |
---|
| 2208 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2209 | 'lemented for passive_scalar = .FALSE.' |
---|
[226] | 2210 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
[1] | 2211 | ELSE |
---|
| 2212 | dopr_index(i) = 41 |
---|
[87] | 2213 | dopr_unit(i) = 'kg/m3' |
---|
| 2214 | hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 2215 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2216 | dopr_initial_index(i) = 26 |
---|
| 2217 | hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2218 | hom(nzb,2,26,:) = 0.0 ! weil zu(nzb) negativ ist |
---|
| 2219 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2220 | ENDIF |
---|
| 2221 | ENDIF |
---|
| 2222 | |
---|
| 2223 | CASE ( 'qv', '#qv' ) |
---|
| 2224 | IF ( .NOT. cloud_physics ) THEN |
---|
| 2225 | dopr_index(i) = 41 |
---|
[87] | 2226 | dopr_unit(i) = 'kg/kg' |
---|
| 2227 | hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 2228 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2229 | dopr_initial_index(i) = 26 |
---|
| 2230 | hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2231 | hom(nzb,2,26,:) = 0.0 ! weil zu(nzb) negativ ist |
---|
| 2232 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2233 | ENDIF |
---|
| 2234 | ELSE |
---|
| 2235 | dopr_index(i) = 42 |
---|
[87] | 2236 | dopr_unit(i) = 'kg/kg' |
---|
| 2237 | hom(:,2,42,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 2238 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2239 | dopr_initial_index(i) = 27 |
---|
| 2240 | hom(:,2,27,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2241 | hom(nzb,2,27,:) = 0.0 ! weil zu(nzb) negativ ist |
---|
| 2242 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2243 | ENDIF |
---|
| 2244 | ENDIF |
---|
| 2245 | |
---|
| 2246 | CASE ( 'lpt', '#lpt' ) |
---|
| 2247 | IF ( .NOT. cloud_physics ) THEN |
---|
[215] | 2248 | message_string = 'data_output_pr = ' // & |
---|
| 2249 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2250 | 'lemented for cloud_physics = .FALSE.' |
---|
[226] | 2251 | CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) |
---|
[1] | 2252 | ELSE |
---|
| 2253 | dopr_index(i) = 4 |
---|
[87] | 2254 | dopr_unit(i) = 'K' |
---|
[1] | 2255 | hom(:,2,4,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2256 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2257 | dopr_initial_index(i) = 7 |
---|
| 2258 | hom(:,2,7,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2259 | hom(nzb,2,7,:) = 0.0 ! weil zu(nzb) negativ ist |
---|
| 2260 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2261 | ENDIF |
---|
| 2262 | ENDIF |
---|
| 2263 | |
---|
| 2264 | CASE ( 'vpt', '#vpt' ) |
---|
| 2265 | dopr_index(i) = 44 |
---|
[87] | 2266 | dopr_unit(i) = 'K' |
---|
| 2267 | hom(:,2,44,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 2268 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2269 | dopr_initial_index(i) = 29 |
---|
| 2270 | hom(:,2,29,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2271 | hom(nzb,2,29,:) = 0.0 ! weil zu(nzb) negativ ist |
---|
| 2272 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2273 | ENDIF |
---|
| 2274 | |
---|
| 2275 | CASE ( 'w"vpt"' ) |
---|
| 2276 | dopr_index(i) = 45 |
---|
[87] | 2277 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2278 | hom(:,2,45,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2279 | |
---|
| 2280 | CASE ( 'w*vpt*' ) |
---|
| 2281 | dopr_index(i) = 46 |
---|
[87] | 2282 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2283 | hom(:,2,46,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2284 | |
---|
| 2285 | CASE ( 'wvpt' ) |
---|
| 2286 | dopr_index(i) = 47 |
---|
[87] | 2287 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2288 | hom(:,2,47,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2289 | |
---|
| 2290 | CASE ( 'w"q"' ) |
---|
[108] | 2291 | IF ( .NOT. humidity ) THEN |
---|
[215] | 2292 | message_string = 'data_output_pr = ' // & |
---|
| 2293 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2294 | 'lemented for humidity = .FALSE.' |
---|
[226] | 2295 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
[1] | 2296 | ELSE |
---|
| 2297 | dopr_index(i) = 48 |
---|
[87] | 2298 | dopr_unit(i) = 'kg/kg m/s' |
---|
[1] | 2299 | hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2300 | ENDIF |
---|
| 2301 | |
---|
| 2302 | CASE ( 'w*q*' ) |
---|
[108] | 2303 | IF ( .NOT. humidity ) THEN |
---|
[215] | 2304 | message_string = 'data_output_pr = ' // & |
---|
| 2305 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2306 | 'lemented for humidity = .FALSE.' |
---|
[226] | 2307 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
[1] | 2308 | ELSE |
---|
| 2309 | dopr_index(i) = 49 |
---|
[87] | 2310 | dopr_unit(i) = 'kg/kg m/s' |
---|
[1] | 2311 | hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2312 | ENDIF |
---|
| 2313 | |
---|
| 2314 | CASE ( 'wq' ) |
---|
[108] | 2315 | IF ( .NOT. humidity ) THEN |
---|
[215] | 2316 | message_string = 'data_output_pr = ' // & |
---|
| 2317 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2318 | 'lemented for humidity = .FALSE.' |
---|
[226] | 2319 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
[1] | 2320 | ELSE |
---|
| 2321 | dopr_index(i) = 50 |
---|
[87] | 2322 | dopr_unit(i) = 'kg/kg m/s' |
---|
[1] | 2323 | hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2324 | ENDIF |
---|
| 2325 | |
---|
| 2326 | CASE ( 'w"s"' ) |
---|
| 2327 | IF ( .NOT. passive_scalar ) THEN |
---|
[215] | 2328 | message_string = 'data_output_pr = ' // & |
---|
| 2329 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2330 | 'lemented for passive_scalar = .FALSE.' |
---|
[226] | 2331 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
[1] | 2332 | ELSE |
---|
| 2333 | dopr_index(i) = 48 |
---|
[87] | 2334 | dopr_unit(i) = 'kg/m3 m/s' |
---|
[1] | 2335 | hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2336 | ENDIF |
---|
| 2337 | |
---|
| 2338 | CASE ( 'w*s*' ) |
---|
| 2339 | IF ( .NOT. passive_scalar ) THEN |
---|
[215] | 2340 | message_string = 'data_output_pr = ' // & |
---|
| 2341 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2342 | 'lemented for passive_scalar = .FALSE.' |
---|
[226] | 2343 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
[1] | 2344 | ELSE |
---|
| 2345 | dopr_index(i) = 49 |
---|
[87] | 2346 | dopr_unit(i) = 'kg/m3 m/s' |
---|
[1] | 2347 | hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2348 | ENDIF |
---|
| 2349 | |
---|
| 2350 | CASE ( 'ws' ) |
---|
| 2351 | IF ( .NOT. passive_scalar ) THEN |
---|
[215] | 2352 | message_string = 'data_output_pr = ' // & |
---|
| 2353 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2354 | 'lemented for passive_scalar = .FALSE.' |
---|
[226] | 2355 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
[1] | 2356 | ELSE |
---|
| 2357 | dopr_index(i) = 50 |
---|
[87] | 2358 | dopr_unit(i) = 'kg/m3 m/s' |
---|
[1] | 2359 | hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2360 | ENDIF |
---|
| 2361 | |
---|
| 2362 | CASE ( 'w"qv"' ) |
---|
[75] | 2363 | IF ( humidity .AND. .NOT. cloud_physics ) & |
---|
[1] | 2364 | THEN |
---|
| 2365 | dopr_index(i) = 48 |
---|
[87] | 2366 | dopr_unit(i) = 'kg/kg m/s' |
---|
[1] | 2367 | hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[75] | 2368 | ELSEIF( humidity .AND. cloud_physics ) THEN |
---|
[1] | 2369 | dopr_index(i) = 51 |
---|
[87] | 2370 | dopr_unit(i) = 'kg/kg m/s' |
---|
[1] | 2371 | hom(:,2,51,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2372 | ELSE |
---|
[215] | 2373 | message_string = 'data_output_pr = ' // & |
---|
| 2374 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2375 | 'lemented for cloud_physics = .FALSE. an&' // & |
---|
| 2376 | 'd humidity = .FALSE.' |
---|
[226] | 2377 | CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) |
---|
[1] | 2378 | ENDIF |
---|
| 2379 | |
---|
| 2380 | CASE ( 'w*qv*' ) |
---|
[75] | 2381 | IF ( humidity .AND. .NOT. cloud_physics ) & |
---|
[1] | 2382 | THEN |
---|
| 2383 | dopr_index(i) = 49 |
---|
[87] | 2384 | dopr_unit(i) = 'kg/kg m/s' |
---|
[1] | 2385 | hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[75] | 2386 | ELSEIF( humidity .AND. cloud_physics ) THEN |
---|
[1] | 2387 | dopr_index(i) = 52 |
---|
[87] | 2388 | dopr_unit(i) = 'kg/kg m/s' |
---|
[1] | 2389 | hom(:,2,52,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2390 | ELSE |
---|
[215] | 2391 | message_string = 'data_output_pr = ' // & |
---|
| 2392 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2393 | 'lemented for cloud_physics = .FALSE. an&' // & |
---|
| 2394 | 'd humidity = .FALSE.' |
---|
[226] | 2395 | CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) |
---|
[1] | 2396 | ENDIF |
---|
| 2397 | |
---|
| 2398 | CASE ( 'wqv' ) |
---|
[75] | 2399 | IF ( humidity .AND. .NOT. cloud_physics ) & |
---|
[1] | 2400 | THEN |
---|
| 2401 | dopr_index(i) = 50 |
---|
[87] | 2402 | dopr_unit(i) = 'kg/kg m/s' |
---|
[1] | 2403 | hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[75] | 2404 | ELSEIF( humidity .AND. cloud_physics ) THEN |
---|
[1] | 2405 | dopr_index(i) = 53 |
---|
[87] | 2406 | dopr_unit(i) = 'kg/kg m/s' |
---|
[1] | 2407 | hom(:,2,53,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2408 | ELSE |
---|
[215] | 2409 | message_string = 'data_output_pr = ' // & |
---|
| 2410 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2411 | 'lemented for cloud_physics = .FALSE. an&' // & |
---|
| 2412 | 'd humidity = .FALSE.' |
---|
[226] | 2413 | CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) |
---|
[1] | 2414 | ENDIF |
---|
| 2415 | |
---|
| 2416 | CASE ( 'ql' ) |
---|
| 2417 | IF ( .NOT. cloud_physics .AND. .NOT. cloud_droplets ) THEN |
---|
[215] | 2418 | message_string = 'data_output_pr = ' // & |
---|
| 2419 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2420 | 'lemented for cloud_physics = .FALSE. or' // & |
---|
| 2421 | '&cloud_droplets = .FALSE.' |
---|
[226] | 2422 | CALL message( 'check_parameters', 'PA0096', 1, 2, 0, 6, 0 ) |
---|
[1] | 2423 | ELSE |
---|
| 2424 | dopr_index(i) = 54 |
---|
[87] | 2425 | dopr_unit(i) = 'kg/kg' |
---|
[1] | 2426 | hom(:,2,54,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2427 | ENDIF |
---|
| 2428 | |
---|
[524] | 2429 | CASE ( 'w*u*u*:dz' ) |
---|
[1] | 2430 | dopr_index(i) = 55 |
---|
[87] | 2431 | dopr_unit(i) = 'm2/s3' |
---|
[1] | 2432 | hom(:,2,55,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2433 | |
---|
[524] | 2434 | CASE ( 'w*p*:dz' ) |
---|
[1] | 2435 | dopr_index(i) = 56 |
---|
[87] | 2436 | dopr_unit(i) = 'm2/s3' |
---|
[106] | 2437 | hom(:,2,56,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[1] | 2438 | |
---|
[524] | 2439 | CASE ( 'w"e:dz' ) |
---|
[1] | 2440 | dopr_index(i) = 57 |
---|
[87] | 2441 | dopr_unit(i) = 'm2/s3' |
---|
[1] | 2442 | hom(:,2,57,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2443 | |
---|
[667] | 2444 | |
---|
[1] | 2445 | CASE ( 'u"pt"' ) |
---|
| 2446 | dopr_index(i) = 58 |
---|
[87] | 2447 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2448 | hom(:,2,58,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2449 | |
---|
| 2450 | CASE ( 'u*pt*' ) |
---|
| 2451 | dopr_index(i) = 59 |
---|
[87] | 2452 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2453 | hom(:,2,59,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2454 | |
---|
| 2455 | CASE ( 'upt_t' ) |
---|
| 2456 | dopr_index(i) = 60 |
---|
[87] | 2457 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2458 | hom(:,2,60,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2459 | |
---|
| 2460 | CASE ( 'v"pt"' ) |
---|
| 2461 | dopr_index(i) = 61 |
---|
[87] | 2462 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2463 | hom(:,2,61,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2464 | |
---|
| 2465 | CASE ( 'v*pt*' ) |
---|
| 2466 | dopr_index(i) = 62 |
---|
[87] | 2467 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2468 | hom(:,2,62,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2469 | |
---|
| 2470 | CASE ( 'vpt_t' ) |
---|
| 2471 | dopr_index(i) = 63 |
---|
[87] | 2472 | dopr_unit(i) = 'K m/s' |
---|
[1] | 2473 | hom(:,2,63,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2474 | |
---|
[96] | 2475 | CASE ( 'rho' ) |
---|
[388] | 2476 | IF ( .NOT. ocean ) THEN |
---|
| 2477 | message_string = 'data_output_pr = ' // & |
---|
| 2478 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2479 | 'lemented for ocean = .FALSE.' |
---|
| 2480 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
| 2481 | ELSE |
---|
| 2482 | dopr_index(i) = 64 |
---|
| 2483 | dopr_unit(i) = 'kg/m3' |
---|
| 2484 | hom(:,2,64,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1179] | 2485 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2486 | dopr_initial_index(i) = 77 |
---|
| 2487 | hom(:,2,77,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2488 | hom(nzb,2,77,:) = 0.0 ! because zu(nzb) is negative |
---|
| 2489 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2490 | ENDIF |
---|
[388] | 2491 | ENDIF |
---|
[1] | 2492 | |
---|
[96] | 2493 | CASE ( 'w"sa"' ) |
---|
| 2494 | IF ( .NOT. ocean ) THEN |
---|
[215] | 2495 | message_string = 'data_output_pr = ' // & |
---|
| 2496 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2497 | 'lemented for ocean = .FALSE.' |
---|
[226] | 2498 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
[96] | 2499 | ELSE |
---|
| 2500 | dopr_index(i) = 65 |
---|
| 2501 | dopr_unit(i) = 'psu m/s' |
---|
| 2502 | hom(:,2,65,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2503 | ENDIF |
---|
| 2504 | |
---|
| 2505 | CASE ( 'w*sa*' ) |
---|
| 2506 | IF ( .NOT. ocean ) THEN |
---|
[215] | 2507 | message_string = 'data_output_pr = ' // & |
---|
| 2508 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2509 | 'lemented for ocean = .FALSE.' |
---|
[226] | 2510 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
[96] | 2511 | ELSE |
---|
| 2512 | dopr_index(i) = 66 |
---|
| 2513 | dopr_unit(i) = 'psu m/s' |
---|
| 2514 | hom(:,2,66,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2515 | ENDIF |
---|
| 2516 | |
---|
| 2517 | CASE ( 'wsa' ) |
---|
| 2518 | IF ( .NOT. ocean ) THEN |
---|
[215] | 2519 | message_string = 'data_output_pr = ' // & |
---|
| 2520 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2521 | 'lemented for ocean = .FALSE.' |
---|
[226] | 2522 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
[96] | 2523 | ELSE |
---|
| 2524 | dopr_index(i) = 67 |
---|
| 2525 | dopr_unit(i) = 'psu m/s' |
---|
| 2526 | hom(:,2,67,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2527 | ENDIF |
---|
| 2528 | |
---|
[106] | 2529 | CASE ( 'w*p*' ) |
---|
| 2530 | dopr_index(i) = 68 |
---|
| 2531 | dopr_unit(i) = 'm3/s3' |
---|
| 2532 | hom(:,2,68,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[96] | 2533 | |
---|
[106] | 2534 | CASE ( 'w"e' ) |
---|
| 2535 | dopr_index(i) = 69 |
---|
| 2536 | dopr_unit(i) = 'm3/s3' |
---|
| 2537 | hom(:,2,69,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2538 | |
---|
[197] | 2539 | CASE ( 'q*2' ) |
---|
| 2540 | IF ( .NOT. humidity ) THEN |
---|
[215] | 2541 | message_string = 'data_output_pr = ' // & |
---|
| 2542 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2543 | 'lemented for humidity = .FALSE.' |
---|
[226] | 2544 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
[197] | 2545 | ELSE |
---|
| 2546 | dopr_index(i) = 70 |
---|
| 2547 | dopr_unit(i) = 'kg2/kg2' |
---|
| 2548 | hom(:,2,70,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2549 | ENDIF |
---|
[106] | 2550 | |
---|
[388] | 2551 | CASE ( 'prho' ) |
---|
| 2552 | IF ( .NOT. ocean ) THEN |
---|
| 2553 | message_string = 'data_output_pr = ' // & |
---|
| 2554 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2555 | 'lemented for ocean = .FALSE.' |
---|
| 2556 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
| 2557 | ELSE |
---|
| 2558 | dopr_index(i) = 71 |
---|
| 2559 | dopr_unit(i) = 'kg/m3' |
---|
| 2560 | hom(:,2,71,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2561 | ENDIF |
---|
| 2562 | |
---|
| 2563 | CASE ( 'hyp' ) |
---|
| 2564 | dopr_index(i) = 72 |
---|
[531] | 2565 | dopr_unit(i) = 'dbar' |
---|
[388] | 2566 | hom(:,2,72,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2567 | |
---|
[1053] | 2568 | CASE ( 'nr' ) |
---|
| 2569 | IF ( .NOT. cloud_physics ) THEN |
---|
| 2570 | message_string = 'data_output_pr = ' // & |
---|
| 2571 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2572 | 'lemented for cloud_physics = .FALSE.' |
---|
| 2573 | CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) |
---|
| 2574 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
| 2575 | message_string = 'data_output_pr = ' // & |
---|
| 2576 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2577 | 'lemented for cloud_scheme /= seifert_beheng' |
---|
| 2578 | CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) |
---|
[1115] | 2579 | ELSEIF ( .NOT. precipitation ) THEN |
---|
| 2580 | message_string = 'data_output_pr = ' // & |
---|
| 2581 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2582 | 'lemented for precipitation = .FALSE.' |
---|
| 2583 | CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 ) |
---|
[1053] | 2584 | ELSE |
---|
| 2585 | dopr_index(i) = 73 |
---|
| 2586 | dopr_unit(i) = '1/m3' |
---|
| 2587 | hom(:,2,73,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2588 | ENDIF |
---|
| 2589 | |
---|
| 2590 | CASE ( 'qr' ) |
---|
| 2591 | IF ( .NOT. cloud_physics ) THEN |
---|
| 2592 | message_string = 'data_output_pr = ' // & |
---|
| 2593 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2594 | 'lemented for cloud_physics = .FALSE.' |
---|
| 2595 | CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) |
---|
| 2596 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
| 2597 | message_string = 'data_output_pr = ' // & |
---|
| 2598 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2599 | 'lemented for cloud_scheme /= seifert_beheng' |
---|
| 2600 | CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) |
---|
[1115] | 2601 | ELSEIF ( .NOT. precipitation ) THEN |
---|
| 2602 | message_string = 'data_output_pr = ' // & |
---|
| 2603 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2604 | 'lemented for precipitation = .FALSE.' |
---|
| 2605 | CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 ) |
---|
[1053] | 2606 | ELSE |
---|
| 2607 | dopr_index(i) = 74 |
---|
| 2608 | dopr_unit(i) = 'kg/kg' |
---|
| 2609 | hom(:,2,74,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2610 | ENDIF |
---|
| 2611 | |
---|
| 2612 | CASE ( 'qc' ) |
---|
| 2613 | IF ( .NOT. cloud_physics ) THEN |
---|
| 2614 | message_string = 'data_output_pr = ' // & |
---|
| 2615 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2616 | 'lemented for cloud_physics = .FALSE.' |
---|
| 2617 | CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) |
---|
| 2618 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
| 2619 | message_string = 'data_output_pr = ' // & |
---|
| 2620 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2621 | 'lemented for cloud_scheme /= seifert_beheng' |
---|
| 2622 | CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) |
---|
| 2623 | ELSE |
---|
| 2624 | dopr_index(i) = 75 |
---|
| 2625 | dopr_unit(i) = 'kg/kg' |
---|
| 2626 | hom(:,2,75,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2627 | ENDIF |
---|
| 2628 | |
---|
| 2629 | CASE ( 'prr' ) |
---|
| 2630 | IF ( .NOT. cloud_physics ) THEN |
---|
| 2631 | message_string = 'data_output_pr = ' // & |
---|
| 2632 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2633 | 'lemented for cloud_physics = .FALSE.' |
---|
| 2634 | CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) |
---|
| 2635 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
| 2636 | message_string = 'data_output_pr = ' // & |
---|
| 2637 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2638 | 'lemented for cloud_scheme /= seifert_beheng' |
---|
| 2639 | CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) |
---|
| 2640 | ELSEIF ( .NOT. precipitation ) THEN |
---|
| 2641 | message_string = 'data_output_pr = ' // & |
---|
| 2642 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2643 | 'lemented for precipitation = .FALSE.' |
---|
| 2644 | CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 ) |
---|
| 2645 | |
---|
| 2646 | ELSE |
---|
| 2647 | dopr_index(i) = 76 |
---|
| 2648 | dopr_unit(i) = 'kg/kg m/s' |
---|
| 2649 | hom(:,2,76,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2650 | ENDIF |
---|
| 2651 | |
---|
[1] | 2652 | CASE DEFAULT |
---|
[87] | 2653 | |
---|
| 2654 | CALL user_check_data_output_pr( data_output_pr(i), i, unit ) |
---|
| 2655 | |
---|
| 2656 | IF ( unit == 'illegal' ) THEN |
---|
[215] | 2657 | IF ( data_output_pr_user(1) /= ' ' ) THEN |
---|
| 2658 | message_string = 'illegal value for data_output_pr or ' // & |
---|
| 2659 | 'data_output_pr_user = "' // & |
---|
| 2660 | TRIM( data_output_pr(i) ) // '"' |
---|
[226] | 2661 | CALL message( 'check_parameters', 'PA0097', 1, 2, 0, 6, 0 ) |
---|
[215] | 2662 | ELSE |
---|
| 2663 | message_string = 'illegal value for data_output_pr = "' // & |
---|
| 2664 | TRIM( data_output_pr(i) ) // '"' |
---|
[226] | 2665 | CALL message( 'check_parameters', 'PA0098', 1, 2, 0, 6, 0 ) |
---|
[87] | 2666 | ENDIF |
---|
[1] | 2667 | ENDIF |
---|
| 2668 | |
---|
| 2669 | END SELECT |
---|
[667] | 2670 | |
---|
[1] | 2671 | ENDDO |
---|
| 2672 | |
---|
| 2673 | |
---|
| 2674 | ! |
---|
| 2675 | !-- Append user-defined data output variables to the standard data output |
---|
| 2676 | IF ( data_output_user(1) /= ' ' ) THEN |
---|
| 2677 | i = 1 |
---|
| 2678 | DO WHILE ( data_output(i) /= ' ' .AND. i <= 100 ) |
---|
| 2679 | i = i + 1 |
---|
| 2680 | ENDDO |
---|
| 2681 | j = 1 |
---|
| 2682 | DO WHILE ( data_output_user(j) /= ' ' .AND. j <= 100 ) |
---|
| 2683 | IF ( i > 100 ) THEN |
---|
[215] | 2684 | message_string = 'number of output quantitities given by data' // & |
---|
| 2685 | '_output and data_output_user exceeds the limit of 100' |
---|
[226] | 2686 | CALL message( 'check_parameters', 'PA0102', 1, 2, 0, 6, 0 ) |
---|
[1] | 2687 | ENDIF |
---|
| 2688 | data_output(i) = data_output_user(j) |
---|
| 2689 | i = i + 1 |
---|
| 2690 | j = j + 1 |
---|
| 2691 | ENDDO |
---|
| 2692 | ENDIF |
---|
| 2693 | |
---|
| 2694 | ! |
---|
| 2695 | !-- Check and set steering parameters for 2d/3d data output and averaging |
---|
| 2696 | i = 1 |
---|
| 2697 | DO WHILE ( data_output(i) /= ' ' .AND. i <= 100 ) |
---|
| 2698 | ! |
---|
| 2699 | !-- Check for data averaging |
---|
| 2700 | ilen = LEN_TRIM( data_output(i) ) |
---|
| 2701 | j = 0 ! no data averaging |
---|
| 2702 | IF ( ilen > 3 ) THEN |
---|
| 2703 | IF ( data_output(i)(ilen-2:ilen) == '_av' ) THEN |
---|
| 2704 | j = 1 ! data averaging |
---|
| 2705 | data_output(i) = data_output(i)(1:ilen-3) |
---|
| 2706 | ENDIF |
---|
| 2707 | ENDIF |
---|
| 2708 | ! |
---|
| 2709 | !-- Check for cross section or volume data |
---|
| 2710 | ilen = LEN_TRIM( data_output(i) ) |
---|
| 2711 | k = 0 ! 3d data |
---|
| 2712 | var = data_output(i)(1:ilen) |
---|
| 2713 | IF ( ilen > 3 ) THEN |
---|
| 2714 | IF ( data_output(i)(ilen-2:ilen) == '_xy' .OR. & |
---|
| 2715 | data_output(i)(ilen-2:ilen) == '_xz' .OR. & |
---|
| 2716 | data_output(i)(ilen-2:ilen) == '_yz' ) THEN |
---|
| 2717 | k = 1 ! 2d data |
---|
| 2718 | var = data_output(i)(1:ilen-3) |
---|
| 2719 | ENDIF |
---|
| 2720 | ENDIF |
---|
| 2721 | ! |
---|
| 2722 | !-- Check for allowed value and set units |
---|
| 2723 | SELECT CASE ( TRIM( var ) ) |
---|
| 2724 | |
---|
| 2725 | CASE ( 'e' ) |
---|
| 2726 | IF ( constant_diffusion ) THEN |
---|
[215] | 2727 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2728 | 'res constant_diffusion = .FALSE.' |
---|
[226] | 2729 | CALL message( 'check_parameters', 'PA0103', 1, 2, 0, 6, 0 ) |
---|
[1] | 2730 | ENDIF |
---|
| 2731 | unit = 'm2/s2' |
---|
| 2732 | |
---|
[771] | 2733 | CASE ( 'lpt' ) |
---|
| 2734 | IF ( .NOT. cloud_physics ) THEN |
---|
| 2735 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
[773] | 2736 | 'res cloud_physics = .TRUE.' |
---|
| 2737 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
[771] | 2738 | ENDIF |
---|
| 2739 | unit = 'K' |
---|
| 2740 | |
---|
[1053] | 2741 | CASE ( 'nr' ) |
---|
| 2742 | IF ( .NOT. cloud_physics ) THEN |
---|
| 2743 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2744 | 'res cloud_physics = .TRUE.' |
---|
| 2745 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
| 2746 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
| 2747 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2748 | 'res cloud_scheme = seifert_beheng' |
---|
| 2749 | CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) |
---|
| 2750 | ENDIF |
---|
| 2751 | unit = '1/m3' |
---|
| 2752 | |
---|
[1] | 2753 | CASE ( 'pc', 'pr' ) |
---|
| 2754 | IF ( .NOT. particle_advection ) THEN |
---|
[215] | 2755 | message_string = 'output of "' // TRIM( var ) // '" requir' // & |
---|
| 2756 | 'es a "particles_par"-NAMELIST in the parameter file (PARIN)' |
---|
[226] | 2757 | CALL message( 'check_parameters', 'PA0104', 1, 2, 0, 6, 0 ) |
---|
[1] | 2758 | ENDIF |
---|
| 2759 | IF ( TRIM( var ) == 'pc' ) unit = 'number' |
---|
| 2760 | IF ( TRIM( var ) == 'pr' ) unit = 'm' |
---|
| 2761 | |
---|
[1053] | 2762 | CASE ( 'prr' ) |
---|
| 2763 | IF ( .NOT. cloud_physics ) THEN |
---|
| 2764 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2765 | 'res cloud_physics = .TRUE.' |
---|
| 2766 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
| 2767 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
| 2768 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2769 | 'res cloud_scheme = seifert_beheng' |
---|
| 2770 | CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) |
---|
| 2771 | ELSEIF ( .NOT. precipitation ) THEN |
---|
| 2772 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2773 | 'res precipitation = .TRUE.' |
---|
| 2774 | CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) |
---|
| 2775 | ENDIF |
---|
| 2776 | unit = 'kg/kg m/s' |
---|
| 2777 | |
---|
[1] | 2778 | CASE ( 'q', 'vpt' ) |
---|
[75] | 2779 | IF ( .NOT. humidity ) THEN |
---|
[215] | 2780 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2781 | 'res humidity = .TRUE.' |
---|
[226] | 2782 | CALL message( 'check_parameters', 'PA0105', 1, 2, 0, 6, 0 ) |
---|
[1] | 2783 | ENDIF |
---|
| 2784 | IF ( TRIM( var ) == 'q' ) unit = 'kg/kg' |
---|
| 2785 | IF ( TRIM( var ) == 'vpt' ) unit = 'K' |
---|
| 2786 | |
---|
[1053] | 2787 | CASE ( 'qc' ) |
---|
| 2788 | IF ( .NOT. cloud_physics ) THEN |
---|
| 2789 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2790 | 'res cloud_physics = .TRUE.' |
---|
| 2791 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
| 2792 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
| 2793 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2794 | 'res cloud_scheme = seifert_beheng' |
---|
| 2795 | CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) |
---|
| 2796 | ENDIF |
---|
| 2797 | unit = 'kg/kg' |
---|
| 2798 | |
---|
[1] | 2799 | CASE ( 'ql' ) |
---|
| 2800 | IF ( .NOT. ( cloud_physics .OR. cloud_droplets ) ) THEN |
---|
[215] | 2801 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2802 | 'res cloud_physics = .TRUE. or cloud_droplets = .TRUE.' |
---|
[226] | 2803 | CALL message( 'check_parameters', 'PA0106', 1, 2, 0, 6, 0 ) |
---|
[1] | 2804 | ENDIF |
---|
| 2805 | unit = 'kg/kg' |
---|
| 2806 | |
---|
| 2807 | CASE ( 'ql_c', 'ql_v', 'ql_vp' ) |
---|
| 2808 | IF ( .NOT. cloud_droplets ) THEN |
---|
[215] | 2809 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2810 | 'res cloud_droplets = .TRUE.' |
---|
[226] | 2811 | CALL message( 'check_parameters', 'PA0107', 1, 2, 0, 6, 0 ) |
---|
[1] | 2812 | ENDIF |
---|
| 2813 | IF ( TRIM( var ) == 'ql_c' ) unit = 'kg/kg' |
---|
| 2814 | IF ( TRIM( var ) == 'ql_v' ) unit = 'm3' |
---|
| 2815 | IF ( TRIM( var ) == 'ql_vp' ) unit = 'none' |
---|
| 2816 | |
---|
[1053] | 2817 | CASE ( 'qr' ) |
---|
| 2818 | IF ( .NOT. cloud_physics ) THEN |
---|
| 2819 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2820 | 'res cloud_physics = .TRUE.' |
---|
| 2821 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
| 2822 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
| 2823 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2824 | 'res cloud_scheme = seifert_beheng' |
---|
| 2825 | CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) |
---|
[1115] | 2826 | ELSEIF ( .NOT. precipitation ) THEN |
---|
| 2827 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2828 | 'res precipitation = .TRUE.' |
---|
| 2829 | CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) |
---|
[1053] | 2830 | ENDIF |
---|
| 2831 | unit = 'kg/kg' |
---|
| 2832 | |
---|
[1] | 2833 | CASE ( 'qv' ) |
---|
| 2834 | IF ( .NOT. cloud_physics ) THEN |
---|
[215] | 2835 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2836 | 'res cloud_physics = .TRUE.' |
---|
[226] | 2837 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
[1] | 2838 | ENDIF |
---|
| 2839 | unit = 'kg/kg' |
---|
| 2840 | |
---|
[96] | 2841 | CASE ( 'rho' ) |
---|
| 2842 | IF ( .NOT. ocean ) THEN |
---|
[215] | 2843 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2844 | 'res ocean = .TRUE.' |
---|
[226] | 2845 | CALL message( 'check_parameters', 'PA0109', 1, 2, 0, 6, 0 ) |
---|
[96] | 2846 | ENDIF |
---|
| 2847 | unit = 'kg/m3' |
---|
| 2848 | |
---|
[1] | 2849 | CASE ( 's' ) |
---|
| 2850 | IF ( .NOT. passive_scalar ) THEN |
---|
[215] | 2851 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2852 | 'res passive_scalar = .TRUE.' |
---|
[226] | 2853 | CALL message( 'check_parameters', 'PA0110', 1, 2, 0, 6, 0 ) |
---|
[1] | 2854 | ENDIF |
---|
| 2855 | unit = 'conc' |
---|
| 2856 | |
---|
[96] | 2857 | CASE ( 'sa' ) |
---|
| 2858 | IF ( .NOT. ocean ) THEN |
---|
[215] | 2859 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2860 | 'res ocean = .TRUE.' |
---|
[226] | 2861 | CALL message( 'check_parameters', 'PA0109', 1, 2, 0, 6, 0 ) |
---|
[96] | 2862 | ENDIF |
---|
| 2863 | unit = 'psu' |
---|
| 2864 | |
---|
[978] | 2865 | CASE ( 'u*', 't*', 'lwp*', 'pra*', 'prr*', 'qsws*', 'shf*', 'z0*', 'z0h*' ) |
---|
[1] | 2866 | IF ( k == 0 .OR. data_output(i)(ilen-2:ilen) /= '_xy' ) THEN |
---|
[215] | 2867 | message_string = 'illegal value for data_output: "' // & |
---|
| 2868 | TRIM( var ) // '" & only 2d-horizontal ' // & |
---|
| 2869 | 'cross sections are allowed for this value' |
---|
[226] | 2870 | CALL message( 'check_parameters', 'PA0111', 1, 2, 0, 6, 0 ) |
---|
[1] | 2871 | ENDIF |
---|
| 2872 | IF ( TRIM( var ) == 'lwp*' .AND. .NOT. cloud_physics ) THEN |
---|
[215] | 2873 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2874 | 'res cloud_physics = .TRUE.' |
---|
[226] | 2875 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
[1] | 2876 | ENDIF |
---|
[72] | 2877 | IF ( TRIM( var ) == 'pra*' .AND. .NOT. precipitation ) THEN |
---|
[215] | 2878 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2879 | 'res precipitation = .TRUE.' |
---|
[226] | 2880 | CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) |
---|
[72] | 2881 | ENDIF |
---|
| 2882 | IF ( TRIM( var ) == 'pra*' .AND. j == 1 ) THEN |
---|
[215] | 2883 | message_string = 'temporal averaging of precipitation ' // & |
---|
| 2884 | 'amount "' // TRIM( var ) // '" is not possible' |
---|
[226] | 2885 | CALL message( 'check_parameters', 'PA0113', 1, 2, 0, 6, 0 ) |
---|
[72] | 2886 | ENDIF |
---|
| 2887 | IF ( TRIM( var ) == 'prr*' .AND. .NOT. precipitation ) THEN |
---|
[215] | 2888 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2889 | 'res precipitation = .TRUE.' |
---|
[226] | 2890 | CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) |
---|
[72] | 2891 | ENDIF |
---|
[354] | 2892 | IF ( TRIM( var ) == 'qsws*' .AND. .NOT. humidity ) THEN |
---|
| 2893 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2894 | 'res humidity = .TRUE.' |
---|
| 2895 | CALL message( 'check_parameters', 'PA0322', 1, 2, 0, 6, 0 ) |
---|
| 2896 | ENDIF |
---|
[72] | 2897 | |
---|
[354] | 2898 | IF ( TRIM( var ) == 'lwp*' ) unit = 'kg/kg*m' |
---|
| 2899 | IF ( TRIM( var ) == 'pra*' ) unit = 'mm' |
---|
| 2900 | IF ( TRIM( var ) == 'prr*' ) unit = 'mm/s' |
---|
| 2901 | IF ( TRIM( var ) == 'qsws*' ) unit = 'kgm/kgs' |
---|
| 2902 | IF ( TRIM( var ) == 'shf*' ) unit = 'K*m/s' |
---|
| 2903 | IF ( TRIM( var ) == 't*' ) unit = 'K' |
---|
| 2904 | IF ( TRIM( var ) == 'u*' ) unit = 'm/s' |
---|
| 2905 | IF ( TRIM( var ) == 'z0*' ) unit = 'm' |
---|
[996] | 2906 | IF ( TRIM( var ) == 'z0h*' ) unit = 'm' |
---|
[72] | 2907 | |
---|
[1] | 2908 | |
---|
| 2909 | CASE ( 'p', 'pt', 'u', 'v', 'w' ) |
---|
| 2910 | IF ( TRIM( var ) == 'p' ) unit = 'Pa' |
---|
| 2911 | IF ( TRIM( var ) == 'pt' ) unit = 'K' |
---|
| 2912 | IF ( TRIM( var ) == 'u' ) unit = 'm/s' |
---|
| 2913 | IF ( TRIM( var ) == 'v' ) unit = 'm/s' |
---|
| 2914 | IF ( TRIM( var ) == 'w' ) unit = 'm/s' |
---|
| 2915 | CONTINUE |
---|
| 2916 | |
---|
| 2917 | CASE DEFAULT |
---|
| 2918 | CALL user_check_data_output( var, unit ) |
---|
| 2919 | |
---|
| 2920 | IF ( unit == 'illegal' ) THEN |
---|
[215] | 2921 | IF ( data_output_user(1) /= ' ' ) THEN |
---|
| 2922 | message_string = 'illegal value for data_output or ' // & |
---|
| 2923 | 'data_output_user = "' // TRIM( data_output(i) ) // '"' |
---|
[226] | 2924 | CALL message( 'check_parameters', 'PA0114', 1, 2, 0, 6, 0 ) |
---|
[215] | 2925 | ELSE |
---|
| 2926 | message_string = 'illegal value for data_output =' // & |
---|
| 2927 | TRIM( data_output(i) ) // '"' |
---|
[226] | 2928 | CALL message( 'check_parameters', 'PA0115', 1, 2, 0, 6, 0 ) |
---|
[1] | 2929 | ENDIF |
---|
| 2930 | ENDIF |
---|
| 2931 | |
---|
| 2932 | END SELECT |
---|
| 2933 | ! |
---|
| 2934 | !-- Set the internal steering parameters appropriately |
---|
| 2935 | IF ( k == 0 ) THEN |
---|
| 2936 | do3d_no(j) = do3d_no(j) + 1 |
---|
| 2937 | do3d(j,do3d_no(j)) = data_output(i) |
---|
| 2938 | do3d_unit(j,do3d_no(j)) = unit |
---|
| 2939 | ELSE |
---|
| 2940 | do2d_no(j) = do2d_no(j) + 1 |
---|
| 2941 | do2d(j,do2d_no(j)) = data_output(i) |
---|
| 2942 | do2d_unit(j,do2d_no(j)) = unit |
---|
| 2943 | IF ( data_output(i)(ilen-2:ilen) == '_xy' ) THEN |
---|
| 2944 | data_output_xy(j) = .TRUE. |
---|
| 2945 | ENDIF |
---|
| 2946 | IF ( data_output(i)(ilen-2:ilen) == '_xz' ) THEN |
---|
| 2947 | data_output_xz(j) = .TRUE. |
---|
| 2948 | ENDIF |
---|
| 2949 | IF ( data_output(i)(ilen-2:ilen) == '_yz' ) THEN |
---|
| 2950 | data_output_yz(j) = .TRUE. |
---|
| 2951 | ENDIF |
---|
| 2952 | ENDIF |
---|
| 2953 | |
---|
| 2954 | IF ( j == 1 ) THEN |
---|
| 2955 | ! |
---|
| 2956 | !-- Check, if variable is already subject to averaging |
---|
| 2957 | found = .FALSE. |
---|
| 2958 | DO k = 1, doav_n |
---|
| 2959 | IF ( TRIM( doav(k) ) == TRIM( var ) ) found = .TRUE. |
---|
| 2960 | ENDDO |
---|
| 2961 | |
---|
| 2962 | IF ( .NOT. found ) THEN |
---|
| 2963 | doav_n = doav_n + 1 |
---|
| 2964 | doav(doav_n) = var |
---|
| 2965 | ENDIF |
---|
| 2966 | ENDIF |
---|
| 2967 | |
---|
| 2968 | i = i + 1 |
---|
| 2969 | ENDDO |
---|
| 2970 | |
---|
| 2971 | ! |
---|
[376] | 2972 | !-- Averaged 2d or 3d output requires that an averaging interval has been set |
---|
| 2973 | IF ( doav_n > 0 .AND. averaging_interval == 0.0 ) THEN |
---|
| 2974 | WRITE( message_string, * ) 'output of averaged quantity "', & |
---|
| 2975 | TRIM( doav(1) ), '_av" requires to set a ', & |
---|
| 2976 | 'non-zero & averaging interval' |
---|
| 2977 | CALL message( 'check_parameters', 'PA0323', 1, 2, 0, 6, 0 ) |
---|
| 2978 | ENDIF |
---|
| 2979 | |
---|
| 2980 | ! |
---|
[308] | 2981 | !-- Check sectional planes and store them in one shared array |
---|
| 2982 | IF ( ANY( section_xy > nz + 1 ) ) THEN |
---|
| 2983 | WRITE( message_string, * ) 'section_xy must be <= nz + 1 = ', nz + 1 |
---|
| 2984 | CALL message( 'check_parameters', 'PA0319', 1, 2, 0, 6, 0 ) |
---|
| 2985 | ENDIF |
---|
| 2986 | IF ( ANY( section_xz > ny + 1 ) ) THEN |
---|
| 2987 | WRITE( message_string, * ) 'section_xz must be <= ny + 1 = ', ny + 1 |
---|
| 2988 | CALL message( 'check_parameters', 'PA0320', 1, 2, 0, 6, 0 ) |
---|
| 2989 | ENDIF |
---|
| 2990 | IF ( ANY( section_yz > nx + 1 ) ) THEN |
---|
| 2991 | WRITE( message_string, * ) 'section_yz must be <= nx + 1 = ', nx + 1 |
---|
| 2992 | CALL message( 'check_parameters', 'PA0321', 1, 2, 0, 6, 0 ) |
---|
| 2993 | ENDIF |
---|
[1] | 2994 | section(:,1) = section_xy |
---|
| 2995 | section(:,2) = section_xz |
---|
| 2996 | section(:,3) = section_yz |
---|
| 2997 | |
---|
| 2998 | ! |
---|
| 2999 | !-- Upper plot limit for 2D vertical sections |
---|
| 3000 | IF ( z_max_do2d == -1.0 ) z_max_do2d = zu(nzt) |
---|
| 3001 | IF ( z_max_do2d < zu(nzb+1) .OR. z_max_do2d > zu(nzt) ) THEN |
---|
[215] | 3002 | WRITE( message_string, * ) 'z_max_do2d = ', z_max_do2d, & |
---|
| 3003 | ' must be >= ', zu(nzb+1), '(zu(nzb+1)) and <= ', zu(nzt), & |
---|
| 3004 | ' (zu(nzt))' |
---|
[226] | 3005 | CALL message( 'check_parameters', 'PA0116', 1, 2, 0, 6, 0 ) |
---|
[1] | 3006 | ENDIF |
---|
| 3007 | |
---|
| 3008 | ! |
---|
| 3009 | !-- Upper plot limit for 3D arrays |
---|
| 3010 | IF ( nz_do3d == -9999 ) nz_do3d = nzt + 1 |
---|
| 3011 | |
---|
| 3012 | ! |
---|
| 3013 | !-- Determine and check accuracy for compressed 3D plot output |
---|
| 3014 | IF ( do3d_compress ) THEN |
---|
| 3015 | ! |
---|
| 3016 | !-- Compression only permissible on T3E machines |
---|
| 3017 | IF ( host(1:3) /= 't3e' ) THEN |
---|
[215] | 3018 | message_string = 'do3d_compress = .TRUE. not allowed on host "' // & |
---|
| 3019 | TRIM( host ) // '"' |
---|
[226] | 3020 | CALL message( 'check_parameters', 'PA0117', 1, 2, 0, 6, 0 ) |
---|
[1] | 3021 | ENDIF |
---|
| 3022 | |
---|
| 3023 | i = 1 |
---|
| 3024 | DO WHILE ( do3d_comp_prec(i) /= ' ' ) |
---|
| 3025 | |
---|
| 3026 | ilen = LEN_TRIM( do3d_comp_prec(i) ) |
---|
| 3027 | IF ( LLT( do3d_comp_prec(i)(ilen:ilen), '0' ) .OR. & |
---|
| 3028 | LGT( do3d_comp_prec(i)(ilen:ilen), '9' ) ) THEN |
---|
[215] | 3029 | WRITE( message_string, * ) 'illegal precision: do3d_comp_prec', & |
---|
| 3030 | '(', i, ') = "', TRIM(do3d_comp_prec(i)),'"' |
---|
[226] | 3031 | CALL message( 'check_parameters', 'PA0118', 1, 2, 0, 6, 0 ) |
---|
[1] | 3032 | ENDIF |
---|
| 3033 | |
---|
| 3034 | prec = IACHAR( do3d_comp_prec(i)(ilen:ilen) ) - IACHAR( '0' ) |
---|
| 3035 | var = do3d_comp_prec(i)(1:ilen-1) |
---|
| 3036 | |
---|
| 3037 | SELECT CASE ( var ) |
---|
| 3038 | |
---|
| 3039 | CASE ( 'u' ) |
---|
| 3040 | j = 1 |
---|
| 3041 | CASE ( 'v' ) |
---|
| 3042 | j = 2 |
---|
| 3043 | CASE ( 'w' ) |
---|
| 3044 | j = 3 |
---|
| 3045 | CASE ( 'p' ) |
---|
| 3046 | j = 4 |
---|
| 3047 | CASE ( 'pt' ) |
---|
| 3048 | j = 5 |
---|
| 3049 | |
---|
| 3050 | CASE DEFAULT |
---|
[215] | 3051 | WRITE( message_string, * ) 'unknown variable "', & |
---|
| 3052 | TRIM( do3d_comp_prec(i) ), '" given for do3d_comp_prec(', & |
---|
| 3053 | i, ')' |
---|
[226] | 3054 | CALL message( 'check_parameters', 'PA0119', 1, 2, 0, 6, 0 ) |
---|
[1] | 3055 | |
---|
| 3056 | END SELECT |
---|
| 3057 | |
---|
| 3058 | plot_3d_precision(j)%precision = prec |
---|
| 3059 | i = i + 1 |
---|
| 3060 | |
---|
| 3061 | ENDDO |
---|
| 3062 | ENDIF |
---|
| 3063 | |
---|
| 3064 | ! |
---|
| 3065 | !-- Check the data output format(s) |
---|
| 3066 | IF ( data_output_format(1) == ' ' ) THEN |
---|
| 3067 | ! |
---|
| 3068 | !-- Default value |
---|
| 3069 | netcdf_output = .TRUE. |
---|
| 3070 | ELSE |
---|
| 3071 | i = 1 |
---|
| 3072 | DO WHILE ( data_output_format(i) /= ' ' ) |
---|
| 3073 | |
---|
| 3074 | SELECT CASE ( data_output_format(i) ) |
---|
| 3075 | |
---|
| 3076 | CASE ( 'netcdf' ) |
---|
| 3077 | netcdf_output = .TRUE. |
---|
| 3078 | CASE ( 'iso2d' ) |
---|
| 3079 | iso2d_output = .TRUE. |
---|
| 3080 | CASE ( 'avs' ) |
---|
| 3081 | avs_output = .TRUE. |
---|
| 3082 | |
---|
| 3083 | CASE DEFAULT |
---|
[215] | 3084 | message_string = 'unknown value for data_output_format "' // & |
---|
| 3085 | TRIM( data_output_format(i) ) // '"' |
---|
[226] | 3086 | CALL message( 'check_parameters', 'PA0120', 1, 2, 0, 6, 0 ) |
---|
[1] | 3087 | |
---|
| 3088 | END SELECT |
---|
| 3089 | |
---|
| 3090 | i = i + 1 |
---|
| 3091 | IF ( i > 10 ) EXIT |
---|
| 3092 | |
---|
| 3093 | ENDDO |
---|
[1031] | 3094 | ENDIF |
---|
[1] | 3095 | |
---|
[1031] | 3096 | ! |
---|
| 3097 | !-- Set output format string (used in header) |
---|
| 3098 | IF ( netcdf_output ) THEN |
---|
| 3099 | |
---|
| 3100 | SELECT CASE ( netcdf_data_format ) |
---|
| 3101 | CASE ( 1 ) |
---|
| 3102 | output_format_netcdf = 'netCDF classic' |
---|
| 3103 | CASE ( 2 ) |
---|
| 3104 | output_format_netcdf = 'netCDF 64bit offset' |
---|
| 3105 | CASE ( 3 ) |
---|
| 3106 | output_format_netcdf = 'netCDF4/HDF5' |
---|
| 3107 | CASE ( 4 ) |
---|
| 3108 | output_format_netcdf = 'netCDF4/HDF5 classic' |
---|
| 3109 | CASE ( 5 ) |
---|
| 3110 | output_format_netcdf = 'parallel netCDF4/HDF5' |
---|
| 3111 | CASE ( 6 ) |
---|
| 3112 | output_format_netcdf = 'parallel netCDF4/HDF5 classic' |
---|
| 3113 | |
---|
| 3114 | END SELECT |
---|
| 3115 | |
---|
[1] | 3116 | ENDIF |
---|
| 3117 | |
---|
| 3118 | ! |
---|
[410] | 3119 | !-- Check mask conditions |
---|
[553] | 3120 | DO mid = 1, max_masks |
---|
[567] | 3121 | IF ( data_output_masks(mid,1) /= ' ' .OR. & |
---|
| 3122 | data_output_masks_user(mid,1) /= ' ' ) THEN |
---|
[553] | 3123 | masks = masks + 1 |
---|
| 3124 | ENDIF |
---|
| 3125 | ENDDO |
---|
| 3126 | |
---|
[410] | 3127 | IF ( masks < 0 .OR. masks > max_masks ) THEN |
---|
| 3128 | WRITE( message_string, * ) 'illegal value: masks must be >= 0 and ', & |
---|
| 3129 | '<= ', max_masks, ' (=max_masks)' |
---|
[564] | 3130 | CALL message( 'check_parameters', 'PA0325', 1, 2, 0, 6, 0 ) |
---|
[410] | 3131 | ENDIF |
---|
| 3132 | IF ( masks > 0 ) THEN |
---|
| 3133 | mask_scale(1) = mask_scale_x |
---|
| 3134 | mask_scale(2) = mask_scale_y |
---|
| 3135 | mask_scale(3) = mask_scale_z |
---|
| 3136 | IF ( ANY( mask_scale <= 0.0 ) ) THEN |
---|
| 3137 | WRITE( message_string, * ) & |
---|
| 3138 | 'illegal value: mask_scale_x, mask_scale_y and mask_scale_z', & |
---|
| 3139 | 'must be > 0.0' |
---|
[564] | 3140 | CALL message( 'check_parameters', 'PA0326', 1, 2, 0, 6, 0 ) |
---|
[410] | 3141 | ENDIF |
---|
| 3142 | ! |
---|
| 3143 | !-- Generate masks for masked data output |
---|
| 3144 | CALL init_masks |
---|
| 3145 | ENDIF |
---|
| 3146 | |
---|
| 3147 | ! |
---|
[493] | 3148 | !-- Check the NetCDF data format |
---|
[924] | 3149 | #if ! defined ( __check ) |
---|
[1034] | 3150 | IF ( netcdf_data_format > 2 ) THEN |
---|
[924] | 3151 | #if defined( __netcdf4 ) |
---|
[493] | 3152 | CONTINUE |
---|
| 3153 | #else |
---|
[1031] | 3154 | message_string = 'netCDF: netCDF4 format requested but no ' // & |
---|
[493] | 3155 | 'cpp-directive __netcdf4 given & switch ' // & |
---|
| 3156 | 'back to 64-bit offset format' |
---|
| 3157 | CALL message( 'check_parameters', 'PA0171', 0, 1, 0, 6, 0 ) |
---|
| 3158 | netcdf_data_format = 2 |
---|
| 3159 | #endif |
---|
| 3160 | ENDIF |
---|
[1031] | 3161 | IF ( netcdf_data_format > 4 ) THEN |
---|
| 3162 | #if defined( __netcdf4 ) && defined( __netcdf4_parallel ) |
---|
| 3163 | CONTINUE |
---|
| 3164 | #else |
---|
| 3165 | message_string = 'netCDF: netCDF4 parallel output requested but no ' // & |
---|
| 3166 | 'cpp-directive __netcdf4_parallel given & switch ' // & |
---|
| 3167 | 'back to netCDF4 non-parallel output' |
---|
| 3168 | CALL message( 'check_parameters', 'PA0099', 0, 1, 0, 6, 0 ) |
---|
| 3169 | netcdf_data_format = netcdf_data_format - 2 |
---|
[892] | 3170 | #endif |
---|
[1031] | 3171 | ENDIF |
---|
| 3172 | #endif |
---|
[667] | 3173 | |
---|
[809] | 3174 | #if ! defined( __check ) |
---|
[1031] | 3175 | ! |
---|
[1] | 3176 | !-- Check netcdf precison |
---|
| 3177 | ldum = .FALSE. |
---|
| 3178 | CALL define_netcdf_header( 'ch', ldum, 0 ) |
---|
[807] | 3179 | #endif |
---|
[1] | 3180 | ! |
---|
| 3181 | !-- Check, whether a constant diffusion coefficient shall be used |
---|
| 3182 | IF ( km_constant /= -1.0 ) THEN |
---|
| 3183 | IF ( km_constant < 0.0 ) THEN |
---|
[215] | 3184 | WRITE( message_string, * ) 'km_constant = ', km_constant, ' < 0.0' |
---|
[226] | 3185 | CALL message( 'check_parameters', 'PA0121', 1, 2, 0, 6, 0 ) |
---|
[1] | 3186 | ELSE |
---|
| 3187 | IF ( prandtl_number < 0.0 ) THEN |
---|
[215] | 3188 | WRITE( message_string, * ) 'prandtl_number = ', prandtl_number, & |
---|
| 3189 | ' < 0.0' |
---|
[226] | 3190 | CALL message( 'check_parameters', 'PA0122', 1, 2, 0, 6, 0 ) |
---|
[1] | 3191 | ENDIF |
---|
| 3192 | constant_diffusion = .TRUE. |
---|
| 3193 | |
---|
| 3194 | IF ( prandtl_layer ) THEN |
---|
[215] | 3195 | message_string = 'prandtl_layer is not allowed with fixed ' // & |
---|
| 3196 | 'value of km' |
---|
[226] | 3197 | CALL message( 'check_parameters', 'PA0123', 1, 2, 0, 6, 0 ) |
---|
[1] | 3198 | ENDIF |
---|
| 3199 | ENDIF |
---|
| 3200 | ENDIF |
---|
| 3201 | |
---|
| 3202 | ! |
---|
[978] | 3203 | !-- In case of non-cyclic lateral boundaries and a damping layer for the |
---|
| 3204 | !-- potential temperature, check the width of the damping layer |
---|
[1] | 3205 | IF ( bc_lr /= 'cyclic' ) THEN |
---|
[996] | 3206 | IF ( pt_damping_width < 0.0 .OR. pt_damping_width > REAL( nx * dx ) ) THEN |
---|
[978] | 3207 | message_string = 'pt_damping_width out of range' |
---|
[226] | 3208 | CALL message( 'check_parameters', 'PA0124', 1, 2, 0, 6, 0 ) |
---|
[1] | 3209 | ENDIF |
---|
| 3210 | ENDIF |
---|
| 3211 | |
---|
| 3212 | IF ( bc_ns /= 'cyclic' ) THEN |
---|
[996] | 3213 | IF ( pt_damping_width < 0.0 .OR. pt_damping_width > REAL( ny * dy ) ) THEN |
---|
[978] | 3214 | message_string = 'pt_damping_width out of range' |
---|
[226] | 3215 | CALL message( 'check_parameters', 'PA0124', 1, 2, 0, 6, 0 ) |
---|
[1] | 3216 | ENDIF |
---|
| 3217 | ENDIF |
---|
| 3218 | |
---|
| 3219 | ! |
---|
| 3220 | !-- Check value range for rif |
---|
| 3221 | IF ( rif_min >= rif_max ) THEN |
---|
[215] | 3222 | WRITE( message_string, * ) 'rif_min = ', rif_min, ' must be less ', & |
---|
| 3223 | 'than rif_max = ', rif_max |
---|
[226] | 3224 | CALL message( 'check_parameters', 'PA0125', 1, 2, 0, 6, 0 ) |
---|
[1] | 3225 | ENDIF |
---|
| 3226 | |
---|
| 3227 | ! |
---|
| 3228 | !-- Determine upper and lower hight level indices for random perturbations |
---|
[97] | 3229 | IF ( disturbance_level_b == -9999999.9 ) THEN |
---|
| 3230 | IF ( ocean ) THEN |
---|
| 3231 | disturbance_level_b = zu((nzt*2)/3) |
---|
| 3232 | disturbance_level_ind_b = ( nzt * 2 ) / 3 |
---|
| 3233 | ELSE |
---|
| 3234 | disturbance_level_b = zu(nzb+3) |
---|
| 3235 | disturbance_level_ind_b = nzb + 3 |
---|
| 3236 | ENDIF |
---|
[1] | 3237 | ELSEIF ( disturbance_level_b < zu(3) ) THEN |
---|
[215] | 3238 | WRITE( message_string, * ) 'disturbance_level_b = ', & |
---|
| 3239 | disturbance_level_b, ' must be >= ', zu(3), '(zu(3))' |
---|
[226] | 3240 | CALL message( 'check_parameters', 'PA0126', 1, 2, 0, 6, 0 ) |
---|
[1] | 3241 | ELSEIF ( disturbance_level_b > zu(nzt-2) ) THEN |
---|
[215] | 3242 | WRITE( message_string, * ) 'disturbance_level_b = ', & |
---|
| 3243 | disturbance_level_b, ' must be <= ', zu(nzt-2), '(zu(nzt-2))' |
---|
[226] | 3244 | CALL message( 'check_parameters', 'PA0127', 1, 2, 0, 6, 0 ) |
---|
[1] | 3245 | ELSE |
---|
| 3246 | DO k = 3, nzt-2 |
---|
| 3247 | IF ( disturbance_level_b <= zu(k) ) THEN |
---|
| 3248 | disturbance_level_ind_b = k |
---|
| 3249 | EXIT |
---|
| 3250 | ENDIF |
---|
| 3251 | ENDDO |
---|
| 3252 | ENDIF |
---|
| 3253 | |
---|
[97] | 3254 | IF ( disturbance_level_t == -9999999.9 ) THEN |
---|
| 3255 | IF ( ocean ) THEN |
---|
| 3256 | disturbance_level_t = zu(nzt-3) |
---|
| 3257 | disturbance_level_ind_t = nzt - 3 |
---|
| 3258 | ELSE |
---|
| 3259 | disturbance_level_t = zu(nzt/3) |
---|
| 3260 | disturbance_level_ind_t = nzt / 3 |
---|
| 3261 | ENDIF |
---|
[1] | 3262 | ELSEIF ( disturbance_level_t > zu(nzt-2) ) THEN |
---|
[215] | 3263 | WRITE( message_string, * ) 'disturbance_level_t = ', & |
---|
| 3264 | disturbance_level_t, ' must be <= ', zu(nzt-2), '(zu(nzt-2))' |
---|
[226] | 3265 | CALL message( 'check_parameters', 'PA0128', 1, 2, 0, 6, 0 ) |
---|
[1] | 3266 | ELSEIF ( disturbance_level_t < disturbance_level_b ) THEN |
---|
[215] | 3267 | WRITE( message_string, * ) 'disturbance_level_t = ', & |
---|
| 3268 | disturbance_level_t, ' must be >= disturbance_level_b = ', & |
---|
| 3269 | disturbance_level_b |
---|
[226] | 3270 | CALL message( 'check_parameters', 'PA0129', 1, 2, 0, 6, 0 ) |
---|
[1] | 3271 | ELSE |
---|
| 3272 | DO k = 3, nzt-2 |
---|
| 3273 | IF ( disturbance_level_t <= zu(k) ) THEN |
---|
| 3274 | disturbance_level_ind_t = k |
---|
| 3275 | EXIT |
---|
| 3276 | ENDIF |
---|
| 3277 | ENDDO |
---|
| 3278 | ENDIF |
---|
| 3279 | |
---|
| 3280 | ! |
---|
| 3281 | !-- Check again whether the levels determined this way are ok. |
---|
| 3282 | !-- Error may occur at automatic determination and too few grid points in |
---|
| 3283 | !-- z-direction. |
---|
| 3284 | IF ( disturbance_level_ind_t < disturbance_level_ind_b ) THEN |
---|
[215] | 3285 | WRITE( message_string, * ) 'disturbance_level_ind_t = ', & |
---|
| 3286 | disturbance_level_ind_t, ' must be >= disturbance_level_b = ', & |
---|
| 3287 | disturbance_level_b |
---|
[226] | 3288 | CALL message( 'check_parameters', 'PA0130', 1, 2, 0, 6, 0 ) |
---|
[1] | 3289 | ENDIF |
---|
| 3290 | |
---|
| 3291 | ! |
---|
| 3292 | !-- Determine the horizontal index range for random perturbations. |
---|
| 3293 | !-- In case of non-cyclic horizontal boundaries, no perturbations are imposed |
---|
| 3294 | !-- near the inflow and the perturbation area is further limited to ...(1) |
---|
| 3295 | !-- after the initial phase of the flow. |
---|
| 3296 | dist_nxl = 0; dist_nxr = nx |
---|
| 3297 | dist_nys = 0; dist_nyn = ny |
---|
| 3298 | IF ( bc_lr /= 'cyclic' ) THEN |
---|
| 3299 | IF ( inflow_disturbance_begin == -1 ) THEN |
---|
| 3300 | inflow_disturbance_begin = MIN( 10, nx/2 ) |
---|
| 3301 | ENDIF |
---|
| 3302 | IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > nx )& |
---|
| 3303 | THEN |
---|
[215] | 3304 | message_string = 'inflow_disturbance_begin out of range' |
---|
[226] | 3305 | CALL message( 'check_parameters', 'PA0131', 1, 2, 0, 6, 0 ) |
---|
[1] | 3306 | ENDIF |
---|
| 3307 | IF ( inflow_disturbance_end == -1 ) THEN |
---|
| 3308 | inflow_disturbance_end = MIN( 100, 3*nx/4 ) |
---|
| 3309 | ENDIF |
---|
| 3310 | IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > nx ) & |
---|
| 3311 | THEN |
---|
[215] | 3312 | message_string = 'inflow_disturbance_end out of range' |
---|
[226] | 3313 | CALL message( 'check_parameters', 'PA0132', 1, 2, 0, 6, 0 ) |
---|
[1] | 3314 | ENDIF |
---|
| 3315 | ELSEIF ( bc_ns /= 'cyclic' ) THEN |
---|
| 3316 | IF ( inflow_disturbance_begin == -1 ) THEN |
---|
| 3317 | inflow_disturbance_begin = MIN( 10, ny/2 ) |
---|
| 3318 | ENDIF |
---|
| 3319 | IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > ny )& |
---|
| 3320 | THEN |
---|
[215] | 3321 | message_string = 'inflow_disturbance_begin out of range' |
---|
[226] | 3322 | CALL message( 'check_parameters', 'PA0131', 1, 2, 0, 6, 0 ) |
---|
[1] | 3323 | ENDIF |
---|
| 3324 | IF ( inflow_disturbance_end == -1 ) THEN |
---|
| 3325 | inflow_disturbance_end = MIN( 100, 3*ny/4 ) |
---|
| 3326 | ENDIF |
---|
| 3327 | IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > ny ) & |
---|
| 3328 | THEN |
---|
[215] | 3329 | message_string = 'inflow_disturbance_end out of range' |
---|
[226] | 3330 | CALL message( 'check_parameters', 'PA0132', 1, 2, 0, 6, 0 ) |
---|
[1] | 3331 | ENDIF |
---|
| 3332 | ENDIF |
---|
| 3333 | |
---|
[1159] | 3334 | IF ( bc_lr == 'radiation/dirichlet' ) THEN |
---|
[1] | 3335 | dist_nxr = nx - inflow_disturbance_begin |
---|
| 3336 | dist_nxl(1) = nx - inflow_disturbance_end |
---|
[1159] | 3337 | ELSEIF ( bc_lr == 'dirichlet/radiation' ) THEN |
---|
[1] | 3338 | dist_nxl = inflow_disturbance_begin |
---|
| 3339 | dist_nxr(1) = inflow_disturbance_end |
---|
[73] | 3340 | ENDIF |
---|
[1159] | 3341 | IF ( bc_ns == 'dirichlet/radiation' ) THEN |
---|
[1] | 3342 | dist_nyn = ny - inflow_disturbance_begin |
---|
| 3343 | dist_nys(1) = ny - inflow_disturbance_end |
---|
[1159] | 3344 | ELSEIF ( bc_ns == 'radiation/dirichlet' ) THEN |
---|
[1] | 3345 | dist_nys = inflow_disturbance_begin |
---|
| 3346 | dist_nyn(1) = inflow_disturbance_end |
---|
| 3347 | ENDIF |
---|
| 3348 | |
---|
| 3349 | ! |
---|
[151] | 3350 | !-- A turbulent inflow requires Dirichlet conditions at the respective inflow |
---|
| 3351 | !-- boundary (so far, a turbulent inflow is realized from the left side only) |
---|
[1159] | 3352 | IF ( turbulent_inflow .AND. bc_lr /= 'dirichlet/radiation' ) THEN |
---|
[215] | 3353 | message_string = 'turbulent_inflow = .T. requires a Dirichlet ' // & |
---|
| 3354 | 'condition at the inflow boundary' |
---|
[226] | 3355 | CALL message( 'check_parameters', 'PA0133', 1, 2, 0, 6, 0 ) |
---|
[151] | 3356 | ENDIF |
---|
| 3357 | |
---|
| 3358 | ! |
---|
[1060] | 3359 | !-- Turbulent inflow requires that 3d arrays have been cyclically filled with |
---|
[1103] | 3360 | !-- data from prerun in the first main run |
---|
| 3361 | IF ( turbulent_inflow .AND. initializing_actions /= 'cyclic_fill' .AND. & |
---|
| 3362 | initializing_actions /= 'read_restart_data' ) THEN |
---|
[1060] | 3363 | message_string = 'turbulent_inflow = .T. requires ' // & |
---|
| 3364 | 'initializing_actions = ''cyclic_fill'' ' |
---|
| 3365 | CALL message( 'check_parameters', 'PA0055', 1, 2, 0, 6, 0 ) |
---|
| 3366 | ENDIF |
---|
| 3367 | |
---|
| 3368 | ! |
---|
[151] | 3369 | !-- In case of turbulent inflow calculate the index of the recycling plane |
---|
| 3370 | IF ( turbulent_inflow ) THEN |
---|
| 3371 | IF ( recycling_width == 9999999.9 ) THEN |
---|
| 3372 | ! |
---|
| 3373 | !-- Set the default value for the width of the recycling domain |
---|
| 3374 | recycling_width = 0.1 * nx * dx |
---|
| 3375 | ELSE |
---|
| 3376 | IF ( recycling_width < dx .OR. recycling_width > nx * dx ) THEN |
---|
[215] | 3377 | WRITE( message_string, * ) 'illegal value for recycling_width:', & |
---|
| 3378 | ' ', recycling_width |
---|
[226] | 3379 | CALL message( 'check_parameters', 'PA0134', 1, 2, 0, 6, 0 ) |
---|
[151] | 3380 | ENDIF |
---|
| 3381 | ENDIF |
---|
| 3382 | ! |
---|
| 3383 | !-- Calculate the index |
---|
| 3384 | recycling_plane = recycling_width / dx |
---|
| 3385 | ENDIF |
---|
| 3386 | |
---|
| 3387 | ! |
---|
[1] | 3388 | !-- Check random generator |
---|
| 3389 | IF ( random_generator /= 'system-specific' .AND. & |
---|
| 3390 | random_generator /= 'numerical-recipes' ) THEN |
---|
[215] | 3391 | message_string = 'unknown random generator: random_generator = "' // & |
---|
| 3392 | TRIM( random_generator ) // '"' |
---|
[226] | 3393 | CALL message( 'check_parameters', 'PA0135', 1, 2, 0, 6, 0 ) |
---|
[1] | 3394 | ENDIF |
---|
| 3395 | |
---|
| 3396 | ! |
---|
| 3397 | !-- Determine damping level index for 1D model |
---|
| 3398 | IF ( INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN |
---|
| 3399 | IF ( damp_level_1d == -1.0 ) THEN |
---|
| 3400 | damp_level_1d = zu(nzt+1) |
---|
| 3401 | damp_level_ind_1d = nzt + 1 |
---|
| 3402 | ELSEIF ( damp_level_1d < 0.0 .OR. damp_level_1d > zu(nzt+1) ) THEN |
---|
[215] | 3403 | WRITE( message_string, * ) 'damp_level_1d = ', damp_level_1d, & |
---|
| 3404 | ' must be > 0.0 and < ', zu(nzt+1), '(zu(nzt+1))' |
---|
[226] | 3405 | CALL message( 'check_parameters', 'PA0136', 1, 2, 0, 6, 0 ) |
---|
[1] | 3406 | ELSE |
---|
| 3407 | DO k = 1, nzt+1 |
---|
| 3408 | IF ( damp_level_1d <= zu(k) ) THEN |
---|
| 3409 | damp_level_ind_1d = k |
---|
| 3410 | EXIT |
---|
| 3411 | ENDIF |
---|
| 3412 | ENDDO |
---|
| 3413 | ENDIF |
---|
| 3414 | ENDIF |
---|
[215] | 3415 | |
---|
[1] | 3416 | ! |
---|
| 3417 | !-- Check some other 1d-model parameters |
---|
| 3418 | IF ( TRIM( mixing_length_1d ) /= 'as_in_3d_model' .AND. & |
---|
| 3419 | TRIM( mixing_length_1d ) /= 'blackadar' ) THEN |
---|
[215] | 3420 | message_string = 'mixing_length_1d = "' // TRIM( mixing_length_1d ) // & |
---|
| 3421 | '" is unknown' |
---|
[226] | 3422 | CALL message( 'check_parameters', 'PA0137', 1, 2, 0, 6, 0 ) |
---|
[1] | 3423 | ENDIF |
---|
| 3424 | IF ( TRIM( dissipation_1d ) /= 'as_in_3d_model' .AND. & |
---|
| 3425 | TRIM( dissipation_1d ) /= 'detering' ) THEN |
---|
[215] | 3426 | message_string = 'dissipation_1d = "' // TRIM( dissipation_1d ) // & |
---|
| 3427 | '" is unknown' |
---|
[226] | 3428 | CALL message( 'check_parameters', 'PA0138', 1, 2, 0, 6, 0 ) |
---|
[1] | 3429 | ENDIF |
---|
| 3430 | |
---|
| 3431 | ! |
---|
| 3432 | !-- Set time for the next user defined restart (time_restart is the |
---|
| 3433 | !-- internal parameter for steering restart events) |
---|
| 3434 | IF ( restart_time /= 9999999.9 ) THEN |
---|
[291] | 3435 | IF ( restart_time > time_since_reference_point ) THEN |
---|
| 3436 | time_restart = restart_time |
---|
| 3437 | ENDIF |
---|
[1] | 3438 | ELSE |
---|
| 3439 | ! |
---|
| 3440 | !-- In case of a restart run, set internal parameter to default (no restart) |
---|
| 3441 | !-- if the NAMELIST-parameter restart_time is omitted |
---|
| 3442 | time_restart = 9999999.9 |
---|
| 3443 | ENDIF |
---|
| 3444 | |
---|
| 3445 | ! |
---|
| 3446 | !-- Set default value of the time needed to terminate a model run |
---|
| 3447 | IF ( termination_time_needed == -1.0 ) THEN |
---|
| 3448 | IF ( host(1:3) == 'ibm' ) THEN |
---|
| 3449 | termination_time_needed = 300.0 |
---|
| 3450 | ELSE |
---|
| 3451 | termination_time_needed = 35.0 |
---|
| 3452 | ENDIF |
---|
| 3453 | ENDIF |
---|
| 3454 | |
---|
| 3455 | ! |
---|
| 3456 | !-- Check the time needed to terminate a model run |
---|
| 3457 | IF ( host(1:3) == 't3e' ) THEN |
---|
| 3458 | ! |
---|
| 3459 | !-- Time needed must be at least 30 seconds on all CRAY machines, because |
---|
| 3460 | !-- MPP_TREMAIN gives the remaining CPU time only in steps of 30 seconds |
---|
| 3461 | IF ( termination_time_needed <= 30.0 ) THEN |
---|
[215] | 3462 | WRITE( message_string, * ) 'termination_time_needed = ', & |
---|
| 3463 | termination_time_needed, ' must be > 30.0 on host "', & |
---|
| 3464 | TRIM( host ), '"' |
---|
[226] | 3465 | CALL message( 'check_parameters', 'PA0139', 1, 2, 0, 6, 0 ) |
---|
[1] | 3466 | ENDIF |
---|
| 3467 | ELSEIF ( host(1:3) == 'ibm' ) THEN |
---|
| 3468 | ! |
---|
| 3469 | !-- On IBM-regatta machines the time should be at least 300 seconds, |
---|
| 3470 | !-- because the job time consumed before executing palm (for compiling, |
---|
| 3471 | !-- copying of files, etc.) has to be regarded |
---|
| 3472 | IF ( termination_time_needed < 300.0 ) THEN |
---|
[215] | 3473 | WRITE( message_string, * ) 'termination_time_needed = ', & |
---|
| 3474 | termination_time_needed, ' should be >= 300.0 on host "', & |
---|
| 3475 | TRIM( host ), '"' |
---|
[226] | 3476 | CALL message( 'check_parameters', 'PA0140', 1, 2, 0, 6, 0 ) |
---|
[1] | 3477 | ENDIF |
---|
| 3478 | ENDIF |
---|
| 3479 | |
---|
[217] | 3480 | ! |
---|
[240] | 3481 | !-- Check pressure gradient conditions |
---|
| 3482 | IF ( dp_external .AND. conserve_volume_flow ) THEN |
---|
[388] | 3483 | WRITE( message_string, * ) 'Both dp_external and conserve_volume_flo', & |
---|
| 3484 | 'w are .TRUE. but one of them must be .FALSE.' |
---|
[240] | 3485 | CALL message( 'check_parameters', 'PA0150', 1, 2, 0, 6, 0 ) |
---|
| 3486 | ENDIF |
---|
| 3487 | IF ( dp_external ) THEN |
---|
| 3488 | IF ( dp_level_b < zu(nzb) .OR. dp_level_b > zu(nzt) ) THEN |
---|
| 3489 | WRITE( message_string, * ) 'dp_level_b = ', dp_level_b, ' is out ', & |
---|
| 3490 | ' of range' |
---|
| 3491 | CALL message( 'check_parameters', 'PA0151', 1, 2, 0, 6, 0 ) |
---|
| 3492 | ENDIF |
---|
| 3493 | IF ( .NOT. ANY( dpdxy /= 0.0 ) ) THEN |
---|
[388] | 3494 | WRITE( message_string, * ) 'dp_external is .TRUE. but dpdxy is ze', & |
---|
| 3495 | 'ro, i.e. the external pressure gradient & will not be applied' |
---|
[240] | 3496 | CALL message( 'check_parameters', 'PA0152', 0, 1, 0, 6, 0 ) |
---|
| 3497 | ENDIF |
---|
| 3498 | ENDIF |
---|
| 3499 | IF ( ANY( dpdxy /= 0.0 ) .AND. .NOT. dp_external ) THEN |
---|
| 3500 | WRITE( message_string, * ) 'dpdxy is nonzero but dp_external is ', & |
---|
| 3501 | '.FALSE., i.e. the external pressure gradient & will not be applied' |
---|
| 3502 | CALL message( 'check_parameters', 'PA0153', 0, 1, 0, 6, 0 ) |
---|
| 3503 | ENDIF |
---|
[241] | 3504 | IF ( conserve_volume_flow ) THEN |
---|
| 3505 | IF ( TRIM( conserve_volume_flow_mode ) == 'default' ) THEN |
---|
[667] | 3506 | |
---|
| 3507 | conserve_volume_flow_mode = 'initial_profiles' |
---|
| 3508 | |
---|
[241] | 3509 | ELSEIF ( TRIM( conserve_volume_flow_mode ) /= 'initial_profiles' .AND. & |
---|
| 3510 | TRIM( conserve_volume_flow_mode ) /= 'inflow_profile' .AND. & |
---|
| 3511 | TRIM( conserve_volume_flow_mode ) /= 'bulk_velocity' ) THEN |
---|
| 3512 | WRITE( message_string, * ) 'unknown conserve_volume_flow_mode: ', & |
---|
| 3513 | conserve_volume_flow_mode |
---|
| 3514 | CALL message( 'check_parameters', 'PA0154', 1, 2, 0, 6, 0 ) |
---|
| 3515 | ENDIF |
---|
[667] | 3516 | IF ( (bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic') .AND. & |
---|
| 3517 | TRIM( conserve_volume_flow_mode ) == 'bulk_velocity' ) THEN |
---|
| 3518 | WRITE( message_string, * ) 'non-cyclic boundary conditions ', & |
---|
| 3519 | 'require conserve_volume_flow_mode = ''initial_profiles''' |
---|
[241] | 3520 | CALL message( 'check_parameters', 'PA0155', 1, 2, 0, 6, 0 ) |
---|
| 3521 | ENDIF |
---|
| 3522 | IF ( bc_lr == 'cyclic' .AND. bc_ns == 'cyclic' .AND. & |
---|
| 3523 | TRIM( conserve_volume_flow_mode ) == 'inflow_profile' ) THEN |
---|
| 3524 | WRITE( message_string, * ) 'cyclic boundary conditions ', & |
---|
[667] | 3525 | 'require conserve_volume_flow_mode = ''initial_profiles''', & |
---|
[241] | 3526 | ' or ''bulk_velocity''' |
---|
| 3527 | CALL message( 'check_parameters', 'PA0156', 1, 2, 0, 6, 0 ) |
---|
| 3528 | ENDIF |
---|
| 3529 | ENDIF |
---|
| 3530 | IF ( ( u_bulk /= 0.0 .OR. v_bulk /= 0.0 ) .AND. & |
---|
| 3531 | ( .NOT. conserve_volume_flow .OR. & |
---|
| 3532 | TRIM( conserve_volume_flow_mode ) /= 'bulk_velocity' ) ) THEN |
---|
| 3533 | WRITE( message_string, * ) 'nonzero bulk velocity requires ', & |
---|
[667] | 3534 | 'conserve_volume_flow = .T. and ', & |
---|
[241] | 3535 | 'conserve_volume_flow_mode = ''bulk_velocity''' |
---|
| 3536 | CALL message( 'check_parameters', 'PA0157', 1, 2, 0, 6, 0 ) |
---|
| 3537 | ENDIF |
---|
[240] | 3538 | |
---|
| 3539 | ! |
---|
[264] | 3540 | !-- Check particle attributes |
---|
| 3541 | IF ( particle_color /= 'none' ) THEN |
---|
| 3542 | IF ( particle_color /= 'absuv' .AND. particle_color /= 'pt*' .AND. & |
---|
| 3543 | particle_color /= 'z' ) THEN |
---|
| 3544 | message_string = 'illegal value for parameter particle_color: ' // & |
---|
| 3545 | TRIM( particle_color) |
---|
| 3546 | CALL message( 'check_parameters', 'PA0313', 1, 2, 0, 6, 0 ) |
---|
| 3547 | ELSE |
---|
| 3548 | IF ( color_interval(2) <= color_interval(1) ) THEN |
---|
| 3549 | message_string = 'color_interval(2) <= color_interval(1)' |
---|
| 3550 | CALL message( 'check_parameters', 'PA0315', 1, 2, 0, 6, 0 ) |
---|
| 3551 | ENDIF |
---|
| 3552 | ENDIF |
---|
| 3553 | ENDIF |
---|
| 3554 | |
---|
| 3555 | IF ( particle_dvrpsize /= 'none' ) THEN |
---|
| 3556 | IF ( particle_dvrpsize /= 'absw' ) THEN |
---|
| 3557 | message_string = 'illegal value for parameter particle_dvrpsize:' // & |
---|
| 3558 | ' ' // TRIM( particle_color) |
---|
| 3559 | CALL message( 'check_parameters', 'PA0314', 1, 2, 0, 6, 0 ) |
---|
| 3560 | ELSE |
---|
| 3561 | IF ( dvrpsize_interval(2) <= dvrpsize_interval(1) ) THEN |
---|
| 3562 | message_string = 'dvrpsize_interval(2) <= dvrpsize_interval(1)' |
---|
| 3563 | CALL message( 'check_parameters', 'PA0316', 1, 2, 0, 6, 0 ) |
---|
| 3564 | ENDIF |
---|
| 3565 | ENDIF |
---|
| 3566 | ENDIF |
---|
| 3567 | |
---|
| 3568 | ! |
---|
[217] | 3569 | !-- Check &userpar parameters |
---|
| 3570 | CALL user_check_parameters |
---|
[1] | 3571 | |
---|
[217] | 3572 | |
---|
[667] | 3573 | |
---|
[1] | 3574 | END SUBROUTINE check_parameters |
---|