source: palm/trunk/SOURCE/check_parameters.f90 @ 1215

Last change on this file since 1215 was 1215, checked in by kanani, 11 years ago

last commit documented

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