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