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

Last change on this file since 3528 was 3525, checked in by kanani, 5 years ago

Changes related to clean-up of biometeorology (by dom_dwd_user)

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