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

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

Merge branch salsa with trunk

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