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