source: palm/trunk/SOURCE/header.f90 @ 3294

Last change on this file since 3294 was 3294, checked in by raasch, 6 years ago

modularization of the ocean code

  • Property svn:keywords set to Id
File size: 93.3 KB
Line 
1!> @file header.f90
2!------------------------------------------------------------------------------!
3! This file is part of the PALM model system.
4!
5! PALM is free software: you can redistribute it and/or modify it under the
6! terms of the GNU General Public License as published by the Free Software
7! Foundation, either version 3 of the License, or (at your option) any later
8! 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-2018 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: header.f90 3294 2018-10-01 02:37:10Z raasch $
27! changes concerning modularization of ocean option
28!
29! 3274 2018-09-24 15:42:55Z knoop
30! Modularization of all bulk cloud physics code components
31!
32! 3241 2018-09-12 15:02:00Z raasch
33! unused variables removed
34!
35! 3232 2018-09-07 12:21:44Z raasch
36! Increase printed length of run identifier
37!
38! 3225 2018-08-30 16:33:14Z kanani
39! Increase printed length of run identifier
40!
41! 3083 2018-06-19 14:03:12Z gronemeier
42! Print RANS-mode constants
43!
44! 3065 2018-06-12 07:03:02Z Giersch
45! Header output concerning stretching revised
46!
47! 3045 2018-05-28 07:55:41Z Giersch
48! Error messages revised
49!
50! 2967 2018-04-13 11:22:08Z raasch
51! bugfix: missing parallel cpp-directives added
52!
53! 2883 2018-03-14 08:29:10Z Giersch
54! Format of the output of dt_dopr_listing (325) has been changed
55!
56! 2817 2018-02-19 16:32:21Z knoop
57! Preliminary gust module interface implemented
58!
59! 2776 2018-01-31 10:44:42Z Giersch
60! Variable synthetic_turbulence_generator has been abbreviated
61!
62! 2746 2018-01-15 12:06:04Z suehring
63! Move flag plant canopy to modules
64!
65! 2718 2018-01-02 08:49:38Z maronga
66! Corrected "Former revisions" section
67!
68! 2701 2017-12-15 15:40:50Z suehring
69! Changes from last commit documented
70!
71! 2698 2017-12-14 18:46:24Z suehring
72! Bugfix in get_topography_top_index
73!
74! 2696 2017-12-14 17:12:51Z kanani
75! Change in file header (GPL part)
76! Print information about turbulence closure (TG)
77! Print information about inifor initialization (MS)
78!
79! 2575 2017-10-24 09:57:58Z maronga
80! Added output for complex terrain simulations
81!
82! 2544 2017-10-13 18:09:32Z maronga
83! Moved initial day of year and time to inipar.
84!
85! 2339 2017-08-07 13:55:26Z gronemeier
86! corrected timestamp in header
87!
88! 2338 2017-08-07 12:15:38Z gronemeier
89! Modularize 1D model
90!
91! 2320 2017-07-21 12:47:43Z suehring
92! Modularize large-scale forcing and nudging
93!
94! 2300 2017-06-29 13:31:14Z raasch
95! host-specific code removed
96!
97! 2299 2017-06-29 10:14:38Z maronga
98! Modified output for spinups
99!
100! 2298 2017-06-29 09:28:18Z raasch
101! MPI2 related parts removed
102!
103! 2270 2017-06-09 12:18:47Z maronga
104! Renamed Prandtl layer to constant flux layer
105!
106! 2259 2017-06-08 09:09:11Z gronemeier
107! Implemented synthetic turbulence generator
108!
109! 2258 2017-06-08 07:55:13Z suehring
110! Bugfix, add pre-preprocessor directives to enable non-parrallel mode
111!
112! 2233 2017-05-30 18:08:54Z suehring
113!
114! 2232 2017-05-30 17:47:52Z suehring
115! Adjustments to new topography and surface concept
116! Generic tunnel setup added
117!
118! 2200 2017-04-11 11:37:51Z suehring
119! monotonic_adjustment removed
120!
121! 2118 2017-01-17 16:38:49Z raasch
122! OpenACC relatec code removed
123!
124! 2073 2016-11-30 14:34:05Z raasch
125! small bugfix concerning output of scalar profiles
126!
127! 2050 2016-11-08 15:00:55Z gronemeier
128! Implement turbulent outflow condition
129!
130! 2037 2016-10-26 11:15:40Z knoop
131! Anelastic approximation implemented
132!
133! 2000 2016-08-20 18:09:15Z knoop
134! Forced header and separation lines into 80 columns
135!
136! 1992 2016-08-12 15:14:59Z suehring
137! Adapted for top_scalarflux
138!
139! 1960 2016-07-12 16:34:24Z suehring
140! Treat humidity and passive scalar separately.
141! Modify misleading information concerning humidity.
142! Bugfix, change unit for humidity flux.
143!
144! 1957 2016-07-07 10:43:48Z suehring
145! flight module added
146!
147! 1931 2016-06-10 12:06:59Z suehring
148! Rename multigrid into multigrid_noopt
149!
150! 1902 2016-05-09 11:18:56Z suehring
151! Write information about masking_method only for multigrid solver
152!
153! 1849 2016-04-08 11:33:18Z hoffmann
154! Adapted for modularization of microphysics
155!
156! 1833 2016-04-07 14:23:03Z raasch
157! spectrum renamed spectra_mod, output of spectra related quantities moved to
158! spectra_mod
159!
160! 1831 2016-04-07 13:15:51Z hoffmann
161! turbulence renamed collision_turbulence,
162! drizzle renamed cloud_water_sedimentation
163!
164! 1826 2016-04-07 12:01:39Z maronga
165! Moved radiation model header output to the respective module.
166! Moved canopy model header output to the respective module.
167!
168! 1822 2016-04-07 07:49:42Z hoffmann
169! Tails removed. icloud_scheme replaced by microphysics_*
170!
171! 1817 2016-04-06 15:44:20Z maronga
172! Moved land_surface_model header output to the respective module.
173!
174! 1808 2016-04-05 19:44:00Z raasch
175! routine local_flush replaced by FORTRAN statement
176!
177! 1797 2016-03-21 16:50:28Z raasch
178! output of nesting datatransfer mode
179!
180! 1791 2016-03-11 10:41:25Z raasch
181! output of nesting informations of all domains
182!
183! 1788 2016-03-10 11:01:04Z maronga
184! Parameter dewfall removed
185!
186! 1786 2016-03-08 05:49:27Z raasch
187! cpp-direktives for spectra removed
188!
189! 1783 2016-03-06 18:36:17Z raasch
190! netcdf module and variable names changed, output of netcdf_deflate
191!
192! 1764 2016-02-28 12:45:19Z raasch
193! output of nesting informations
194!
195! 1697 2015-10-28 17:14:10Z raasch
196! small E- and F-FORMAT changes to avoid informative compiler messages about
197! insufficient field width
198!
199! 1691 2015-10-26 16:17:44Z maronga
200! Renamed prandtl_layer to constant_flux_layer, renames rif_min/rif_max to
201! zeta_min/zeta_max.
202!
203! 1682 2015-10-07 23:56:08Z knoop
204! Code annotations made doxygen readable
205!
206! 1675 2015-10-02 08:28:59Z gronemeier
207! Bugfix: Definition of topography grid levels
208!
209! 1660 2015-09-21 08:15:16Z gronemeier
210! Bugfix: Definition of building/street canyon height if vertical grid stretching
211!         starts below the maximum topography height.
212!
213! 1590 2015-05-08 13:56:27Z maronga
214! Bugfix: Added TRIM statements for character strings for LSM and radiation code
215!
216! 1585 2015-04-30 07:05:52Z maronga
217! Further output for radiation model(s).
218!
219! 1575 2015-03-27 09:56:27Z raasch
220! adjustments for psolver-queries, output of seed_follows_topography
221!
222! 1560 2015-03-06 10:48:54Z keck
223! output for recycling y shift
224!
225! 1557 2015-03-05 16:43:04Z suehring
226! output for monotonic limiter
227!
228! 1551 2015-03-03 14:18:16Z maronga
229! Added informal output for land surface model and radiation model. Removed typo.
230!
231! 1496 2014-12-02 17:25:50Z maronga
232! Renamed: "radiation -> "cloud_top_radiation"
233!
234! 1484 2014-10-21 10:53:05Z kanani
235! Changes due to new module structure of the plant canopy model:
236!   module plant_canopy_model_mod and output for new canopy model parameters
237!   (alpha_lad, beta_lad, lai_beta,...) added,
238!   drag_coefficient, leaf_surface_concentration and scalar_exchange_coefficient
239!   renamed to canopy_drag_coeff, leaf_surface_conc and leaf_scalar_exch_coeff,
240!   learde renamed leaf_area_density.
241! Bugfix: DO-WHILE-loop for lad header information additionally restricted
242! by maximum number of gradient levels (currently 10)
243!
244! 1482 2014-10-18 12:34:45Z raasch
245! information about calculated or predefined virtual processor topology adjusted
246!
247! 1468 2014-09-24 14:06:57Z maronga
248! Adapted for use on up to 6-digit processor cores
249!
250! 1429 2014-07-15 12:53:45Z knoop
251! header exended to provide ensemble_member_nr if specified
252!
253! 1376 2014-04-26 11:21:22Z boeske
254! Correction of typos
255!
256! 1365 2014-04-22 15:03:56Z boeske
257! New section 'Large scale forcing and nudging':
258! output of large scale forcing and nudging information,
259! new section for initial profiles created
260!
261! 1359 2014-04-11 17:15:14Z hoffmann
262! dt_sort_particles removed
263!
264! 1353 2014-04-08 15:21:23Z heinze
265! REAL constants provided with KIND-attribute
266!
267! 1327 2014-03-21 11:00:16Z raasch
268! parts concerning iso2d and avs output removed,
269! -netcdf output queries
270!
271! 1324 2014-03-21 09:13:16Z suehring
272! Bugfix: module spectrum added
273!
274! 1322 2014-03-20 16:38:49Z raasch
275! REAL functions provided with KIND-attribute,
276! some REAL constants defined as wp-kind
277!
278! 1320 2014-03-20 08:40:49Z raasch
279! ONLY-attribute added to USE-statements,
280! kind-parameters added to all INTEGER and REAL declaration statements,
281! kinds are defined in new module kinds,
282! revision history before 2012 removed,
283! comment fields (!:) to be used for variable explanations added to
284! all variable declaration statements
285!
286! 1308 2014-03-13 14:58:42Z fricke
287! output of the fixed number of output time levels
288! output_format adjusted for masked data if netcdf_data_format > 5
289!
290! 1299 2014-03-06 13:15:21Z heinze
291! output for using large_scale subsidence in combination
292! with large_scale_forcing
293! reformatting, more detailed explanations
294!
295! 1241 2013-10-30 11:36:58Z heinze
296! output for nudging + large scale forcing from external file
297!
298! 1216 2013-08-26 09:31:42Z raasch
299! output for transpose_compute_overlap
300!
301! 1212 2013-08-15 08:46:27Z raasch
302! output for poisfft_hybrid removed
303!
304! 1179 2013-06-14 05:57:58Z raasch
305! output of reference_state, use_reference renamed use_single_reference_value
306!
307! 1159 2013-05-21 11:58:22Z fricke
308! +use_cmax
309!
310! 1115 2013-03-26 18:16:16Z hoffmann
311! descriptions for Seifert-Beheng-cloud-physics-scheme added
312!
313! 1111 2013-03-08 23:54:10Z raasch
314! output of accelerator board information
315! ibc_p_b = 2 removed
316!
317! 1108 2013-03-05 07:03:32Z raasch
318! bugfix for r1106
319!
320! 1106 2013-03-04 05:31:38Z raasch
321! some format changes for coupled runs
322!
323! 1092 2013-02-02 11:24:22Z raasch
324! unused variables removed
325!
326! 1036 2012-10-22 13:43:42Z raasch
327! code put under GPL (PALM 3.9)
328!
329! 1031 2012-10-19 14:35:30Z raasch
330! output of netCDF data format modified
331!
332! 1015 2012-09-27 09:23:24Z raasch
333! output of Adjustment of mixing length to the Prandtl mixing length at first
334! grid point above ground removed
335!
336! 1003 2012-09-14 14:35:53Z raasch
337! output of information about equal/unequal subdomain size removed
338!
339! 1001 2012-09-13 14:08:46Z raasch
340! all actions concerning leapfrog- and upstream-spline-scheme removed
341!
342! 978 2012-08-09 08:28:32Z fricke
343! -km_damp_max, outflow_damping_width
344! +pt_damping_factor, pt_damping_width
345! +z0h
346!
347! 964 2012-07-26 09:14:24Z raasch
348! output of profil-related quantities removed
349!
350! 940 2012-07-09 14:31:00Z raasch
351! Output in case of simulations for pure neutral stratification (no pt-equation
352! solved)
353!
354! 927 2012-06-06 19:15:04Z raasch
355! output of masking_method for mg-solver
356!
357! 868 2012-03-28 12:21:07Z raasch
358! translation velocity in Galilean transformation changed to 0.6 * ug
359!
360! 833 2012-02-22 08:55:55Z maronga
361! Adjusted format for leaf area density
362!
363! 828 2012-02-21 12:00:36Z raasch
364! output of dissipation_classes + radius_classes
365!
366! 825 2012-02-19 03:03:44Z raasch
367! Output of cloud physics parameters/quantities complemented and restructured
368!
369! Revision 1.1  1997/08/11 06:17:20  raasch
370! Initial revision
371!
372!
373! Description:
374! ------------
375!> Writing a header with all important information about the current run.
376!> This subroutine is called three times, two times at the beginning
377!> (writing information on files RUN_CONTROL and HEADER) and one time at the
378!> end of the run, then writing additional information about CPU-usage on file
379!> header.
380!-----------------------------------------------------------------------------!
381 SUBROUTINE header
382 
383
384    USE arrays_3d,                                                             &
385        ONLY:  pt_init, q_init, s_init, sa_init, ug, vg, w_subs, zu, zw
386
387    USE basic_constants_and_equations_mod,                                     &
388        ONLY:  g, kappa, l_v, r_d
389
390    USE bulk_cloud_model_mod,                                                  &
391        ONLY:  bulk_cloud_model, bcm_header
392
393    USE control_parameters
394
395    USE cpulog,                                                                &
396        ONLY:  log_point_s
397           
398    USE date_and_time_mod,                                                     &
399        ONLY:  day_of_year_init, time_utc_init
400
401    USE dvrp_variables,                                                        &
402        ONLY:  use_seperate_pe_for_dvrp_output
403       
404    USE flight_mod,                                                            &
405        ONLY:  flight_header
406       
407    USE grid_variables,                                                        &
408        ONLY:  dx, dy
409
410    USE gust_mod,                                                              &
411        ONLY: gust_header, gust_module_enabled
412       
413    USE indices,                                                               &
414        ONLY:  mg_loc_ind, nnx, nny, nnz, nx, ny, nxl_mg, nxr_mg, nyn_mg,      &
415               nys_mg, nzt, nzt_mg
416       
417    USE kinds
418 
419    USE land_surface_model_mod,                                                &
420        ONLY: lsm_header
421
422    USE lsf_nudging_mod,                                                       &
423        ONLY:  lsf_nudging_header
424
425    USE model_1d_mod,                                                          &
426        ONLY:  damp_level_ind_1d, dt_pr_1d, dt_run_control_1d, end_time_1d
427
428    USE netcdf_interface,                                                      &
429        ONLY:  netcdf_data_format, netcdf_data_format_string, netcdf_deflate
430
431    USE ocean_mod,                                                             &
432        ONLY:  ibc_sa_t, prho_reference, sa_surface, sa_vertical_gradient,     &
433               sa_vertical_gradient_level, sa_vertical_gradient_level_ind
434
435    USE particle_attributes,                                                   &
436        ONLY:  bc_par_b, bc_par_lr, bc_par_ns, bc_par_t, collision_kernel,     &
437               curvature_solution_effects,                                     &
438               density_ratio, dissipation_classes, dt_min_part, dt_prel,       &
439               dt_write_particle_data, end_time_prel,                          &
440               number_of_particle_groups, particle_advection,                  &
441               particle_advection_start,                                       &
442               particles_per_point, pdx, pdy, pdz,  psb, psl, psn, psr, pss,   &
443               pst, radius, radius_classes, random_start_position,             &
444               seed_follows_topography,                                        &
445               total_number_of_particles, use_sgs_for_particles,               &
446               vertical_particle_advection, write_particle_statistics
447       
448    USE pegrid
449
450    USE plant_canopy_model_mod,                                                &
451        ONLY:  pcm_header
452
453#if defined( __parallel )
454    USE pmc_handle_communicator,                                               &
455        ONLY:  pmc_get_model_info
456#endif
457
458    USE pmc_interface,                                                         &
459        ONLY:  nested_run, nesting_datatransfer_mode, nesting_mode
460
461    USE radiation_model_mod,                                                   &
462        ONLY:  radiation, radiation_header
463   
464    USE spectra_mod,                                                           &
465        ONLY:  calculate_spectra, spectra_header
466
467    USE surface_mod,                                                           &
468        ONLY:  surf_def_h, get_topography_top_index_ji
469
470    USE synthetic_turbulence_generator_mod,                                    &
471        ONLY:  stg_header
472
473    USE turbulence_closure_mod,                                                &
474        ONLY:  rans_const_c, rans_const_sigma
475
476    IMPLICIT NONE
477
478   
479    CHARACTER (LEN=2)  ::  do2d_mode           !<
480   
481    CHARACTER (LEN=5)  ::  section_chr         !<
482   
483    CHARACTER (LEN=10) ::  coor_chr            !<
484    CHARACTER (LEN=10) ::  host_chr            !<
485   
486    CHARACTER (LEN=16) ::  begin_chr           !<
487   
488    CHARACTER (LEN=26) ::  ver_rev             !<
489
490    CHARACTER (LEN=32) ::  cpl_name            !<
491   
492    CHARACTER (LEN=40) ::  output_format       !<
493   
494    CHARACTER (LEN=70) ::  char1               !<
495    CHARACTER (LEN=70) ::  char2               !<
496    CHARACTER (LEN=70) ::  dopr_chr            !<
497    CHARACTER (LEN=70) ::  do2d_xy             !<
498    CHARACTER (LEN=70) ::  do2d_xz             !<
499    CHARACTER (LEN=70) ::  do2d_yz             !<
500    CHARACTER (LEN=70) ::  do3d_chr            !<
501    CHARACTER (LEN=70) ::  domask_chr          !<
502    CHARACTER (LEN=70) ::  run_classification  !<
503   
504    CHARACTER (LEN=85) ::  r_upper             !<
505    CHARACTER (LEN=85) ::  r_lower             !<
506   
507    CHARACTER (LEN=86) ::  coordinates         !<
508    CHARACTER (LEN=86) ::  gradients           !<
509    CHARACTER (LEN=86) ::  slices              !<
510    CHARACTER (LEN=86) ::  temperatures        !<
511    CHARACTER (LEN=86) ::  ugcomponent         !<
512    CHARACTER (LEN=86) ::  vgcomponent         !<
513
514    CHARACTER (LEN=1), DIMENSION(1:3) ::  dir = (/ 'x', 'y', 'z' /)  !<
515
516    INTEGER(iwp) ::  av             !<
517    INTEGER(iwp) ::  bh             !<
518    INTEGER(iwp) ::  blx            !<
519    INTEGER(iwp) ::  bly            !<
520    INTEGER(iwp) ::  bxl            !<
521    INTEGER(iwp) ::  bxr            !<
522    INTEGER(iwp) ::  byn            !<
523    INTEGER(iwp) ::  bys            !<
524    INTEGER(iwp) ::  ch             !<
525    INTEGER(iwp) ::  count          !<
526    INTEGER(iwp) ::  cpl_parent_id  !<
527    INTEGER(iwp) ::  cwx            !<
528    INTEGER(iwp) ::  cwy            !<
529    INTEGER(iwp) ::  cxl            !<
530    INTEGER(iwp) ::  cxr            !<
531    INTEGER(iwp) ::  cyn            !<
532    INTEGER(iwp) ::  cys            !<
533    INTEGER(iwp) ::  dim            !<
534    INTEGER(iwp) ::  i              !<
535    INTEGER(iwp) ::  io             !<
536    INTEGER(iwp) ::  l              !<
537    INTEGER(iwp) ::  ll             !<
538    INTEGER(iwp) ::  my_cpl_id      !<
539    INTEGER(iwp) ::  n              !<
540    INTEGER(iwp) ::  ncpl           !<
541    INTEGER(iwp) ::  npe_total      !<
542   
543
544    REAL(wp) ::  cpuseconds_per_simulated_second  !<
545    REAL(wp) ::  lower_left_coord_x               !< x-coordinate of nest domain
546    REAL(wp) ::  lower_left_coord_y               !< y-coordinate of nest domain
547
548!
549!-- Open the output file. At the end of the simulation, output is directed
550!-- to unit 19.
551    IF ( ( runnr == 0 .OR. force_print_header )  .AND. &
552         .NOT. simulated_time_at_begin /= simulated_time )  THEN
553       io = 15   !  header output on file RUN_CONTROL
554    ELSE
555       io = 19   !  header output on file HEADER
556    ENDIF
557    CALL check_open( io )
558
559!
560!-- At the end of the run, output file (HEADER) will be rewritten with
561!-- new information
562    IF ( io == 19 .AND. simulated_time_at_begin /= simulated_time ) REWIND( 19 )
563
564!
565!-- Determine kind of model run
566    IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
567       run_classification = 'restart run'
568    ELSEIF ( TRIM( initializing_actions ) == 'cyclic_fill' )  THEN
569       run_classification = 'run with cyclic fill of 3D - prerun data'
570    ELSEIF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 )  THEN
571       run_classification = 'run without 1D - prerun'
572    ELSEIF ( INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 )  THEN
573       run_classification = 'run with 1D - prerun'
574    ELSEIF ( INDEX( initializing_actions, 'inifor' ) /= 0 )  THEN
575       run_classification = 'run initialized with COSMO data'
576    ELSEIF ( INDEX( initializing_actions, 'by_user' ) /=0 )  THEN
577       run_classification = 'run initialized by user'
578    ELSEIF ( INDEX( initializing_actions, 'initialize_vortex' ) /=0 )  THEN
579       run_classification = 'run additionally initialized by a Rankine-vortex'
580    ELSEIF ( INDEX( initializing_actions, 'initialize_ptanom' ) /=0 )  THEN
581       run_classification = 'run additionally initialized by temperature anomaly'
582    ELSE
583       message_string = ' unknown action(s): ' // TRIM( initializing_actions )
584       CALL message( 'header', 'PA0191', 0, 0, 0, 6, 0 )
585    ENDIF
586    IF ( nested_run )  run_classification = 'nested ' // run_classification(1:63)
587    IF ( ocean_mode )  THEN
588       run_classification = 'ocean - ' // run_classification(1:61)
589    ELSE
590       run_classification = 'atmosphere - ' // run_classification(1:57)
591    ENDIF
592
593!
594!-- Run-identification, date, time, host
595    host_chr = host(1:10)
596    ver_rev = TRIM( version ) // '  ' // TRIM( revision )
597    WRITE ( io, 100 )  ver_rev, TRIM( run_classification )
598    IF ( TRIM( coupling_mode ) /= 'uncoupled' )  THEN
599       WRITE ( io, 101 )  coupling_mode
600    ENDIF
601#if defined( __parallel )
602    IF ( coupling_start_time /= 0.0_wp  .AND. .NOT. spinup )  THEN
603       IF ( coupling_start_time > simulated_time_at_begin )  THEN
604          WRITE ( io, 109 )
605       ELSE
606          WRITE ( io, 114 )
607       ENDIF
608    ENDIF
609#endif
610    IF ( ensemble_member_nr /= 0 )  THEN
611       WRITE ( io, 512 )  run_date, run_identifier, run_time, runnr,           &
612                       ADJUSTR( host_chr ), ensemble_member_nr
613    ELSE
614       WRITE ( io, 102 )  run_date, run_identifier, run_time, runnr,           &
615                       ADJUSTR( host_chr )
616    ENDIF
617#if defined( __parallel )
618    IF ( npex == -1  .AND.  npey == -1 )  THEN
619       char1 = 'calculated'
620    ELSE
621       char1 = 'predefined'
622    ENDIF
623    IF ( threads_per_task == 1 )  THEN
624       WRITE ( io, 103 )  numprocs, pdims(1), pdims(2), TRIM( char1 )
625    ELSE
626       WRITE ( io, 104 )  numprocs*threads_per_task, numprocs, &
627                          threads_per_task, pdims(1), pdims(2), TRIM( char1 )
628    ENDIF
629
630    IF ( pdims(2) == 1 )  THEN
631       WRITE ( io, 107 )  'x'
632    ELSEIF ( pdims(1) == 1 )  THEN
633       WRITE ( io, 107 )  'y'
634    ENDIF
635    IF ( use_seperate_pe_for_dvrp_output )  WRITE ( io, 105 )
636    IF ( numprocs /= maximum_parallel_io_streams )  THEN
637       WRITE ( io, 108 )  maximum_parallel_io_streams
638    ENDIF
639#endif
640
641!
642!-- Nesting informations
643    IF ( nested_run )  THEN
644
645#if defined( __parallel )
646       WRITE ( io, 600 )  TRIM( nesting_mode ),                                &
647                          TRIM( nesting_datatransfer_mode )
648       CALL pmc_get_model_info( ncpl = ncpl, cpl_id = my_cpl_id )
649
650       DO  n = 1, ncpl
651          CALL pmc_get_model_info( request_for_cpl_id = n, cpl_name = cpl_name,&
652                                   cpl_parent_id = cpl_parent_id,              &
653                                   lower_left_x = lower_left_coord_x,          &
654                                   lower_left_y = lower_left_coord_y,          &
655                                   npe_total = npe_total )
656          IF ( n == my_cpl_id )  THEN
657             char1 = '*'
658          ELSE
659             char1 = ' '
660          ENDIF
661          WRITE ( io, 601 )  TRIM( char1 ), n, cpl_parent_id, npe_total,       &
662                             lower_left_coord_x, lower_left_coord_y,           &
663                             TRIM( cpl_name )
664       ENDDO
665#endif
666
667    ENDIF
668    WRITE ( io, 99 )
669
670!
671!-- Numerical schemes
672    WRITE ( io, 110 )
673    IF ( rans_mode )  THEN
674       WRITE ( io, 124 )  TRIM( turbulence_closure ), 'RANS'
675    ELSE
676       WRITE ( io, 124 )  TRIM( turbulence_closure ), 'LES'
677    ENDIF
678    WRITE ( io, 121 )  TRIM( approximation )
679    IF ( psolver(1:7) == 'poisfft' )  THEN
680       WRITE ( io, 111 )  TRIM( fft_method )
681       IF ( transpose_compute_overlap )  WRITE( io, 115 )
682    ELSEIF ( psolver == 'sor' )  THEN
683       WRITE ( io, 112 )  nsor_ini, nsor, omega_sor
684    ELSEIF ( psolver(1:9) == 'multigrid' )  THEN
685       WRITE ( io, 135 )  TRIM(psolver), cycle_mg, maximum_grid_level, ngsrb
686       IF ( mg_cycles == -1 )  THEN
687          WRITE ( io, 140 )  residual_limit
688       ELSE
689          WRITE ( io, 141 )  mg_cycles
690       ENDIF
691       IF ( mg_switch_to_pe0_level == 0 )  THEN
692          WRITE ( io, 136 )  nxr_mg(1)-nxl_mg(1)+1, nyn_mg(1)-nys_mg(1)+1, &
693                             nzt_mg(1)
694       ELSEIF (  mg_switch_to_pe0_level /= -1 )  THEN
695          WRITE ( io, 137 )  mg_switch_to_pe0_level,            &
696                             mg_loc_ind(2,0)-mg_loc_ind(1,0)+1, &
697                             mg_loc_ind(4,0)-mg_loc_ind(3,0)+1, &
698                             nzt_mg(mg_switch_to_pe0_level),    &
699                             nxr_mg(1)-nxl_mg(1)+1, nyn_mg(1)-nys_mg(1)+1, &
700                             nzt_mg(1)
701       ENDIF
702       IF ( psolver == 'multigrid_noopt' .AND. masking_method )  WRITE ( io, 144 )
703    ENDIF
704    IF ( call_psolver_at_all_substeps  .AND. timestep_scheme(1:5) == 'runge' ) &
705    THEN
706       WRITE ( io, 142 )
707    ENDIF
708
709    IF ( momentum_advec == 'pw-scheme' )  THEN
710       WRITE ( io, 113 )
711    ELSEIF (momentum_advec == 'ws-scheme' )  THEN
712       WRITE ( io, 503 )
713    ENDIF
714    IF ( scalar_advec == 'pw-scheme' )  THEN
715       WRITE ( io, 116 )
716    ELSEIF ( scalar_advec == 'ws-scheme' )  THEN
717       WRITE ( io, 504 )
718    ELSE
719       WRITE ( io, 118 )
720    ENDIF
721
722    WRITE ( io, 139 )  TRIM( loop_optimization )
723
724    IF ( galilei_transformation )  THEN
725       IF ( use_ug_for_galilei_tr )  THEN
726          char1 = '0.6 * geostrophic wind'
727       ELSE
728          char1 = 'mean wind in model domain'
729       ENDIF
730       IF ( simulated_time_at_begin == simulated_time )  THEN
731          char2 = 'at the start of the run'
732       ELSE
733          char2 = 'at the end of the run'
734       ENDIF
735       WRITE ( io, 119 )  TRIM( char1 ), TRIM( char2 ),                        &
736                          advected_distance_x/1000.0_wp,                       &
737                          advected_distance_y/1000.0_wp
738    ENDIF
739    WRITE ( io, 122 )  timestep_scheme
740    IF ( use_upstream_for_tke )  WRITE ( io, 143 )
741    IF ( rayleigh_damping_factor /= 0.0_wp )  THEN
742       IF ( .NOT. ocean_mode )  THEN
743          WRITE ( io, 123 )  'above', rayleigh_damping_height, &
744               rayleigh_damping_factor
745       ELSE
746          WRITE ( io, 123 )  'below', rayleigh_damping_height, &
747               rayleigh_damping_factor
748       ENDIF
749    ENDIF
750    IF ( neutral )  WRITE ( io, 131 )  pt_surface
751    IF ( humidity )  THEN
752       IF ( .NOT. bulk_cloud_model )  THEN
753          WRITE ( io, 129 )
754       ELSE
755          WRITE ( io, 130 )
756       ENDIF
757    ENDIF
758    IF ( passive_scalar )  WRITE ( io, 134 )
759    IF ( conserve_volume_flow )  THEN
760       WRITE ( io, 150 )  conserve_volume_flow_mode
761       IF ( TRIM( conserve_volume_flow_mode ) == 'bulk_velocity' )  THEN
762          WRITE ( io, 151 )  u_bulk, v_bulk
763       ENDIF
764    ELSEIF ( dp_external )  THEN
765       IF ( dp_smooth )  THEN
766          WRITE ( io, 152 )  dpdxy, dp_level_b, ', vertically smoothed.'
767       ELSE
768          WRITE ( io, 152 )  dpdxy, dp_level_b, '.'
769       ENDIF
770    ENDIF
771    WRITE ( io, 99 )
772
773!
774!-- Runtime and timestep information
775    WRITE ( io, 200 )
776    IF ( .NOT. dt_fixed )  THEN
777       WRITE ( io, 201 )  dt_max, cfl_factor
778    ELSE
779       WRITE ( io, 202 )  dt
780    ENDIF
781    WRITE ( io, 203 )  simulated_time_at_begin, end_time
782
783    IF ( time_restart /= 9999999.9_wp  .AND. &
784         simulated_time_at_begin == simulated_time )  THEN
785       IF ( dt_restart == 9999999.9_wp )  THEN
786          WRITE ( io, 204 )  ' Restart at:       ',time_restart
787       ELSE
788          WRITE ( io, 205 )  ' Restart at:       ',time_restart, dt_restart
789       ENDIF
790    ENDIF
791
792    IF ( simulated_time_at_begin /= simulated_time )  THEN
793       i = MAX ( log_point_s(10)%counts, 1 )
794       IF ( ( simulated_time - simulated_time_at_begin ) == 0.0_wp )  THEN
795          cpuseconds_per_simulated_second = 0.0_wp
796       ELSE
797          cpuseconds_per_simulated_second = log_point_s(10)%sum / &
798                                            ( simulated_time -    &
799                                              simulated_time_at_begin )
800       ENDIF
801       WRITE ( io, 206 )  simulated_time, log_point_s(10)%sum,      &
802                          log_point_s(10)%sum / REAL( i, KIND=wp ), &
803                          cpuseconds_per_simulated_second
804       IF ( time_restart /= 9999999.9_wp  .AND.  time_restart < end_time )  THEN
805          IF ( dt_restart == 9999999.9_wp )  THEN
806             WRITE ( io, 204 )  ' Next restart at:     ',time_restart
807          ELSE
808             WRITE ( io, 205 )  ' Next restart at:     ',time_restart, dt_restart
809          ENDIF
810       ENDIF
811    ENDIF
812
813
814!
815!-- Start time for coupled runs, if independent precursor runs for atmosphere
816!-- and ocean are used or have been used. In this case, coupling_start_time
817!-- defines the time when the coupling is switched on.
818    IF ( coupling_start_time /= 0.0_wp )  THEN
819       WRITE ( io, 207 )  coupling_start_time
820    ENDIF
821
822!
823!-- Computational grid
824    IF ( .NOT. ocean_mode )  THEN
825       WRITE ( io, 250 )  dx, dy
826       
827       DO i = 1, number_stretch_level_start+1
828          WRITE ( io, 253 )  i, dz(i)
829       ENDDO
830       
831       WRITE( io, 251 ) (nx+1)*dx, (ny+1)*dy, zu(nzt+1)
832       
833       IF ( ANY( dz_stretch_level_start_index < nzt+1 ) )  THEN
834          WRITE( io, '(A)', advance='no') ' Vertical stretching starts at height:'
835          DO i = 1, number_stretch_level_start
836             WRITE ( io, '(F10.1,A3)', advance='no' )  dz_stretch_level_start(i), ' m,'
837          ENDDO
838          WRITE( io, '(/,A)', advance='no') ' Vertical stretching starts at index: '
839          DO i = 1, number_stretch_level_start
840             WRITE ( io, '(I12,A1)', advance='no' )  dz_stretch_level_start_index(i), ','
841          ENDDO
842          WRITE( io, '(/,A)', advance='no') ' Vertical stretching ends at height:  '
843          DO i = 1, number_stretch_level_start
844             WRITE ( io, '(F10.1,A3)', advance='no' )  dz_stretch_level_end(i), ' m,'
845          ENDDO
846          WRITE( io, '(/,A)', advance='no') ' Vertical stretching ends at index:   '
847          DO i = 1, number_stretch_level_start
848             WRITE ( io, '(I12,A1)', advance='no' )  dz_stretch_level_end_index(i), ','
849          ENDDO
850          WRITE( io, '(/,A)', advance='no') ' Factor used for stretching:          '
851          DO i = 1, number_stretch_level_start
852             WRITE ( io, '(F12.3,A1)', advance='no' )  dz_stretch_factor_array(i), ','
853          ENDDO
854       ENDIF
855       
856    ELSE
857       WRITE ( io, 250 )  dx, dy
858       DO i = 1, number_stretch_level_start+1
859          WRITE ( io, 253 )  i, dz(i)
860       ENDDO
861       
862       WRITE ( io, 251 ) (nx+1)*dx, (ny+1)*dy, zu(0)
863       
864       IF ( ANY( dz_stretch_level_start_index > 0 ) )  THEN
865          WRITE( io, '(A)', advance='no') ' Vertical stretching starts at height:'
866          DO i = 1, number_stretch_level_start
867             WRITE ( io, '(F10.1,A3)', advance='no' )  dz_stretch_level_start(i), ' m,'
868          ENDDO
869          WRITE( io, '(/,A)', advance='no') ' Vertical stretching starts at index: '
870          DO i = 1, number_stretch_level_start
871             WRITE ( io, '(I12,A1)', advance='no' )  dz_stretch_level_start_index(i), ','
872          ENDDO
873          WRITE( io, '(/,A)', advance='no') ' Vertical stretching ends at height:  '
874          DO i = 1, number_stretch_level_start
875             WRITE ( io, '(F10.1,A3)', advance='no' )  dz_stretch_level_end(i), ' m,'
876          ENDDO
877          WRITE( io, '(/,A)', advance='no') ' Vertical stretching ends at index:   '
878          DO i = 1, number_stretch_level_start
879             WRITE ( io, '(I12,A1)', advance='no' )  dz_stretch_level_end_index(i), ','
880          ENDDO
881          WRITE( io, '(/,A)', advance='no') ' Factor used for stretching:          '
882          DO i = 1, number_stretch_level_start
883             WRITE ( io, '(F12.3,A1)', advance='no' )  dz_stretch_factor_array(i), ','
884          ENDDO
885       ENDIF
886    ENDIF
887    WRITE ( io, 254 )  nx, ny, nzt+1, MIN( nnx, nx+1 ), MIN( nny, ny+1 ),      &
888                       MIN( nnz+2, nzt+2 )
889    IF ( sloping_surface )  WRITE ( io, 260 )  alpha_surface
890
891!
892!-- Large scale forcing and nudging
893    IF ( large_scale_forcing )  CALL lsf_nudging_header( io )
894
895!
896!-- Profile for the large scale vertial velocity
897!-- Building output strings, starting with surface value
898    IF ( large_scale_subsidence )  THEN
899       temperatures = '   0.0'
900       gradients = '------'
901       slices = '     0'
902       coordinates = '   0.0'
903       i = 1
904       DO  WHILE ( subs_vertical_gradient_level_i(i) /= -9999 )
905
906          WRITE (coor_chr,'(E10.2,7X)')  &
907                                w_subs(subs_vertical_gradient_level_i(i))
908          temperatures = TRIM( temperatures ) // ' ' // TRIM( coor_chr )
909
910          WRITE (coor_chr,'(E10.2,7X)')  subs_vertical_gradient(i)
911          gradients = TRIM( gradients ) // ' ' // TRIM( coor_chr )
912
913          WRITE (coor_chr,'(I10,7X)')  subs_vertical_gradient_level_i(i)
914          slices = TRIM( slices ) // ' ' // TRIM( coor_chr )
915
916          WRITE (coor_chr,'(F10.2,7X)')  subs_vertical_gradient_level(i)
917          coordinates = TRIM( coordinates ) // ' '  // TRIM( coor_chr )
918
919          IF ( i == 10 )  THEN
920             EXIT
921          ELSE
922             i = i + 1
923          ENDIF
924
925       ENDDO
926
927 
928       IF ( .NOT. large_scale_forcing )  THEN
929          WRITE ( io, 426 )  TRIM( coordinates ), TRIM( temperatures ), &
930                             TRIM( gradients ), TRIM( slices )
931       ENDIF
932
933
934    ENDIF
935
936!-- Profile of the geostrophic wind (component ug)
937!-- Building output strings
938    WRITE ( ugcomponent, '(F6.2)' )  ug_surface
939    gradients = '------'
940    slices = '     0'
941    coordinates = '   0.0'
942    i = 1
943    DO  WHILE ( ug_vertical_gradient_level_ind(i) /= -9999 )
944     
945       WRITE (coor_chr,'(F6.2,1X)')  ug(ug_vertical_gradient_level_ind(i))
946       ugcomponent = TRIM( ugcomponent ) // '  ' // TRIM( coor_chr )
947
948       WRITE (coor_chr,'(F6.2,1X)')  ug_vertical_gradient(i)
949       gradients = TRIM( gradients ) // '  ' // TRIM( coor_chr )
950
951       WRITE (coor_chr,'(I6,1X)')  ug_vertical_gradient_level_ind(i)
952       slices = TRIM( slices ) // '  ' // TRIM( coor_chr )
953
954       WRITE (coor_chr,'(F6.1,1X)')  ug_vertical_gradient_level(i)
955       coordinates = TRIM( coordinates ) // '  ' // TRIM( coor_chr )
956
957       IF ( i == 10 )  THEN
958          EXIT
959       ELSE
960          i = i + 1
961       ENDIF
962
963    ENDDO
964
965    IF ( .NOT. large_scale_forcing )  THEN
966       WRITE ( io, 423 )  TRIM( coordinates ), TRIM( ugcomponent ), &
967                          TRIM( gradients ), TRIM( slices )
968    ENDIF
969
970!-- Profile of the geostrophic wind (component vg)
971!-- Building output strings
972    WRITE ( vgcomponent, '(F6.2)' )  vg_surface
973    gradients = '------'
974    slices = '     0'
975    coordinates = '   0.0'
976    i = 1
977    DO  WHILE ( vg_vertical_gradient_level_ind(i) /= -9999 )
978
979       WRITE (coor_chr,'(F6.2,1X)')  vg(vg_vertical_gradient_level_ind(i))
980       vgcomponent = TRIM( vgcomponent ) // '  ' // TRIM( coor_chr )
981
982       WRITE (coor_chr,'(F6.2,1X)')  vg_vertical_gradient(i)
983       gradients = TRIM( gradients ) // '  ' // TRIM( coor_chr )
984
985       WRITE (coor_chr,'(I6,1X)')  vg_vertical_gradient_level_ind(i)
986       slices = TRIM( slices ) // '  ' // TRIM( coor_chr )
987
988       WRITE (coor_chr,'(F6.1,1X)')  vg_vertical_gradient_level(i)
989       coordinates = TRIM( coordinates ) // '  ' // TRIM( coor_chr )
990
991       IF ( i == 10 )  THEN
992          EXIT
993       ELSE
994          i = i + 1
995       ENDIF
996 
997    ENDDO
998
999    IF ( .NOT. large_scale_forcing )  THEN
1000       WRITE ( io, 424 )  TRIM( coordinates ), TRIM( vgcomponent ), &
1001                          TRIM( gradients ), TRIM( slices )
1002    ENDIF
1003
1004!
1005!-- Topography
1006    WRITE ( io, 270 )  topography
1007    SELECT CASE ( TRIM( topography ) )
1008
1009       CASE ( 'flat' )
1010          ! no actions necessary
1011
1012       CASE ( 'single_building' )
1013          blx = INT( building_length_x / dx )
1014          bly = INT( building_length_y / dy )
1015          bh  = MINLOC( ABS( zw - building_height ), 1 ) - 1
1016          IF ( ABS( zw(bh  ) - building_height ) == &
1017               ABS( zw(bh+1) - building_height )    )  bh = bh + 1
1018
1019          IF ( building_wall_left == 9999999.9_wp )  THEN
1020             building_wall_left = ( nx + 1 - blx ) / 2 * dx
1021          ENDIF
1022          bxl = INT ( building_wall_left / dx + 0.5_wp )
1023          bxr = bxl + blx
1024
1025          IF ( building_wall_south == 9999999.9_wp )  THEN
1026             building_wall_south = ( ny + 1 - bly ) / 2 * dy
1027          ENDIF
1028          bys = INT ( building_wall_south / dy + 0.5_wp )
1029          byn = bys + bly
1030
1031          WRITE ( io, 271 )  building_length_x, building_length_y, &
1032                             building_height, bxl, bxr, bys, byn
1033
1034       CASE ( 'single_street_canyon' )
1035          ch  = MINLOC( ABS( zw - canyon_height ), 1 ) - 1
1036          IF ( ABS( zw(ch  ) - canyon_height ) == &
1037               ABS( zw(ch+1) - canyon_height )    )  ch = ch + 1
1038          IF ( canyon_width_x /= 9999999.9_wp )  THEN
1039!
1040!--          Street canyon in y direction
1041             cwx = NINT( canyon_width_x / dx )
1042             IF ( canyon_wall_left == 9999999.9_wp )  THEN
1043                canyon_wall_left = ( nx + 1 - cwx ) / 2 * dx
1044             ENDIF
1045             cxl = NINT( canyon_wall_left / dx )
1046             cxr = cxl + cwx
1047             WRITE ( io, 272 )  'y', canyon_height, ch, 'u', cxl, cxr
1048
1049          ELSEIF ( canyon_width_y /= 9999999.9_wp )  THEN
1050!
1051!--          Street canyon in x direction
1052             cwy = NINT( canyon_width_y / dy )
1053             IF ( canyon_wall_south == 9999999.9_wp )  THEN
1054                canyon_wall_south = ( ny + 1 - cwy ) / 2 * dy
1055             ENDIF
1056             cys = NINT( canyon_wall_south / dy )
1057             cyn = cys + cwy
1058             WRITE ( io, 272 )  'x', canyon_height, ch, 'v', cys, cyn
1059          ENDIF
1060
1061       CASE ( 'tunnel' )
1062          IF ( tunnel_width_x /= 9999999.9_wp )  THEN
1063!
1064!--          Tunnel axis in y direction
1065             IF ( tunnel_length == 9999999.9_wp  .OR.                          &
1066                  tunnel_length >= ( nx + 1 ) * dx )  THEN
1067                WRITE ( io, 273 )  'y', tunnel_height, tunnel_wall_depth,      &
1068                                        tunnel_width_x
1069             ELSE
1070                WRITE ( io, 274 )  'y', tunnel_height, tunnel_wall_depth,      &
1071                                        tunnel_width_x, tunnel_length
1072             ENDIF
1073
1074          ELSEIF ( tunnel_width_y /= 9999999.9_wp )  THEN
1075!
1076!--          Tunnel axis in x direction
1077             IF ( tunnel_length == 9999999.9_wp  .OR.                          &
1078                  tunnel_length >= ( ny + 1 ) * dy )  THEN
1079                WRITE ( io, 273 )  'x', tunnel_height, tunnel_wall_depth,      &
1080                                        tunnel_width_y
1081             ELSE
1082                WRITE ( io, 274 )  'x', tunnel_height, tunnel_wall_depth,      &
1083                                        tunnel_width_y, tunnel_length
1084             ENDIF
1085          ENDIF
1086
1087    END SELECT
1088
1089    IF ( TRIM( topography ) /= 'flat' )  THEN
1090       IF ( TRIM( topography_grid_convention ) == ' ' )  THEN
1091          IF ( TRIM( topography ) == 'single_building' .OR.  &
1092               TRIM( topography ) == 'single_street_canyon' )  THEN
1093             WRITE ( io, 278 )
1094          ELSEIF ( TRIM( topography ) == 'read_from_file' )  THEN
1095             WRITE ( io, 279 )
1096          ENDIF
1097       ELSEIF ( TRIM( topography_grid_convention ) == 'cell_edge' )  THEN
1098          WRITE ( io, 278 )
1099       ELSEIF ( TRIM( topography_grid_convention ) == 'cell_center' )  THEN
1100          WRITE ( io, 279 )
1101       ENDIF
1102    ENDIF
1103
1104!-- Complex terrain
1105    IF ( complex_terrain )  THEN
1106       WRITE( io, 280 ) 
1107       IF ( turbulent_inflow )  THEN
1108          WRITE( io, 281 )  zu( get_topography_top_index_ji( 0, 0, 's' ) )
1109       ENDIF
1110       IF ( TRIM( initializing_actions ) == 'cyclic_fill' )  THEN
1111          WRITE( io, 282 )
1112       ENDIF
1113    ENDIF
1114
1115    IF ( syn_turb_gen )  CALL stg_header ( io )
1116
1117    IF ( plant_canopy )  CALL pcm_header ( io )
1118
1119    IF ( land_surface )  CALL lsm_header ( io )
1120
1121    IF ( radiation )  CALL radiation_header ( io )
1122
1123    IF ( gust_module_enabled )  CALL gust_header ( io )
1124
1125!
1126!-- Boundary conditions
1127    IF ( ibc_p_b == 0 )  THEN
1128       r_lower = 'p(0)     = 0      |'
1129    ELSEIF ( ibc_p_b == 1 )  THEN
1130       r_lower = 'p(0)     = p(1)   |'
1131    ENDIF
1132    IF ( ibc_p_t == 0 )  THEN
1133       r_upper  = 'p(nzt+1) = 0      |'
1134    ELSE
1135       r_upper  = 'p(nzt+1) = p(nzt) |'
1136    ENDIF
1137
1138    IF ( ibc_uv_b == 0 )  THEN
1139       r_lower = TRIM( r_lower ) // ' uv(0)     = -uv(1)                |'
1140    ELSE
1141       r_lower = TRIM( r_lower ) // ' uv(0)     = uv(1)                 |'
1142    ENDIF
1143    IF ( TRIM( bc_uv_t ) == 'dirichlet_0' )  THEN
1144       r_upper  = TRIM( r_upper  ) // ' uv(nzt+1) = 0                     |'
1145    ELSEIF ( ibc_uv_t == 0 )  THEN
1146       r_upper  = TRIM( r_upper  ) // ' uv(nzt+1) = ug(nzt+1), vg(nzt+1)  |'
1147    ELSE
1148       r_upper  = TRIM( r_upper  ) // ' uv(nzt+1) = uv(nzt)               |'
1149    ENDIF
1150
1151    IF ( ibc_pt_b == 0 )  THEN
1152       IF ( land_surface )  THEN
1153          r_lower = TRIM( r_lower ) // ' pt(0)     = from soil model'
1154       ELSE
1155          r_lower = TRIM( r_lower ) // ' pt(0)     = pt_surface'
1156       ENDIF
1157    ELSEIF ( ibc_pt_b == 1 )  THEN
1158       r_lower = TRIM( r_lower ) // ' pt(0)     = pt(1)'
1159    ELSEIF ( ibc_pt_b == 2 )  THEN
1160       r_lower = TRIM( r_lower ) // ' pt(0)     = from coupled model'
1161    ENDIF
1162    IF ( ibc_pt_t == 0 )  THEN
1163       r_upper  = TRIM( r_upper  ) // ' pt(nzt+1) = pt_top'
1164    ELSEIF( ibc_pt_t == 1 )  THEN
1165       r_upper  = TRIM( r_upper  ) // ' pt(nzt+1) = pt(nzt)'
1166    ELSEIF( ibc_pt_t == 2 )  THEN
1167       r_upper  = TRIM( r_upper  ) // ' pt(nzt+1) = pt(nzt) + dpt/dz_ini'
1168
1169    ENDIF
1170
1171    WRITE ( io, 300 )  r_lower, r_upper
1172
1173    IF ( .NOT. constant_diffusion )  THEN
1174       IF ( ibc_e_b == 1 )  THEN
1175          r_lower = 'e(0)     = e(1)'
1176       ELSE
1177          r_lower = 'e(0)     = e(1) = (u*/0.1)**2'
1178       ENDIF
1179       r_upper = 'e(nzt+1) = e(nzt) = e(nzt-1)'
1180
1181       WRITE ( io, 301 )  'e', r_lower, r_upper       
1182
1183    ENDIF
1184
1185    IF ( ocean_mode )  THEN
1186       r_lower = 'sa(0)    = sa(1)'
1187       IF ( ibc_sa_t == 0 )  THEN
1188          r_upper =  'sa(nzt+1) = sa_surface'
1189       ELSE
1190          r_upper =  'sa(nzt+1) = sa(nzt)'
1191       ENDIF
1192       WRITE ( io, 301 ) 'sa', r_lower, r_upper
1193    ENDIF
1194
1195    IF ( humidity )  THEN
1196       IF ( ibc_q_b == 0 )  THEN
1197          IF ( land_surface )  THEN
1198             r_lower = 'q(0)     = from soil model'
1199          ELSE
1200             r_lower = 'q(0)     = q_surface'
1201          ENDIF
1202
1203       ELSE
1204          r_lower = 'q(0)      = q(1)'
1205       ENDIF
1206       IF ( ibc_q_t == 0 )  THEN
1207          r_upper =  'q(nzt+1) = q_top'
1208       ELSE
1209          r_upper =  'q(nzt+1) = q(nzt) + dq/dz'
1210       ENDIF
1211       WRITE ( io, 301 ) 'q', r_lower, r_upper
1212    ENDIF
1213
1214    IF ( passive_scalar )  THEN
1215       IF ( ibc_s_b == 0 )  THEN
1216          r_lower = 's(0)      = s_surface'
1217       ELSE
1218          r_lower = 's(0)      = s(1)'
1219       ENDIF
1220       IF ( ibc_s_t == 0 )  THEN
1221          r_upper =  's(nzt+1) = s_top'
1222       ELSEIF ( ibc_s_t == 1 )  THEN
1223          r_upper =  's(nzt+1) = s(nzt)'
1224       ELSEIF ( ibc_s_t == 2 )  THEN
1225          r_upper =  's(nzt+1) = s(nzt) + ds/dz'
1226       ENDIF
1227       WRITE ( io, 301 ) 's', r_lower, r_upper
1228    ENDIF
1229
1230    IF ( use_surface_fluxes )  THEN
1231       WRITE ( io, 303 )
1232       IF ( constant_heatflux )  THEN
1233          IF ( large_scale_forcing .AND. lsf_surf )  THEN
1234             IF ( surf_def_h(0)%ns >= 1 )  WRITE ( io, 306 )  surf_def_h(0)%shf(1)
1235          ELSE
1236             WRITE ( io, 306 )  surface_heatflux
1237          ENDIF
1238          IF ( random_heatflux )  WRITE ( io, 307 )
1239       ENDIF
1240       IF ( humidity  .AND.  constant_waterflux )  THEN
1241          IF ( large_scale_forcing .AND. lsf_surf )  THEN
1242             WRITE ( io, 311 ) surf_def_h(0)%qsws(1)
1243          ELSE
1244             WRITE ( io, 311 ) surface_waterflux
1245          ENDIF
1246       ENDIF
1247       IF ( passive_scalar  .AND.  constant_scalarflux )  THEN
1248          WRITE ( io, 313 ) surface_scalarflux
1249       ENDIF
1250    ENDIF
1251
1252    IF ( use_top_fluxes )  THEN
1253       WRITE ( io, 304 )
1254       IF ( coupling_mode == 'uncoupled' )  THEN
1255          WRITE ( io, 320 )  top_momentumflux_u, top_momentumflux_v
1256          IF ( constant_top_heatflux )  THEN
1257             WRITE ( io, 306 )  top_heatflux
1258          ENDIF
1259       ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
1260          WRITE ( io, 316 )
1261       ENDIF
1262       IF ( ocean_mode  .AND.  constant_top_salinityflux )                          &
1263          WRITE ( io, 309 )  top_salinityflux
1264       IF ( humidity       )  WRITE ( io, 315 )
1265       IF ( passive_scalar .AND.  constant_top_scalarflux )                    &
1266          WRITE ( io, 302 ) top_scalarflux
1267    ENDIF
1268
1269    IF ( constant_flux_layer )  THEN
1270       WRITE ( io, 305 )  (zu(1)-zu(0)), roughness_length,                     &
1271                          z0h_factor*roughness_length, kappa,                  &
1272                          zeta_min, zeta_max
1273       IF ( .NOT. constant_heatflux )  WRITE ( io, 308 )
1274       IF ( humidity  .AND.  .NOT. constant_waterflux )  THEN
1275          WRITE ( io, 312 )
1276       ENDIF
1277       IF ( passive_scalar  .AND.  .NOT. constant_scalarflux )  THEN
1278          WRITE ( io, 314 )
1279       ENDIF
1280    ELSE
1281       IF ( INDEX(initializing_actions, 'set_1d-model_profiles') /= 0 )  THEN
1282          WRITE ( io, 310 )  zeta_min, zeta_max
1283       ENDIF
1284    ENDIF
1285
1286    WRITE ( io, 317 )  bc_lr, bc_ns
1287    IF ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )  THEN
1288       WRITE ( io, 318 )  use_cmax, pt_damping_width, pt_damping_factor       
1289       IF ( turbulent_inflow )  THEN
1290          IF ( .NOT. recycling_yshift ) THEN
1291             WRITE ( io, 319 )  recycling_width, recycling_plane, &
1292                                inflow_damping_height, inflow_damping_width
1293          ELSE
1294             WRITE ( io, 322 )  recycling_width, recycling_plane, &
1295                                inflow_damping_height, inflow_damping_width
1296          END IF
1297       ENDIF
1298       IF ( turbulent_outflow )  THEN
1299          WRITE ( io, 323 )  outflow_source_plane, INT(outflow_source_plane/dx)
1300       ENDIF
1301    ENDIF
1302
1303!
1304!-- Initial Profiles
1305    WRITE ( io, 321 )
1306!
1307!-- Initial wind profiles
1308    IF ( u_profile(1) /= 9999999.9_wp )  WRITE ( io, 427 )
1309
1310!
1311!-- Initial temperature profile
1312!-- Building output strings, starting with surface temperature
1313    WRITE ( temperatures, '(F6.2)' )  pt_surface
1314    gradients = '------'
1315    slices = '     0'
1316    coordinates = '   0.0'
1317    i = 1
1318    DO  WHILE ( pt_vertical_gradient_level_ind(i) /= -9999 )
1319
1320       WRITE (coor_chr,'(F7.2)')  pt_init(pt_vertical_gradient_level_ind(i))
1321       temperatures = TRIM( temperatures ) // ' ' // TRIM( coor_chr )
1322
1323       WRITE (coor_chr,'(F7.2)')  pt_vertical_gradient(i)
1324       gradients = TRIM( gradients ) // ' ' // TRIM( coor_chr )
1325
1326       WRITE (coor_chr,'(I7)')  pt_vertical_gradient_level_ind(i)
1327       slices = TRIM( slices ) // ' ' // TRIM( coor_chr )
1328
1329       WRITE (coor_chr,'(F7.1)')  pt_vertical_gradient_level(i)
1330       coordinates = TRIM( coordinates ) // ' '  // TRIM( coor_chr )
1331
1332       IF ( i == 10 )  THEN
1333          EXIT
1334       ELSE
1335          i = i + 1
1336       ENDIF
1337
1338    ENDDO
1339
1340    IF ( .NOT. nudging )  THEN
1341       WRITE ( io, 420 )  TRIM( coordinates ), TRIM( temperatures ), &
1342                          TRIM( gradients ), TRIM( slices )
1343    ELSE
1344       WRITE ( io, 428 ) 
1345    ENDIF
1346
1347!
1348!-- Initial humidity profile
1349!-- Building output strings, starting with surface humidity
1350    IF ( humidity )  THEN
1351       WRITE ( temperatures, '(E8.1)' )  q_surface
1352       gradients = '--------'
1353       slices = '       0'
1354       coordinates = '     0.0'
1355       i = 1
1356       DO  WHILE ( q_vertical_gradient_level_ind(i) /= -9999 )
1357         
1358          WRITE (coor_chr,'(E8.1,4X)')  q_init(q_vertical_gradient_level_ind(i))
1359          temperatures = TRIM( temperatures ) // '  ' // TRIM( coor_chr )
1360
1361          WRITE (coor_chr,'(E8.1,4X)')  q_vertical_gradient(i)
1362          gradients = TRIM( gradients ) // '  ' // TRIM( coor_chr )
1363         
1364          WRITE (coor_chr,'(I8,4X)')  q_vertical_gradient_level_ind(i)
1365          slices = TRIM( slices ) // '  ' // TRIM( coor_chr )
1366         
1367          WRITE (coor_chr,'(F8.1,4X)')  q_vertical_gradient_level(i)
1368          coordinates = TRIM( coordinates ) // '  '  // TRIM( coor_chr )
1369
1370          IF ( i == 10 )  THEN
1371             EXIT
1372          ELSE
1373             i = i + 1
1374          ENDIF
1375
1376       ENDDO
1377
1378       IF ( .NOT. nudging )  THEN
1379          WRITE ( io, 421 )  TRIM( coordinates ), TRIM( temperatures ),        &
1380                             TRIM( gradients ), TRIM( slices )
1381       ENDIF
1382    ENDIF
1383!
1384!-- Initial scalar profile
1385!-- Building output strings, starting with surface humidity
1386    IF ( passive_scalar )  THEN
1387       WRITE ( temperatures, '(E8.1)' )  s_surface
1388       gradients = '--------'
1389       slices = '       0'
1390       coordinates = '     0.0'
1391       i = 1
1392       DO  WHILE ( s_vertical_gradient_level_ind(i) /= -9999 )
1393         
1394          WRITE (coor_chr,'(E8.1,4X)')  s_init(s_vertical_gradient_level_ind(i))
1395          temperatures = TRIM( temperatures ) // '  ' // TRIM( coor_chr )
1396
1397          WRITE (coor_chr,'(E8.1,4X)')  s_vertical_gradient(i)
1398          gradients = TRIM( gradients ) // '  ' // TRIM( coor_chr )
1399         
1400          WRITE (coor_chr,'(I8,4X)')  s_vertical_gradient_level_ind(i)
1401          slices = TRIM( slices ) // '  ' // TRIM( coor_chr )
1402         
1403          WRITE (coor_chr,'(F8.1,4X)')  s_vertical_gradient_level(i)
1404          coordinates = TRIM( coordinates ) // '  '  // TRIM( coor_chr )
1405
1406          IF ( i == 10 )  THEN
1407             EXIT
1408          ELSE
1409             i = i + 1
1410          ENDIF
1411
1412       ENDDO
1413
1414       WRITE ( io, 422 )  TRIM( coordinates ), TRIM( temperatures ),           &
1415                          TRIM( gradients ), TRIM( slices )
1416    ENDIF   
1417
1418!
1419!-- Initial salinity profile
1420!-- Building output strings, starting with surface salinity
1421    IF ( ocean_mode )  THEN
1422       WRITE ( temperatures, '(F6.2)' )  sa_surface
1423       gradients = '------'
1424       slices = '     0'
1425       coordinates = '   0.0'
1426       i = 1
1427       DO  WHILE ( sa_vertical_gradient_level_ind(i) /= -9999 )
1428
1429          WRITE (coor_chr,'(F7.2)')  sa_init(sa_vertical_gradient_level_ind(i))
1430          temperatures = TRIM( temperatures ) // ' ' // TRIM( coor_chr )
1431
1432          WRITE (coor_chr,'(F7.2)')  sa_vertical_gradient(i)
1433          gradients = TRIM( gradients ) // ' ' // TRIM( coor_chr )
1434
1435          WRITE (coor_chr,'(I7)')  sa_vertical_gradient_level_ind(i)
1436          slices = TRIM( slices ) // ' ' // TRIM( coor_chr )
1437
1438          WRITE (coor_chr,'(F7.1)')  sa_vertical_gradient_level(i)
1439          coordinates = TRIM( coordinates ) // ' '  // TRIM( coor_chr )
1440
1441          IF ( i == 10 )  THEN
1442             EXIT
1443          ELSE
1444             i = i + 1
1445          ENDIF
1446
1447       ENDDO
1448
1449       WRITE ( io, 425 )  TRIM( coordinates ), TRIM( temperatures ), &
1450                          TRIM( gradients ), TRIM( slices )
1451    ENDIF
1452
1453
1454!
1455!-- Listing of 1D-profiles
1456    WRITE ( io, 325 )  dt_dopr_listing
1457    IF ( averaging_interval_pr /= 0.0_wp )  THEN
1458       WRITE ( io, 326 )  averaging_interval_pr, dt_averaging_input_pr
1459    ENDIF
1460
1461!
1462!-- DATA output
1463    WRITE ( io, 330 )
1464    IF ( averaging_interval_pr /= 0.0_wp )  THEN
1465       WRITE ( io, 326 )  averaging_interval_pr, dt_averaging_input_pr
1466    ENDIF
1467
1468!
1469!-- 1D-profiles
1470    dopr_chr = 'Profile:'
1471    IF ( dopr_n /= 0 )  THEN
1472       WRITE ( io, 331 )
1473
1474       output_format = ''
1475       output_format = netcdf_data_format_string
1476       IF ( netcdf_deflate == 0 )  THEN
1477          WRITE ( io, 344 )  output_format
1478       ELSE
1479          WRITE ( io, 354 )  TRIM( output_format ), netcdf_deflate
1480       ENDIF
1481
1482       DO  i = 1, dopr_n
1483          dopr_chr = TRIM( dopr_chr ) // ' ' // TRIM( data_output_pr(i) ) // ','
1484          IF ( LEN_TRIM( dopr_chr ) >= 60 )  THEN
1485             WRITE ( io, 332 )  dopr_chr
1486             dopr_chr = '       :'
1487          ENDIF
1488       ENDDO
1489
1490       IF ( dopr_chr /= '' )  THEN
1491          WRITE ( io, 332 )  dopr_chr
1492       ENDIF
1493       WRITE ( io, 333 )  dt_dopr, averaging_interval_pr, dt_averaging_input_pr
1494       IF ( skip_time_dopr /= 0.0_wp )  WRITE ( io, 339 )  skip_time_dopr
1495    ENDIF
1496
1497!
1498!-- 2D-arrays
1499    DO  av = 0, 1
1500
1501       i = 1
1502       do2d_xy = ''
1503       do2d_xz = ''
1504       do2d_yz = ''
1505       DO  WHILE ( do2d(av,i) /= ' ' )
1506
1507          l = MAX( 2, LEN_TRIM( do2d(av,i) ) )
1508          do2d_mode = do2d(av,i)(l-1:l)
1509
1510          SELECT CASE ( do2d_mode )
1511             CASE ( 'xy' )
1512                ll = LEN_TRIM( do2d_xy )
1513                do2d_xy = do2d_xy(1:ll) // ' ' // do2d(av,i)(1:l-3) // ','
1514             CASE ( 'xz' )
1515                ll = LEN_TRIM( do2d_xz )
1516                do2d_xz = do2d_xz(1:ll) // ' ' // do2d(av,i)(1:l-3) // ','
1517             CASE ( 'yz' )
1518                ll = LEN_TRIM( do2d_yz )
1519                do2d_yz = do2d_yz(1:ll) // ' ' // do2d(av,i)(1:l-3) // ','
1520          END SELECT
1521
1522          i = i + 1
1523
1524       ENDDO
1525
1526       IF ( ( ( do2d_xy /= ''  .AND.  section(1,1) /= -9999 )  .OR.    &
1527              ( do2d_xz /= ''  .AND.  section(1,2) /= -9999 )  .OR.    &
1528              ( do2d_yz /= ''  .AND.  section(1,3) /= -9999 ) ) )  THEN
1529
1530          IF (  av == 0 )  THEN
1531             WRITE ( io, 334 )  ''
1532          ELSE
1533             WRITE ( io, 334 )  '(time-averaged)'
1534          ENDIF
1535
1536          IF ( do2d_at_begin )  THEN
1537             begin_chr = 'and at the start'
1538          ELSE
1539             begin_chr = ''
1540          ENDIF
1541
1542          output_format = ''
1543          output_format = netcdf_data_format_string
1544          IF ( netcdf_deflate == 0 )  THEN
1545             WRITE ( io, 344 )  output_format
1546          ELSE
1547             WRITE ( io, 354 )  TRIM( output_format ), netcdf_deflate
1548          ENDIF
1549
1550          IF ( do2d_xy /= ''  .AND.  section(1,1) /= -9999 )  THEN
1551             i = 1
1552             slices = '/'
1553             coordinates = '/'
1554!
1555!--          Building strings with index and coordinate information of the
1556!--          slices
1557             DO  WHILE ( section(i,1) /= -9999 )
1558
1559                WRITE (section_chr,'(I5)')  section(i,1)
1560                section_chr = ADJUSTL( section_chr )
1561                slices = TRIM( slices ) // TRIM( section_chr ) // '/'
1562
1563                IF ( section(i,1) == -1 )  THEN
1564                   WRITE (coor_chr,'(F10.1)')  -1.0_wp
1565                ELSE
1566                   WRITE (coor_chr,'(F10.1)')  zu(section(i,1))
1567                ENDIF
1568                coor_chr = ADJUSTL( coor_chr )
1569                coordinates = TRIM( coordinates ) // TRIM( coor_chr ) // '/'
1570
1571                i = i + 1
1572             ENDDO
1573             IF ( av == 0 )  THEN
1574                WRITE ( io, 335 )  'XY', do2d_xy, dt_do2d_xy, &
1575                                   TRIM( begin_chr ), 'k', TRIM( slices ), &
1576                                   TRIM( coordinates )
1577                IF ( skip_time_do2d_xy /= 0.0_wp )  THEN
1578                   WRITE ( io, 339 )  skip_time_do2d_xy
1579                ENDIF
1580             ELSE
1581                WRITE ( io, 342 )  'XY', do2d_xy, dt_data_output_av, &
1582                                   TRIM( begin_chr ), averaging_interval, &
1583                                   dt_averaging_input, 'k', TRIM( slices ), &
1584                                   TRIM( coordinates )
1585                IF ( skip_time_data_output_av /= 0.0_wp )  THEN
1586                   WRITE ( io, 339 )  skip_time_data_output_av
1587                ENDIF
1588             ENDIF
1589             IF ( netcdf_data_format > 4 )  THEN
1590                WRITE ( io, 352 )  ntdim_2d_xy(av)
1591             ELSE
1592                WRITE ( io, 353 )
1593             ENDIF
1594          ENDIF
1595
1596          IF ( do2d_xz /= ''  .AND.  section(1,2) /= -9999 )  THEN
1597             i = 1
1598             slices = '/'
1599             coordinates = '/'
1600!
1601!--          Building strings with index and coordinate information of the
1602!--          slices
1603             DO  WHILE ( section(i,2) /= -9999 )
1604
1605                WRITE (section_chr,'(I5)')  section(i,2)
1606                section_chr = ADJUSTL( section_chr )
1607                slices = TRIM( slices ) // TRIM( section_chr ) // '/'
1608
1609                WRITE (coor_chr,'(F10.1)')  section(i,2) * dy
1610                coor_chr = ADJUSTL( coor_chr )
1611                coordinates = TRIM( coordinates ) // TRIM( coor_chr ) // '/'
1612
1613                i = i + 1
1614             ENDDO
1615             IF ( av == 0 )  THEN
1616                WRITE ( io, 335 )  'XZ', do2d_xz, dt_do2d_xz, &
1617                                   TRIM( begin_chr ), 'j', TRIM( slices ), &
1618                                   TRIM( coordinates )
1619                IF ( skip_time_do2d_xz /= 0.0_wp )  THEN
1620                   WRITE ( io, 339 )  skip_time_do2d_xz
1621                ENDIF
1622             ELSE
1623                WRITE ( io, 342 )  'XZ', do2d_xz, dt_data_output_av, &
1624                                   TRIM( begin_chr ), averaging_interval, &
1625                                   dt_averaging_input, 'j', TRIM( slices ), &
1626                                   TRIM( coordinates )
1627                IF ( skip_time_data_output_av /= 0.0_wp )  THEN
1628                   WRITE ( io, 339 )  skip_time_data_output_av
1629                ENDIF
1630             ENDIF
1631             IF ( netcdf_data_format > 4 )  THEN
1632                WRITE ( io, 352 )  ntdim_2d_xz(av)
1633             ELSE
1634                WRITE ( io, 353 )
1635             ENDIF
1636          ENDIF
1637
1638          IF ( do2d_yz /= ''  .AND.  section(1,3) /= -9999 )  THEN
1639             i = 1
1640             slices = '/'
1641             coordinates = '/'
1642!
1643!--          Building strings with index and coordinate information of the
1644!--          slices
1645             DO  WHILE ( section(i,3) /= -9999 )
1646
1647                WRITE (section_chr,'(I5)')  section(i,3)
1648                section_chr = ADJUSTL( section_chr )
1649                slices = TRIM( slices ) // TRIM( section_chr ) // '/'
1650
1651                WRITE (coor_chr,'(F10.1)')  section(i,3) * dx
1652                coor_chr = ADJUSTL( coor_chr )
1653                coordinates = TRIM( coordinates ) // TRIM( coor_chr ) // '/'
1654
1655                i = i + 1
1656             ENDDO
1657             IF ( av == 0 )  THEN
1658                WRITE ( io, 335 )  'YZ', do2d_yz, dt_do2d_yz, &
1659                                   TRIM( begin_chr ), 'i', TRIM( slices ), &
1660                                   TRIM( coordinates )
1661                IF ( skip_time_do2d_yz /= 0.0_wp )  THEN
1662                   WRITE ( io, 339 )  skip_time_do2d_yz
1663                ENDIF
1664             ELSE
1665                WRITE ( io, 342 )  'YZ', do2d_yz, dt_data_output_av, &
1666                                   TRIM( begin_chr ), averaging_interval, &
1667                                   dt_averaging_input, 'i', TRIM( slices ), &
1668                                   TRIM( coordinates )
1669                IF ( skip_time_data_output_av /= 0.0_wp )  THEN
1670                   WRITE ( io, 339 )  skip_time_data_output_av
1671                ENDIF
1672             ENDIF
1673             IF ( netcdf_data_format > 4 )  THEN
1674                WRITE ( io, 352 )  ntdim_2d_yz(av)
1675             ELSE
1676                WRITE ( io, 353 )
1677             ENDIF
1678          ENDIF
1679
1680       ENDIF
1681
1682    ENDDO
1683
1684!
1685!-- 3d-arrays
1686    DO  av = 0, 1
1687
1688       i = 1
1689       do3d_chr = ''
1690       DO  WHILE ( do3d(av,i) /= ' ' )
1691
1692          do3d_chr = TRIM( do3d_chr ) // ' ' // TRIM( do3d(av,i) ) // ','
1693          i = i + 1
1694
1695       ENDDO
1696
1697       IF ( do3d_chr /= '' )  THEN
1698          IF ( av == 0 )  THEN
1699             WRITE ( io, 336 )  ''
1700          ELSE
1701             WRITE ( io, 336 )  '(time-averaged)'
1702          ENDIF
1703
1704          output_format = netcdf_data_format_string
1705          IF ( netcdf_deflate == 0 )  THEN
1706             WRITE ( io, 344 )  output_format
1707          ELSE
1708             WRITE ( io, 354 )  TRIM( output_format ), netcdf_deflate
1709          ENDIF
1710
1711          IF ( do3d_at_begin )  THEN
1712             begin_chr = 'and at the start'
1713          ELSE
1714             begin_chr = ''
1715          ENDIF
1716          IF ( av == 0 )  THEN
1717             WRITE ( io, 337 )  do3d_chr, dt_do3d, TRIM( begin_chr ), &
1718                                zu(nz_do3d), nz_do3d
1719          ELSE
1720             WRITE ( io, 343 )  do3d_chr, dt_data_output_av,           &
1721                                TRIM( begin_chr ), averaging_interval, &
1722                                dt_averaging_input, zu(nz_do3d), nz_do3d
1723          ENDIF
1724
1725          IF ( netcdf_data_format > 4 )  THEN
1726             WRITE ( io, 352 )  ntdim_3d(av)
1727          ELSE
1728             WRITE ( io, 353 )
1729          ENDIF
1730
1731          IF ( av == 0 )  THEN
1732             IF ( skip_time_do3d /= 0.0_wp )  THEN
1733                WRITE ( io, 339 )  skip_time_do3d
1734             ENDIF
1735          ELSE
1736             IF ( skip_time_data_output_av /= 0.0_wp )  THEN
1737                WRITE ( io, 339 )  skip_time_data_output_av
1738             ENDIF
1739          ENDIF
1740
1741       ENDIF
1742
1743    ENDDO
1744
1745!
1746!-- masked arrays
1747    IF ( masks > 0 )  WRITE ( io, 345 )  &
1748         mask_scale_x, mask_scale_y, mask_scale_z
1749    DO  mid = 1, masks
1750       DO  av = 0, 1
1751
1752          i = 1
1753          domask_chr = ''
1754          DO  WHILE ( domask(mid,av,i) /= ' ' )
1755             domask_chr = TRIM( domask_chr ) // ' ' //  &
1756                          TRIM( domask(mid,av,i) ) // ','
1757             i = i + 1
1758          ENDDO
1759
1760          IF ( domask_chr /= '' )  THEN
1761             IF ( av == 0 )  THEN
1762                WRITE ( io, 346 )  '', mid
1763             ELSE
1764                WRITE ( io, 346 )  ' (time-averaged)', mid
1765             ENDIF
1766
1767             output_format = netcdf_data_format_string
1768!--          Parallel output not implemented for mask data, hence
1769!--          output_format must be adjusted.
1770             IF ( netcdf_data_format == 5 ) output_format = 'netCDF4/HDF5'
1771             IF ( netcdf_data_format == 6 ) output_format = 'netCDF4/HDF5 classic'
1772             IF ( netcdf_deflate == 0 )  THEN
1773                WRITE ( io, 344 )  output_format
1774             ELSE
1775                WRITE ( io, 354 )  TRIM( output_format ), netcdf_deflate
1776             ENDIF
1777
1778             IF ( av == 0 )  THEN
1779                WRITE ( io, 347 )  domask_chr, dt_domask(mid)
1780             ELSE
1781                WRITE ( io, 348 )  domask_chr, dt_data_output_av, &
1782                                   averaging_interval, dt_averaging_input
1783             ENDIF
1784
1785             IF ( av == 0 )  THEN
1786                IF ( skip_time_domask(mid) /= 0.0_wp )  THEN
1787                   WRITE ( io, 339 )  skip_time_domask(mid)
1788                ENDIF
1789             ELSE
1790                IF ( skip_time_data_output_av /= 0.0_wp )  THEN
1791                   WRITE ( io, 339 )  skip_time_data_output_av
1792                ENDIF
1793             ENDIF
1794!
1795!--          output locations
1796             DO  dim = 1, 3
1797                IF ( mask(mid,dim,1) >= 0.0_wp )  THEN
1798                   count = 0
1799                   DO  WHILE ( mask(mid,dim,count+1) >= 0.0_wp )
1800                      count = count + 1
1801                   ENDDO
1802                   WRITE ( io, 349 )  dir(dim), dir(dim), mid, dir(dim), &
1803                                      mask(mid,dim,:count)
1804                ELSEIF ( mask_loop(mid,dim,1) < 0.0_wp .AND.  &
1805                         mask_loop(mid,dim,2) < 0.0_wp .AND.  &
1806                         mask_loop(mid,dim,3) == 0.0_wp )  THEN
1807                   WRITE ( io, 350 )  dir(dim), dir(dim)
1808                ELSEIF ( mask_loop(mid,dim,3) == 0.0_wp )  THEN
1809                   WRITE ( io, 351 )  dir(dim), dir(dim), mid, dir(dim), &
1810                                      mask_loop(mid,dim,1:2)
1811                ELSE
1812                   WRITE ( io, 351 )  dir(dim), dir(dim), mid, dir(dim), &
1813                                      mask_loop(mid,dim,1:3)
1814                ENDIF
1815             ENDDO
1816          ENDIF
1817
1818       ENDDO
1819    ENDDO
1820
1821!
1822!-- Timeseries
1823    IF ( dt_dots /= 9999999.9_wp )  THEN
1824       WRITE ( io, 340 )
1825
1826       output_format = netcdf_data_format_string
1827       IF ( netcdf_deflate == 0 )  THEN
1828          WRITE ( io, 344 )  output_format
1829       ELSE
1830          WRITE ( io, 354 )  TRIM( output_format ), netcdf_deflate
1831       ENDIF
1832       WRITE ( io, 341 )  dt_dots
1833    ENDIF
1834
1835#if defined( __dvrp_graphics )
1836!
1837!-- Dvrp-output
1838    IF ( dt_dvrp /= 9999999.9_wp )  THEN
1839       WRITE ( io, 360 )  dt_dvrp, TRIM( dvrp_output ), TRIM( dvrp_host ), &
1840                          TRIM( dvrp_username ), TRIM( dvrp_directory )
1841       i = 1
1842       l = 0
1843       m = 0
1844       DO WHILE ( mode_dvrp(i) /= ' ' )
1845          IF ( mode_dvrp(i)(1:10) == 'isosurface' )  THEN
1846             READ ( mode_dvrp(i), '(10X,I2)' )  j
1847             l = l + 1
1848             IF ( do3d(0,j) /= ' ' )  THEN
1849                WRITE ( io, 361 )  TRIM( do3d(0,j) ), threshold(l), &
1850                                   isosurface_color(:,l)
1851             ENDIF
1852          ELSEIF ( mode_dvrp(i)(1:6) == 'slicer' )  THEN
1853             READ ( mode_dvrp(i), '(6X,I2)' )  j
1854             m = m + 1
1855             IF ( do2d(0,j) /= ' ' )  THEN
1856                WRITE ( io, 362 )  TRIM( do2d(0,j) ), &
1857                                   slicer_range_limits_dvrp(:,m)
1858             ENDIF
1859          ENDIF
1860          i = i + 1
1861       ENDDO
1862
1863       WRITE ( io, 365 )  groundplate_color, superelevation_x, &
1864                          superelevation_y, superelevation, clip_dvrp_l, &
1865                          clip_dvrp_r, clip_dvrp_s, clip_dvrp_n
1866
1867       IF ( TRIM( topography ) /= 'flat' )  THEN
1868          WRITE ( io, 366 )  topography_color
1869          IF ( cluster_size > 1 )  THEN
1870             WRITE ( io, 367 )  cluster_size
1871          ENDIF
1872       ENDIF
1873
1874    ENDIF
1875#endif
1876!
1877!-- Output of virtual flight information
1878    IF ( virtual_flight )  CALL flight_header( io )
1879
1880!
1881!-- Output of spectra related quantities
1882    IF ( calculate_spectra )  CALL spectra_header( io )
1883
1884    WRITE ( io, 99 )
1885
1886!
1887!-- Physical quantities
1888    WRITE ( io, 400 )
1889
1890!
1891!-- Geostrophic parameters
1892    WRITE ( io, 410 )  latitude, longitude, omega, f, fs
1893
1894!
1895!-- Day of year, UTC
1896    WRITE ( io, 456 )  day_of_year_init, time_utc_init
1897   
1898!
1899!-- Other quantities
1900    WRITE ( io, 411 )  g
1901
1902    WRITE ( io, 412 )  TRIM( reference_state )
1903    IF ( use_single_reference_value )  THEN
1904       IF ( ocean_mode )  THEN
1905          WRITE ( io, 413 )  prho_reference
1906       ELSE
1907          WRITE ( io, 414 )  pt_reference
1908       ENDIF
1909    ENDIF
1910
1911!
1912!-- Output of microphysics information
1913    IF ( bulk_cloud_model )  CALL bcm_header( io )
1914
1915!
1916!-- Cloud physcis parameters / quantities / numerical methods
1917    WRITE ( io, 430 )
1918    IF ( humidity .AND. .NOT. bulk_cloud_model .AND. .NOT. cloud_droplets)  THEN
1919       WRITE ( io, 431 )
1920    ENDIF
1921    IF ( cloud_top_radiation )  WRITE ( io, 132 )
1922    IF ( humidity  .AND.  cloud_droplets )  THEN
1923       WRITE ( io, 433 )
1924       IF ( curvature_solution_effects )  WRITE ( io, 434 )
1925       IF ( collision_kernel /= 'none' )  THEN
1926          WRITE ( io, 435 )  TRIM( collision_kernel )
1927          IF ( collision_kernel(6:9) == 'fast' )  THEN
1928             WRITE ( io, 436 )  radius_classes, dissipation_classes
1929          ENDIF
1930       ELSE
1931          WRITE ( io, 437 )
1932       ENDIF
1933    ENDIF
1934
1935!
1936!-- LES / turbulence parameters
1937    WRITE ( io, 450 )
1938
1939!--
1940! ... LES-constants used must still be added here
1941!--
1942    IF ( constant_diffusion )  THEN
1943       WRITE ( io, 451 )  km_constant, km_constant/prandtl_number, &
1944                          prandtl_number
1945    ENDIF
1946    IF ( .NOT. constant_diffusion)  THEN
1947       IF ( e_init > 0.0_wp )  WRITE ( io, 455 )  e_init
1948       IF ( e_min > 0.0_wp )  WRITE ( io, 454 )  e_min
1949       IF ( wall_adjustment )  WRITE ( io, 453 )  wall_adjustment_factor
1950    ENDIF
1951    IF ( rans_mode )  THEN
1952       WRITE ( io, 457 )  rans_const_c, rans_const_sigma
1953    ENDIF
1954!
1955!-- Special actions during the run
1956    WRITE ( io, 470 )
1957    IF ( create_disturbances )  THEN
1958       WRITE ( io, 471 )  dt_disturb, disturbance_amplitude,                   &
1959                          zu(disturbance_level_ind_b), disturbance_level_ind_b,&
1960                          zu(disturbance_level_ind_t), disturbance_level_ind_t
1961       IF ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )  THEN
1962          WRITE ( io, 472 )  inflow_disturbance_begin, inflow_disturbance_end
1963       ELSE
1964          WRITE ( io, 473 )  disturbance_energy_limit
1965       ENDIF
1966       WRITE ( io, 474 )  TRIM( random_generator )
1967    ENDIF
1968    IF ( pt_surface_initial_change /= 0.0_wp )  THEN
1969       WRITE ( io, 475 )  pt_surface_initial_change
1970    ENDIF
1971    IF ( humidity  .AND.  q_surface_initial_change /= 0.0_wp )  THEN
1972       WRITE ( io, 476 )  q_surface_initial_change       
1973    ENDIF
1974    IF ( passive_scalar  .AND.  q_surface_initial_change /= 0.0_wp )  THEN
1975       WRITE ( io, 477 )  q_surface_initial_change       
1976    ENDIF
1977
1978    IF ( particle_advection )  THEN
1979!
1980!--    Particle attributes
1981       WRITE ( io, 480 )  particle_advection_start, dt_prel, bc_par_lr, &
1982                          bc_par_ns, bc_par_b, bc_par_t, particle_maximum_age, &
1983                          end_time_prel
1984       IF ( use_sgs_for_particles )  WRITE ( io, 488 )  dt_min_part
1985       IF ( random_start_position )  WRITE ( io, 481 )
1986       IF ( seed_follows_topography )  WRITE ( io, 496 )
1987       IF ( particles_per_point > 1 )  WRITE ( io, 489 )  particles_per_point
1988       WRITE ( io, 495 )  total_number_of_particles
1989       IF ( dt_write_particle_data /= 9999999.9_wp )  THEN
1990          WRITE ( io, 485 )  dt_write_particle_data
1991          IF ( netcdf_data_format > 1 )  THEN
1992             output_format = 'netcdf (64 bit offset) and binary'
1993          ELSE
1994             output_format = 'netcdf and binary'
1995          ENDIF
1996          IF ( netcdf_deflate == 0 )  THEN
1997             WRITE ( io, 344 )  output_format
1998          ELSE
1999             WRITE ( io, 354 )  TRIM( output_format ), netcdf_deflate
2000          ENDIF
2001       ENDIF
2002       IF ( dt_dopts /= 9999999.9_wp )  WRITE ( io, 494 )  dt_dopts
2003       IF ( write_particle_statistics )  WRITE ( io, 486 )
2004
2005       WRITE ( io, 487 )  number_of_particle_groups
2006
2007       DO  i = 1, number_of_particle_groups
2008          IF ( i == 1  .AND.  density_ratio(i) == 9999999.9_wp )  THEN
2009             WRITE ( io, 490 )  i, 0.0_wp
2010             WRITE ( io, 492 )
2011          ELSE
2012             WRITE ( io, 490 )  i, radius(i)
2013             IF ( density_ratio(i) /= 0.0_wp )  THEN
2014                WRITE ( io, 491 )  density_ratio(i)
2015             ELSE
2016                WRITE ( io, 492 )
2017             ENDIF
2018          ENDIF
2019          WRITE ( io, 493 )  psl(i), psr(i), pss(i), psn(i), psb(i), pst(i), &
2020                             pdx(i), pdy(i), pdz(i)
2021          IF ( .NOT. vertical_particle_advection(i) )  WRITE ( io, 482 )
2022       ENDDO
2023
2024    ENDIF
2025
2026
2027!
2028!-- Parameters of 1D-model
2029    IF ( INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 )  THEN
2030       WRITE ( io, 500 )  end_time_1d, dt_run_control_1d, dt_pr_1d, &
2031                          mixing_length_1d, dissipation_1d
2032       IF ( damp_level_ind_1d /= nzt+1 )  THEN
2033          WRITE ( io, 502 )  zu(damp_level_ind_1d), damp_level_ind_1d
2034       ENDIF
2035    ENDIF
2036
2037!
2038!-- User-defined information
2039    CALL user_header( io )
2040
2041    WRITE ( io, 99 )
2042
2043!
2044!-- Write buffer contents to disc immediately
2045    FLUSH( io )
2046
2047!
2048!-- Here the FORMATs start
2049
2050 99 FORMAT (1X,78('-'))
2051100 FORMAT (/1X,'******************************',4X,44('-')/        &
2052            1X,'* ',A,' *',4X,A/                               &
2053            1X,'******************************',4X,44('-'))
2054101 FORMAT (35X,'coupled run: ',A/ &
2055            35X,42('-'))
2056102 FORMAT (/' Date:                 ',A8,4X,'Run:       ',A34/      &
2057            ' Time:                 ',A8,4X,'Run-No.:   ',I2.2/     &
2058            ' Run on host:        ',A10)
2059#if defined( __parallel )
2060103 FORMAT (' Number of PEs:',10X,I6,4X,'Processor grid (x,y): (',I4,',',I4, &
2061              ')',1X,A)
2062104 FORMAT (' Number of PEs:',10X,I6,4X,'Tasks:',I4,'   threads per task:',I4/ &
2063              35X,'Processor grid (x,y): (',I4,',',I4,')',1X,A)
2064105 FORMAT (35X,'One additional PE is used to handle'/37X,'the dvrp output!')
2065107 FORMAT (35X,'A 1d-decomposition along ',A,' is used')
2066108 FORMAT (35X,'Max. # of parallel I/O streams is ',I5)
2067109 FORMAT (35X,'Precursor run for coupled atmos-ocean run'/ &
2068            35X,42('-'))
2069114 FORMAT (35X,'Coupled atmosphere-ocean run following'/ &
2070            35X,'independent precursor runs'/             &
2071            35X,42('-'))
2072#endif
2073110 FORMAT (/' Numerical Schemes:'/ &
2074             ' -----------------'/)
2075124 FORMAT (' --> Use the ',A,' turbulence closure (',A,' mode).')
2076121 FORMAT (' --> Use the ',A,' approximation for the model equations.')
2077111 FORMAT (' --> Solve perturbation pressure via FFT using ',A,' routines')
2078112 FORMAT (' --> Solve perturbation pressure via SOR-Red/Black-Schema'/ &
2079            '     Iterations (initial/other): ',I3,'/',I3,'  omega =',F6.3)
2080113 FORMAT (' --> Momentum advection via Piascek-Williams-Scheme (Form C3)', &
2081                  ' or Upstream')
2082115 FORMAT ('     FFT and transpositions are overlapping')
2083116 FORMAT (' --> Scalar advection via Piascek-Williams-Scheme (Form C3)', &
2084                  ' or Upstream')
2085118 FORMAT (' --> Scalar advection via Bott-Chlond-Scheme')
2086119 FORMAT (' --> Galilei-Transform applied to horizontal advection:'/ &
2087            '     translation velocity = ',A/ &
2088            '     distance advected ',A,':  ',F8.3,' km(x)  ',F8.3,' km(y)')
2089122 FORMAT (' --> Time differencing scheme: ',A)
2090123 FORMAT (' --> Rayleigh-Damping active, starts ',A,' z = ',F8.2,' m'/ &
2091            '     maximum damping coefficient:',F6.3, ' 1/s')
2092129 FORMAT (' --> Additional prognostic equation for the specific humidity')
2093130 FORMAT (' --> Additional prognostic equation for the total water content')
2094131 FORMAT (' --> No pt-equation solved. Neutral stratification with pt = ', &
2095                  F6.2, ' K assumed')
2096132 FORMAT ('     Parameterization of long-wave radiation processes via'/ &
2097            '     effective emissivity scheme')
2098134 FORMAT (' --> Additional prognostic equation for a passive scalar')
2099135 FORMAT (' --> Solve perturbation pressure via ',A,' method (', &
2100                  A,'-cycle)'/ &
2101            '     number of grid levels:                   ',I2/ &
2102            '     Gauss-Seidel red/black iterations:       ',I2)
2103136 FORMAT ('     gridpoints of coarsest subdomain (x,y,z): (',I3,',',I3,',', &
2104                  I3,')')
2105137 FORMAT ('     level data gathered on PE0 at level:     ',I2/ &
2106            '     gridpoints of coarsest subdomain (x,y,z): (',I3,',',I3,',', &
2107                  I3,')'/ &
2108            '     gridpoints of coarsest domain (x,y,z):    (',I3,',',I3,',', &
2109                  I3,')')
2110139 FORMAT (' --> Loop optimization method: ',A)
2111140 FORMAT ('     maximum residual allowed:                ',E10.3)
2112141 FORMAT ('     fixed number of multigrid cycles:        ',I4)
2113142 FORMAT ('     perturbation pressure is calculated at every Runge-Kutta ', &
2114                  'step')
2115143 FORMAT ('     Euler/upstream scheme is used for the SGS turbulent ', &
2116                  'kinetic energy')
2117144 FORMAT ('     masking method is used')
2118150 FORMAT (' --> Volume flow at the right and north boundary will be ', &
2119                  'conserved'/ &
2120            '     using the ',A,' mode')
2121151 FORMAT ('     with u_bulk = ',F7.3,' m/s and v_bulk = ',F7.3,' m/s')
2122152 FORMAT (' --> External pressure gradient directly prescribed by the user:',&
2123           /'     ',2(1X,E12.5),'Pa/m in x/y direction', &
2124           /'     starting from dp_level_b =', F8.3, 'm', A /)
2125200 FORMAT (//' Run time and time step information:'/ &
2126             ' ----------------------------------'/)
2127201 FORMAT ( ' Timestep:             variable     maximum value: ',F6.3,' s', &
2128             '    CFL-factor:',F5.2)
2129202 FORMAT ( ' Timestep:          dt = ',F6.3,' s'/)
2130203 FORMAT ( ' Start time:          ',F9.3,' s'/ &
2131             ' End time:            ',F9.3,' s')
2132204 FORMAT ( A,F9.3,' s')
2133205 FORMAT ( A,F9.3,' s',5X,'restart every',17X,F9.3,' s')
2134206 FORMAT (/' Time reached:        ',F9.3,' s'/ &
2135             ' CPU-time used:       ',F9.3,' s     per timestep:               ', &
2136               '  ',F9.3,' s'/                                                    &
2137             '                                      per second of simulated tim', &
2138               'e: ',F9.3,' s')
2139207 FORMAT ( ' Coupling start time: ',F9.3,' s')
2140250 FORMAT (//' Computational grid and domain size:'/ &
2141              ' ----------------------------------'// &
2142              ' Grid length:      dx =    ',F8.3,' m    dy =    ',F8.3, ' m')
2143251 FORMAT (  /' Domain size:       x = ',F10.3,' m     y = ',F10.3, &
2144              ' m  z(u) = ',F10.3,' m'/)
2145253 FORMAT ( '                dz(',I1,') =    ', F8.3, ' m')
2146254 FORMAT (//' Number of gridpoints (x,y,z):  (0:',I4,', 0:',I4,', 0:',I4,')'/ &
2147            ' Subdomain size (x,y,z):        (  ',I4,',   ',I4,',   ',I4,')'/)
2148260 FORMAT (/' The model has a slope in x-direction. Inclination angle: ',F6.2,&
2149             ' degrees')
2150270 FORMAT (//' Topography information:'/ &
2151              ' ----------------------'// &
2152              1X,'Topography: ',A)
2153271 FORMAT (  ' Building size (x/y/z) in m: ',F5.1,' / ',F5.1,' / ',F5.1/ &
2154              ' Horizontal index bounds (l/r/s/n): ',I4,' / ',I4,' / ',I4, &
2155                ' / ',I4)
2156272 FORMAT (  ' Single quasi-2D street canyon of infinite length in ',A, &
2157              ' direction' / &
2158              ' Canyon height: ', F6.2, 'm, ch = ', I4, '.'      / &
2159              ' Canyon position (',A,'-walls): cxl = ', I4,', cxr = ', I4, '.')
2160273 FORMAT (  ' Tunnel of infinite length in ',A, &
2161              ' direction' / &
2162              ' Tunnel height: ', F6.2, / &
2163              ' Tunnel-wall depth: ', F6.2      / &
2164              ' Tunnel width: ', F6.2 )
2165274 FORMAT (  ' Tunnel in ', A, ' direction.' / &
2166              ' Tunnel height: ', F6.2, / &   
2167              ' Tunnel-wall depth: ', F6.2      / &
2168              ' Tunnel width: ', F6.2, / &
2169              ' Tunnel length: ', F6.2 )
2170278 FORMAT (' Topography grid definition convention:'/ &
2171            ' cell edge (staggered grid points'/  &
2172            ' (u in x-direction, v in y-direction))' /)
2173279 FORMAT (' Topography grid definition convention:'/ &
2174            ' cell center (scalar grid points)' /)
2175280 FORMAT (' Complex terrain simulation is activated.')
2176281 FORMAT ('    --> Mean inflow profiles are adjusted.' / &
2177            '    --> Elevation of inflow boundary: ', F7.1, ' m' )
2178282 FORMAT ('    --> Initial data from 3D-precursor run is shifted' / &
2179            '        vertically depending on local surface height.')
2180300 FORMAT (//' Boundary conditions:'/ &
2181             ' -------------------'// &
2182             '                     p                    uv             ', &
2183             '                     pt'// &
2184             ' B. bound.: ',A/ &
2185             ' T. bound.: ',A)
2186301 FORMAT (/'                     ',A// &
2187             ' B. bound.: ',A/ &
2188             ' T. bound.: ',A)
2189303 FORMAT (/' Bottom surface fluxes are used in diffusion terms at k=1')
2190304 FORMAT (/' Top surface fluxes are used in diffusion terms at k=nzt')
2191305 FORMAT (//'    Constant flux layer between bottom surface and first ',     &
2192              'computational u,v-level:'// &
2193             '       z_mo = ',F6.2,' m   z0 =',F7.4,' m   z0h =',F8.5,&
2194             ' m   kappa =',F5.2/ &
2195             '       Rif value range:   ',F8.2,' <= rif <=',F6.2)
2196306 FORMAT ('       Predefined constant heatflux:   ',F9.6,' K m/s')
2197307 FORMAT ('       Heatflux has a random normal distribution')
2198308 FORMAT ('       Predefined surface temperature')
2199309 FORMAT ('       Predefined constant salinityflux:   ',F9.6,' psu m/s')
2200310 FORMAT (//'    1D-Model:'// &
2201             '       Rif value range:   ',F6.2,' <= rif <=',F6.2)
2202311 FORMAT ('       Predefined constant humidity flux: ',E10.3,' kg/kg m/s')
2203312 FORMAT ('       Predefined surface humidity')
2204313 FORMAT ('       Predefined constant scalar flux: ',E10.3,' kg/(m**2 s)')
2205314 FORMAT ('       Predefined scalar value at the surface')
2206302 FORMAT ('       Predefined constant scalarflux:   ',F9.6,' kg/(m**2 s)')
2207315 FORMAT ('       Humidity flux at top surface is 0.0')
2208316 FORMAT ('       Sensible heatflux and momentum flux from coupled ', &
2209                    'atmosphere model')
2210317 FORMAT (//' Lateral boundaries:'/ &
2211            '       left/right:  ',A/    &
2212            '       north/south: ',A)
2213318 FORMAT (/'       use_cmax: ',L1 / &
2214            '       pt damping layer width = ',F8.2,' m, pt ', &
2215                    'damping factor =',F7.4)
2216319 FORMAT ('       turbulence recycling at inflow switched on'/ &
2217            '       width of recycling domain: ',F7.1,' m   grid index: ',I4/ &
2218            '       inflow damping height: ',F6.1,' m   width: ',F6.1,' m')
2219320 FORMAT ('       Predefined constant momentumflux:  u: ',F9.6,' m**2/s**2'/ &
2220            '                                          v: ',F9.6,' m**2/s**2')
2221321 FORMAT (//' Initial profiles:'/ &
2222              ' ----------------')
2223322 FORMAT ('       turbulence recycling at inflow switched on'/ &
2224            '       y shift of the recycled inflow turbulence switched on'/ &
2225            '       width of recycling domain: ',F7.1,' m   grid index: ',I4/ &
2226            '       inflow damping height: ',F6.1,' m   width: ',F6.1,' m'/)
2227323 FORMAT ('       turbulent outflow conditon switched on'/ &
2228            '       position of outflow source plane: ',F7.1,' m   ', &
2229                    'grid index: ', I4)
2230325 FORMAT (//' List output:'/ &
2231             ' -----------'//  &
2232            '    1D-Profiles:'/    &
2233            '       Output every             ',F10.2,' s')
2234326 FORMAT ('       Time averaged over       ',F8.2,' s'/ &
2235            '       Averaging input every    ',F8.2,' s')
2236330 FORMAT (//' Data output:'/ &
2237             ' -----------'/)
2238331 FORMAT (/'    1D-Profiles:')
2239332 FORMAT (/'       ',A)
2240333 FORMAT ('       Output every             ',F8.2,' s',/ &
2241            '       Time averaged over       ',F8.2,' s'/ &
2242            '       Averaging input every    ',F8.2,' s')
2243334 FORMAT (/'    2D-Arrays',A,':')
2244335 FORMAT (/'       ',A2,'-cross-section  Arrays: ',A/ &
2245            '       Output every             ',F8.2,' s  ',A/ &
2246            '       Cross sections at ',A1,' = ',A/ &
2247            '       scalar-coordinates:   ',A,' m'/)
2248336 FORMAT (/'    3D-Arrays',A,':')
2249337 FORMAT (/'       Arrays: ',A/ &
2250            '       Output every             ',F8.2,' s  ',A/ &
2251            '       Upper output limit at    ',F8.2,' m  (GP ',I4,')'/)
2252339 FORMAT ('       No output during initial ',F8.2,' s')
2253340 FORMAT (/'    Time series:')
2254341 FORMAT ('       Output every             ',F8.2,' s'/)
2255342 FORMAT (/'       ',A2,'-cross-section  Arrays: ',A/ &
2256            '       Output every             ',F8.2,' s  ',A/ &
2257            '       Time averaged over       ',F8.2,' s'/ &
2258            '       Averaging input every    ',F8.2,' s'/ &
2259            '       Cross sections at ',A1,' = ',A/ &
2260            '       scalar-coordinates:   ',A,' m'/)
2261343 FORMAT (/'       Arrays: ',A/ &
2262            '       Output every             ',F8.2,' s  ',A/ &
2263            '       Time averaged over       ',F8.2,' s'/ &
2264            '       Averaging input every    ',F8.2,' s'/ &
2265            '       Upper output limit at    ',F8.2,' m  (GP ',I4,')'/)
2266344 FORMAT ('       Output format: ',A/)
2267345 FORMAT (/'    Scaling lengths for output locations of all subsequent mask IDs:',/ &
2268            '       mask_scale_x (in x-direction): ',F9.3, ' m',/ &
2269            '       mask_scale_y (in y-direction): ',F9.3, ' m',/ &
2270            '       mask_scale_z (in z-direction): ',F9.3, ' m' )
2271346 FORMAT (/'    Masked data output',A,' for mask ID ',I2, ':')
2272347 FORMAT ('       Variables: ',A/ &
2273            '       Output every             ',F8.2,' s')
2274348 FORMAT ('       Variables: ',A/ &
2275            '       Output every             ',F8.2,' s'/ &
2276            '       Time averaged over       ',F8.2,' s'/ &
2277            '       Averaging input every    ',F8.2,' s')
2278349 FORMAT (/'       Output locations in ',A,'-direction in multiples of ', &
2279            'mask_scale_',A,' predefined by array mask_',I2.2,'_',A,':'/ &
2280            13('       ',8(F8.2,',')/) )
2281350 FORMAT (/'       Output locations in ',A,'-direction: ', &
2282            'all gridpoints along ',A,'-direction (default).' )
2283351 FORMAT (/'       Output locations in ',A,'-direction in multiples of ', &
2284            'mask_scale_',A,' constructed from array mask_',I2.2,'_',A,'_loop:'/ &
2285            '          loop begin:',F8.2,', end:',F8.2,', stride:',F8.2 )
2286352 FORMAT  (/'       Number of output time levels allowed: ',I3 /)
2287353 FORMAT  (/'       Number of output time levels allowed: unlimited' /)
2288354 FORMAT ('       Output format: ',A, '   compressed with level: ',I1/)
2289#if defined( __dvrp_graphics )
2290360 FORMAT ('    Plot-Sequence with dvrp-software:'/ &
2291            '       Output every      ',F7.1,' s'/ &
2292            '       Output mode:      ',A/ &
2293            '       Host / User:      ',A,' / ',A/ &
2294            '       Directory:        ',A// &
2295            '       The sequence contains:')
2296361 FORMAT (/'       Isosurface of "',A,'"    Threshold value: ', E12.3/ &
2297            '          Isosurface color: (',F4.2,',',F4.2,',',F4.2,') (R,G,B)')
2298362 FORMAT (/'       Slicer plane ',A/ &
2299            '       Slicer limits: [',F6.2,',',F6.2,']')
2300365 FORMAT (/'       Groundplate color: (',F4.2,',',F4.2,',',F4.2,') (R,G,B)'/ &
2301            '       Superelevation along (x,y,z): (',F4.1,',',F4.1,',',F4.1, &
2302                     ')'/ &
2303            '       Clipping limits: from x = ',F9.1,' m to x = ',F9.1,' m'/ &
2304            '                        from y = ',F9.1,' m to y = ',F9.1,' m')
2305366 FORMAT (/'       Topography color: (',F4.2,',',F4.2,',',F4.2,') (R,G,B)')
2306367 FORMAT ('       Polygon reduction for topography: cluster_size = ', I1)
2307#endif
2308400 FORMAT (//' Physical quantities:'/ &
2309              ' -------------------'/)
2310410 FORMAT ('    Geograph. latitude  :   latitude  = ',F4.1,' degr'/   &
2311            '    Geograph. longitude :   longitude = ',F4.1,' degr'/   &
2312            '    Angular velocity    :   omega  =',E10.3,' rad/s'/  &
2313            '    Coriolis parameter  :   f      = ',F9.6,' 1/s'/    &
2314            '                            f*     = ',F9.6,' 1/s')
2315411 FORMAT (/'    Gravity             :   g      = ',F4.1,' m/s**2')
2316412 FORMAT (/'    Reference state used in buoyancy terms: ',A)
2317413 FORMAT ('       Reference density in buoyancy terms: ',F8.3,' kg/m**3')
2318414 FORMAT ('       Reference temperature in buoyancy terms: ',F8.4,' K')
2319420 FORMAT (/'    Characteristic levels of the initial temperature profile:'// &
2320            '       Height:        ',A,'  m'/ &
2321            '       Temperature:   ',A,'  K'/ &
2322            '       Gradient:      ',A,'  K/100m'/ &
2323            '       Gridpoint:     ',A)
2324421 FORMAT (/'    Characteristic levels of the initial humidity profile:'// &
2325            '       Height:      ',A,'  m'/ &
2326            '       Humidity:    ',A,'  kg/kg'/ &
2327            '       Gradient:    ',A,'  (kg/kg)/100m'/ &
2328            '       Gridpoint:   ',A)
2329422 FORMAT (/'    Characteristic levels of the initial scalar profile:'// &
2330            '       Height:                  ',A,'  m'/ &
2331            '       Scalar concentration:    ',A,'  kg/m**3'/ &
2332            '       Gradient:                ',A,'  (kg/m**3)/100m'/ &
2333            '       Gridpoint:               ',A)
2334423 FORMAT (/'    Characteristic levels of the geo. wind component ug:'// &
2335            '       Height:      ',A,'  m'/ &
2336            '       ug:          ',A,'  m/s'/ &
2337            '       Gradient:    ',A,'  1/100s'/ &
2338            '       Gridpoint:   ',A)
2339424 FORMAT (/'    Characteristic levels of the geo. wind component vg:'// &
2340            '       Height:      ',A,'  m'/ &
2341            '       vg:          ',A,'  m/s'/ &
2342            '       Gradient:    ',A,'  1/100s'/ &
2343            '       Gridpoint:   ',A)
2344425 FORMAT (/'    Characteristic levels of the initial salinity profile:'// &
2345            '       Height:     ',A,'  m'/ &
2346            '       Salinity:   ',A,'  psu'/ &
2347            '       Gradient:   ',A,'  psu/100m'/ &
2348            '       Gridpoint:  ',A)
2349426 FORMAT (/'    Characteristic levels of the subsidence/ascent profile:'// &
2350            '       Height:      ',A,'  m'/ &
2351            '       w_subs:      ',A,'  m/s'/ &
2352            '       Gradient:    ',A,'  (m/s)/100m'/ &
2353            '       Gridpoint:   ',A)
2354427 FORMAT (/'    Initial wind profiles (u,v) are interpolated from given'// &
2355                  ' profiles')
2356428 FORMAT (/'    Initial profiles (u, v, pt, q) are taken from file '/ &
2357             '    NUDGING_DATA')
2358430 FORMAT (//' Cloud physics quantities / methods:'/ &
2359              ' ----------------------------------'/)
2360431 FORMAT ('    Humidity is considered, bu no condensation')
2361433 FORMAT ('    Cloud droplets treated explicitly using the Lagrangian part', &
2362                 'icle model')
2363434 FORMAT ('    Curvature and solution effecs are considered for growth of', &
2364                 ' droplets < 1.0E-6 m')
2365435 FORMAT ('    Droplet collision is handled by ',A,'-kernel')
2366436 FORMAT ('       Fast kernel with fixed radius- and dissipation classes ', &
2367                    'are used'/ &
2368            '          number of radius classes:       ',I3,'    interval ', &
2369                       '[1.0E-6,2.0E-4] m'/ &
2370            '          number of dissipation classes:   ',I2,'    interval ', &
2371                       '[0,1000] cm**2/s**3')
2372437 FORMAT ('    Droplet collision is switched off')
2373450 FORMAT (//' LES / Turbulence quantities:'/ &
2374              ' ---------------------------'/)
2375451 FORMAT ('    Diffusion coefficients are constant:'/ &
2376            '    Km = ',F6.2,' m**2/s   Kh = ',F6.2,' m**2/s   Pr = ',F5.2)
2377453 FORMAT ('    Mixing length is limited to',F5.2,' * z')
2378454 FORMAT ('    TKE is not allowed to fall below ',E9.2,' (m/s)**2')
2379455 FORMAT ('    initial TKE is prescribed as ',E9.2,' (m/s)**2')
2380456 FORMAT (/'    Day of the year at model start :   day_init      =     ',I3 &
2381            /'    UTC time at model start        :   time_utc_init = ',F7.1,' s')
2382457 FORMAT ('    RANS-mode constants: c_0 = ',F9.5/         &
2383            '                         c_1 = ',F9.5/         &
2384            '                         c_2 = ',F9.5/         &
2385            '                         c_3 = ',F9.5/         &
2386            '                         c_4 = ',F9.5/         &
2387            '                         sigma_e    = ',F9.5/  &
2388            '                         sigma_diss = ',F9.5)
2389470 FORMAT (//' Actions during the simulation:'/ &
2390              ' -----------------------------'/)
2391471 FORMAT ('    Disturbance impulse (u,v) every :   ',F6.2,' s'/            &
2392            '    Disturbance amplitude           :    ',F5.2, ' m/s'/       &
2393            '    Lower disturbance level         : ',F8.2,' m (GP ',I4,')'/  &
2394            '    Upper disturbance level         : ',F8.2,' m (GP ',I4,')')
2395472 FORMAT ('    Disturbances continued during the run from i/j =',I4, &
2396                 ' to i/j =',I4)
2397473 FORMAT ('    Disturbances cease as soon as the disturbance energy exceeds',&
2398                 F6.3, ' m**2/s**2')
2399474 FORMAT ('    Random number generator used    : ',A/)
2400475 FORMAT ('    The surface temperature is increased (or decreased, ', &
2401                 'respectively, if'/ &
2402            '    the value is negative) by ',F5.2,' K at the beginning of the',&
2403                 ' 3D-simulation'/)
2404476 FORMAT ('    The surface humidity is increased (or decreased, ',&
2405                 'respectively, if the'/ &
2406            '    value is negative) by ',E8.1,' kg/kg at the beginning of', &
2407                 ' the 3D-simulation'/)
2408477 FORMAT ('    The scalar value is increased at the surface (or decreased, ',&
2409                 'respectively, if the'/ &
2410            '    value is negative) by ',E8.1,' kg/m**3 at the beginning of', &
2411                 ' the 3D-simulation'/)
2412480 FORMAT ('    Particles:'/ &
2413            '    ---------'// &
2414            '       Particle advection is active (switched on at t = ', F7.1, &
2415                    ' s)'/ &
2416            '       Start of new particle generations every  ',F6.1,' s'/ &
2417            '       Boundary conditions: left/right: ', A, ' north/south: ', A/&
2418            '                            bottom:     ', A, ' top:         ', A/&
2419            '       Maximum particle age:                 ',F9.1,' s'/ &
2420            '       Advection stopped at t = ',F9.1,' s'/)
2421481 FORMAT ('       Particles have random start positions'/)
2422482 FORMAT ('          Particles are advected only horizontally'/)
2423485 FORMAT ('       Particle data are written on file every ', F9.1, ' s')
2424486 FORMAT ('       Particle statistics are written on file'/)
2425487 FORMAT ('       Number of particle groups: ',I2/)
2426488 FORMAT ('       SGS velocity components are used for particle advection'/ &
2427            '          minimum timestep for advection:', F8.5/)
2428489 FORMAT ('       Number of particles simultaneously released at each ', &
2429                    'point: ', I5/)
2430490 FORMAT ('       Particle group ',I2,':'/ &
2431            '          Particle radius: ',E10.3, 'm')
2432491 FORMAT ('          Particle inertia is activated'/ &
2433            '             density_ratio (rho_fluid/rho_particle) =',F6.3/)
2434492 FORMAT ('          Particles are advected only passively (no inertia)'/)
2435493 FORMAT ('          Boundaries of particle source: x:',F8.1,' - ',F8.1,' m'/&
2436            '                                         y:',F8.1,' - ',F8.1,' m'/&
2437            '                                         z:',F8.1,' - ',F8.1,' m'/&
2438            '          Particle distances:  dx = ',F8.1,' m  dy = ',F8.1, &
2439                       ' m  dz = ',F8.1,' m'/)
2440494 FORMAT ('       Output of particle time series in NetCDF format every ', &
2441                    F8.2,' s'/)
2442495 FORMAT ('       Number of particles in total domain: ',I10/)
2443496 FORMAT ('       Initial vertical particle positions are interpreted ', &
2444                    'as relative to the given topography')
2445500 FORMAT (//' 1D-Model parameters:'/                           &
2446              ' -------------------'//                           &
2447            '    Simulation time:                   ',F8.1,' s'/ &
2448            '    Run-controll output every:         ',F8.1,' s'/ &
2449            '    Vertical profile output every:     ',F8.1,' s'/ &
2450            '    Mixing length calculation:         ',A/         &
2451            '    Dissipation calculation:           ',A/)
2452502 FORMAT ('    Damping layer starts from ',F7.1,' m (GP ',I4,')'/)
2453503 FORMAT (' --> Momentum advection via Wicker-Skamarock-Scheme 5th order')
2454504 FORMAT (' --> Scalar advection via Wicker-Skamarock-Scheme 5th order')
2455512 FORMAT (/' Date:                 ',A8,6X,'Run:       ',A34/      &
2456            ' Time:                 ',A8,6X,'Run-No.:   ',I2.2/     &
2457            ' Run on host:        ',A10,6X,'En-No.:    ',I2.2)
2458600 FORMAT (/' Nesting informations:'/ &
2459            ' --------------------'/ &
2460            ' Nesting mode:                     ',A/ &
2461            ' Nesting-datatransfer mode:        ',A// &
2462            ' Nest id  parent  number   lower left coordinates   name'/ &
2463            ' (*=me)     id    of PEs      x (m)     y (m)' )
2464601 FORMAT (2X,A1,1X,I2.2,6X,I2.2,5X,I5,5X,F8.2,2X,F8.2,5X,A)
2465
2466 END SUBROUTINE header
Note: See TracBrowser for help on using the repository browser.