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

Last change on this file since 3516 was 3467, checked in by suehring, 5 years ago

Branch salsa @3446 re-integrated into trunk

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