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