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