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