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

Last change on this file since 3452 was 3448, checked in by kanani, 5 years ago

Implementation of human thermal indices (from branch biomet_p2 at r3444)

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