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

Last change on this file since 1212 was 1212, checked in by raasch, 11 years ago

tridia-solver moved to seperate module; the tridiagonal matrix coefficients of array tri are calculated only once at the beginning

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