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

Last change on this file since 4300 was 4300, checked in by scharf, 4 years ago

Adjusted format for simulated time and related quantities

  • Property svn:keywords set to Id
File size: 76.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-2019 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: header.f90 4300 2019-11-22 10:39:29Z scharf $
27! Adjusted format for simulated time and related quantities
28!
29! 4297 2019-11-21 10:37:50Z oliver.maas
30! adjusted message to the changed parameter recycling_yshift
31!
32! 4227 2019-09-10 18:04:34Z gronemeier
33! implement new palm_date_time_mod
34!
35! 4223 2019-09-10 09:20:47Z gronemeier
36! Write information about rotation angle
37!
38! 4182 2019-08-22 15:20:23Z scharf
39! Corrected "Former revisions" section
40!
41! 4168 2019-08-16 13:50:17Z suehring
42! Replace function get_topography_top_index by topo_top_ind
43!
44! 4069 2019-07-01 14:05:51Z Giersch
45! Masked output running index mid has been introduced as a local variable to
46! avoid runtime error (Loop variable has been modified) in time_integration
47!
48! 4023 2019-06-12 13:20:01Z maronga
49! Renamed "coupling start time" to "spinup time"
50!
51! 4017 2019-06-06 12:16:46Z schwenkel
52! unused variable removed
53!
54! 3655 2019-01-07 16:51:22Z knoop
55! Implementation of the PALM module interface
56!
57! Revision 1.1  1997/08/11 06:17:20  raasch
58! Initial revision
59!
60!
61! Description:
62! ------------
63!> Writing a header with all important information about the current run.
64!> This subroutine is called three times, two times at the beginning
65!> (writing information on files RUN_CONTROL and HEADER) and one time at the
66!> end of the run, then writing additional information about CPU-usage on file
67!> header.
68!-----------------------------------------------------------------------------!
69 SUBROUTINE header
70 
71
72    USE arrays_3d,                                                             &
73        ONLY:  pt_init, q_init, s_init, sa_init, ug, vg, w_subs, zu, zw
74
75    USE basic_constants_and_equations_mod,                                     &
76        ONLY:  g, kappa
77
78    USE bulk_cloud_model_mod,                                                  &
79        ONLY:  bulk_cloud_model
80
81    USE control_parameters
82
83    USE cpulog,                                                                &
84        ONLY:  log_point_s
85
86    USE grid_variables,                                                        &
87        ONLY:  dx, dy
88
89    USE indices,                                                               &
90        ONLY:  mg_loc_ind, nnx, nny, nnz, nx, ny, nxl_mg, nxr_mg, nyn_mg,      &
91               nys_mg, nzt, nzt_mg, topo_top_ind
92
93    USE kinds
94
95    USE model_1d_mod,                                                          &
96        ONLY:  damp_level_ind_1d, dt_pr_1d, dt_run_control_1d, end_time_1d
97
98    USE module_interface,                                                      &
99        ONLY:  module_interface_header
100
101    USE netcdf_interface,                                                      &
102        ONLY:  netcdf_data_format, netcdf_data_format_string, netcdf_deflate
103
104    USE ocean_mod,                                                             &
105        ONLY:  ibc_sa_t, prho_reference, sa_surface,                           &
106               sa_vertical_gradient, sa_vertical_gradient_level,               &
107               sa_vertical_gradient_level_ind
108
109    USE palm_date_time_mod,                                                    &
110        ONLY:  get_date_time
111
112    USE pegrid
113
114#if defined( __parallel )
115    USE pmc_handle_communicator,                                               &
116        ONLY:  pmc_get_model_info
117#endif
118
119    USE pmc_interface,                                                         &
120        ONLY:  nested_run, nesting_datatransfer_mode, nesting_mode
121
122    USE surface_mod,                                                           &
123        ONLY:  surf_def_h
124
125    USE turbulence_closure_mod,                                                &
126        ONLY:  rans_const_c, rans_const_sigma
127
128    IMPLICIT NONE
129
130   
131    CHARACTER (LEN=2)  ::  do2d_mode           !< mode of 2D data output (xy, xz, yz)
132   
133    CHARACTER (LEN=5)  ::  section_chr         !< string indicating grid information where to output 2D slices
134   
135    CHARACTER (LEN=10) ::  coor_chr            !< string for subsidence velocities in large-scale forcing
136    CHARACTER (LEN=10) ::  host_chr            !< string for hostname
137   
138    CHARACTER (LEN=16) ::  begin_chr           !< string indication start time for the data output
139   
140    CHARACTER (LEN=26) ::  ver_rev             !< string for run identification
141
142    CHARACTER (LEN=32) ::  cpl_name            !< name of child domain (nesting mode only)
143   
144    CHARACTER (LEN=40) ::  output_format       !< netcdf format
145       
146    CHARACTER (LEN=70) ::  char1               !< dummy varialbe used for various strings
147    CHARACTER (LEN=70) ::  char2               !< string containing informating about the advected distance in case of Galilei transformation
148    CHARACTER (LEN=23) ::  date_time_str       !< string for date and time information
149    CHARACTER (LEN=70) ::  dopr_chr            !< string indicating profile output variables
150    CHARACTER (LEN=70) ::  do2d_xy             !< string indicating 2D-xy output variables
151    CHARACTER (LEN=70) ::  do2d_xz             !< string indicating 2D-xz output variables
152    CHARACTER (LEN=70) ::  do2d_yz             !< string indicating 2D-yz output variables
153    CHARACTER (LEN=70) ::  do3d_chr            !< string indicating 3D output variables
154    CHARACTER (LEN=70) ::  domask_chr          !< string indicating masked output variables
155    CHARACTER (LEN=70) ::  run_classification  !< string classifying type of run, e.g. nested, coupled, etc.
156   
157    CHARACTER (LEN=85) ::  r_upper             !< string indicating model top boundary condition for various quantities
158    CHARACTER (LEN=85) ::  r_lower             !< string indicating bottom boundary condition for various quantities
159   
160    CHARACTER (LEN=86) ::  coordinates         !< string indicating height coordinates for profile-prescribed variables
161    CHARACTER (LEN=86) ::  gradients           !< string indicating gradients of profile-prescribed variables between the prescribed height coordinates
162    CHARACTER (LEN=86) ::  slices              !< string indicating grid coordinates of profile-prescribed subsidence velocity
163    CHARACTER (LEN=86) ::  temperatures        !< string indicating profile-prescribed subsidence velocities
164    CHARACTER (LEN=86) ::  ugcomponent         !< string indicating profile-prescribed geostrophic u-component
165    CHARACTER (LEN=86) ::  vgcomponent         !< string indicating profile-prescribed geostrophic v-component
166
167    CHARACTER (LEN=1), DIMENSION(1:3) ::  dir = (/ 'x', 'y', 'z' /)  !< string indicating masking steps along certain direction
168
169    INTEGER(iwp) ::  av             !< index indicating average output quantities
170    INTEGER(iwp) ::  bh             !< building height in generic single-building setup
171    INTEGER(iwp) ::  blx            !< building width in grid points along x in generic single-building setup
172    INTEGER(iwp) ::  bly            !< building width in grid points along y in generic single-building setup
173    INTEGER(iwp) ::  bxl            !< index for left building wall in generic single-building setup
174    INTEGER(iwp) ::  bxr            !< index for right building wall in generic single-building setup
175    INTEGER(iwp) ::  byn            !< index for north building wall in generic single-building setup
176    INTEGER(iwp) ::  bys            !< index for south building wall in generic single-building setup
177    INTEGER(iwp) ::  ch             !< canyon depth in generic street-canyon setup
178    INTEGER(iwp) ::  count          !< number of masked output locations
179    INTEGER(iwp) ::  cpl_parent_id  !< parent ID for the respective child model
180    INTEGER(iwp) ::  cwx            !< canyon width along x in generic street-canyon setup
181    INTEGER(iwp) ::  cwy            !< canyon width along y in generic street-canyon setup
182    INTEGER(iwp) ::  cxl            !< index for left canyon wall in generic street-canyon setup
183    INTEGER(iwp) ::  cxr            !< index for right canyon wall in generic street-canyon setup
184    INTEGER(iwp) ::  cyn            !< index for north canyon wall in generic street-canyon setup
185    INTEGER(iwp) ::  cys            !< index for south canyon wall in generic street-canyon setup
186    INTEGER(iwp) ::  dim            !< running index for masking output locations
187    INTEGER(iwp) ::  i              !< running index for various loops
188    INTEGER(iwp) ::  io             !< file unit of HEADER file
189    INTEGER(iwp) ::  l              !< substring length
190    INTEGER(iwp) ::  ll             !< substring length
191    INTEGER(iwp) ::  mid            !< masked output running index
192    INTEGER(iwp) ::  my_cpl_id      !< run id in a nested model setup
193    INTEGER(iwp) ::  n              !< running index over number of couplers in a nested model setup
194    INTEGER(iwp) ::  ncpl           !< number of coupler in a nested model setup
195    INTEGER(iwp) ::  npe_total      !< number of total PEs in a coupler (parent + child)
196   
197
198    REAL(wp) ::  cpuseconds_per_simulated_second  !< CPU time (in s) per simulated second
199    REAL(wp) ::  lower_left_coord_x               !< x-coordinate of nest domain
200    REAL(wp) ::  lower_left_coord_y               !< y-coordinate of nest domain
201
202!
203!-- Open the output file. At the end of the simulation, output is directed
204!-- to unit 19.
205    IF ( ( runnr == 0 .OR. force_print_header )  .AND. &
206         .NOT. simulated_time_at_begin /= simulated_time )  THEN
207       io = 15   !  header output on file RUN_CONTROL
208    ELSE
209       io = 19   !  header output on file HEADER
210    ENDIF
211    CALL check_open( io )
212
213!
214!-- At the end of the run, output file (HEADER) will be rewritten with
215!-- new information
216    IF ( io == 19 .AND. simulated_time_at_begin /= simulated_time ) REWIND( 19 )
217
218!
219!-- Determine kind of model run
220    IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
221       run_classification = 'restart run'
222    ELSEIF ( TRIM( initializing_actions ) == 'cyclic_fill' )  THEN
223       run_classification = 'run with cyclic fill of 3D - prerun data'
224    ELSEIF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 )  THEN
225       run_classification = 'run without 1D - prerun'
226    ELSEIF ( INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 )  THEN
227       run_classification = 'run with 1D - prerun'
228    ELSEIF ( INDEX( initializing_actions, 'inifor' ) /= 0 )  THEN
229       run_classification = 'run initialized with COSMO data'
230    ELSEIF ( INDEX( initializing_actions, 'by_user' ) /=0 )  THEN
231       run_classification = 'run initialized by user'
232    ELSEIF ( INDEX( initializing_actions, 'initialize_vortex' ) /=0 )  THEN
233       run_classification = 'run additionally initialized by a Rankine-vortex'
234    ELSEIF ( INDEX( initializing_actions, 'initialize_ptanom' ) /=0 )  THEN
235       run_classification = 'run additionally initialized by temperature anomaly'
236    ELSE
237       message_string = ' unknown action(s): ' // TRIM( initializing_actions )
238       CALL message( 'header', 'PA0191', 0, 0, 0, 6, 0 )
239    ENDIF
240    IF ( nested_run )  run_classification = 'nested ' // run_classification(1:63)
241    IF ( ocean_mode )  THEN
242       run_classification = 'ocean - ' // run_classification(1:61)
243    ELSE
244       run_classification = 'atmosphere - ' // run_classification(1:57)
245    ENDIF
246
247!
248!-- Run-identification, date, time, host
249    host_chr = host(1:10)
250    ver_rev = TRIM( version ) // '  ' // TRIM( revision )
251    WRITE ( io, 100 )  ver_rev, TRIM( run_classification )
252    IF ( TRIM( coupling_mode ) /= 'uncoupled' )  THEN
253       WRITE ( io, 101 )  coupling_mode
254    ENDIF
255#if defined( __parallel )
256    IF ( coupling_start_time /= 0.0_wp  .AND. .NOT. spinup )  THEN
257       IF ( coupling_start_time > simulated_time_at_begin )  THEN
258          WRITE ( io, 109 )
259       ELSE
260          WRITE ( io, 114 )
261       ENDIF
262    ENDIF
263#endif
264    IF ( ensemble_member_nr /= 0 )  THEN
265       WRITE ( io, 512 )  run_date, run_identifier, run_time, runnr,           &
266                       ADJUSTR( host_chr ), ensemble_member_nr
267    ELSE
268       WRITE ( io, 102 )  run_date, run_identifier, run_time, runnr,           &
269                       ADJUSTR( host_chr )
270    ENDIF
271#if defined( __parallel )
272    IF ( npex == -1  .AND.  npey == -1 )  THEN
273       char1 = 'calculated'
274    ELSE
275       char1 = 'predefined'
276    ENDIF
277    IF ( threads_per_task == 1 )  THEN
278       WRITE ( io, 103 )  numprocs, pdims(1), pdims(2), TRIM( char1 )
279    ELSE
280       WRITE ( io, 104 )  numprocs*threads_per_task, numprocs, &
281                          threads_per_task, pdims(1), pdims(2), TRIM( char1 )
282    ENDIF
283
284    IF ( pdims(2) == 1 )  THEN
285       WRITE ( io, 107 )  'x'
286    ELSEIF ( pdims(1) == 1 )  THEN
287       WRITE ( io, 107 )  'y'
288    ENDIF
289    IF ( numprocs /= maximum_parallel_io_streams )  THEN
290       WRITE ( io, 108 )  maximum_parallel_io_streams
291    ENDIF
292#endif
293
294!
295!-- Nesting informations
296    IF ( nested_run )  THEN
297
298#if defined( __parallel )
299       WRITE ( io, 600 )  TRIM( nesting_mode ),                                &
300                          TRIM( nesting_datatransfer_mode )
301       CALL pmc_get_model_info( ncpl = ncpl, cpl_id = my_cpl_id )
302
303       DO  n = 1, ncpl
304          CALL pmc_get_model_info( request_for_cpl_id = n, cpl_name = cpl_name,&
305                                   cpl_parent_id = cpl_parent_id,              &
306                                   lower_left_x = lower_left_coord_x,          &
307                                   lower_left_y = lower_left_coord_y,          &
308                                   npe_total = npe_total )
309          IF ( n == my_cpl_id )  THEN
310             char1 = '*'
311          ELSE
312             char1 = ' '
313          ENDIF
314          WRITE ( io, 601 )  TRIM( char1 ), n, cpl_parent_id, npe_total,       &
315                             lower_left_coord_x, lower_left_coord_y,           &
316                             TRIM( cpl_name )
317       ENDDO
318#endif
319
320    ENDIF
321    WRITE ( io, 99 )
322
323!
324!-- Numerical schemes
325    WRITE ( io, 110 )
326    IF ( rans_mode )  THEN
327       WRITE ( io, 124 )  TRIM( turbulence_closure ), 'RANS'
328    ELSE
329       WRITE ( io, 124 )  TRIM( turbulence_closure ), 'LES'
330    ENDIF
331    WRITE ( io, 121 )  TRIM( approximation )
332    IF ( psolver(1:7) == 'poisfft' )  THEN
333       WRITE ( io, 111 )  TRIM( fft_method )
334       IF ( transpose_compute_overlap )  WRITE( io, 115 )
335    ELSEIF ( psolver == 'sor' )  THEN
336       WRITE ( io, 112 )  nsor_ini, nsor, omega_sor
337    ELSEIF ( psolver(1:9) == 'multigrid' )  THEN
338       WRITE ( io, 135 )  TRIM(psolver), cycle_mg, maximum_grid_level, ngsrb
339       IF ( mg_cycles == -1 )  THEN
340          WRITE ( io, 140 )  residual_limit
341       ELSE
342          WRITE ( io, 141 )  mg_cycles
343       ENDIF
344       IF ( mg_switch_to_pe0_level == 0 )  THEN
345          WRITE ( io, 136 )  nxr_mg(1)-nxl_mg(1)+1, nyn_mg(1)-nys_mg(1)+1, &
346                             nzt_mg(1)
347       ELSEIF (  mg_switch_to_pe0_level /= -1 )  THEN
348          WRITE ( io, 137 )  mg_switch_to_pe0_level,            &
349                             mg_loc_ind(2,0)-mg_loc_ind(1,0)+1, &
350                             mg_loc_ind(4,0)-mg_loc_ind(3,0)+1, &
351                             nzt_mg(mg_switch_to_pe0_level),    &
352                             nxr_mg(1)-nxl_mg(1)+1, nyn_mg(1)-nys_mg(1)+1, &
353                             nzt_mg(1)
354       ENDIF
355       IF ( psolver == 'multigrid_noopt' .AND. masking_method )  WRITE ( io, 144 )
356    ENDIF
357    IF ( call_psolver_at_all_substeps  .AND. timestep_scheme(1:5) == 'runge' ) &
358    THEN
359       WRITE ( io, 142 )
360    ENDIF
361
362    IF ( momentum_advec == 'pw-scheme' )  THEN
363       WRITE ( io, 113 )
364    ELSEIF (momentum_advec == 'ws-scheme' )  THEN
365       WRITE ( io, 503 )
366    ENDIF
367    IF ( scalar_advec == 'pw-scheme' )  THEN
368       WRITE ( io, 116 )
369    ELSEIF ( scalar_advec == 'ws-scheme' )  THEN
370       WRITE ( io, 504 )
371    ELSE
372       WRITE ( io, 118 )
373    ENDIF
374
375    WRITE ( io, 139 )  TRIM( loop_optimization )
376
377    IF ( galilei_transformation )  THEN
378       IF ( use_ug_for_galilei_tr )  THEN
379          char1 = '0.6 * geostrophic wind'
380       ELSE
381          char1 = 'mean wind in model domain'
382       ENDIF
383       IF ( simulated_time_at_begin == simulated_time )  THEN
384          char2 = 'at the start of the run'
385       ELSE
386          char2 = 'at the end of the run'
387       ENDIF
388       WRITE ( io, 119 )  TRIM( char1 ), TRIM( char2 ),                        &
389                          advected_distance_x/1000.0_wp,                       &
390                          advected_distance_y/1000.0_wp
391    ENDIF
392    WRITE ( io, 122 )  timestep_scheme
393    IF ( use_upstream_for_tke )  WRITE ( io, 143 )
394    IF ( rayleigh_damping_factor /= 0.0_wp )  THEN
395       IF ( .NOT. ocean_mode )  THEN
396          WRITE ( io, 123 )  'above', rayleigh_damping_height, &
397               rayleigh_damping_factor
398       ELSE
399          WRITE ( io, 123 )  'below', rayleigh_damping_height, &
400               rayleigh_damping_factor
401       ENDIF
402    ENDIF
403    IF ( neutral )  WRITE ( io, 131 )  pt_surface
404    IF ( humidity )  THEN
405       IF ( .NOT. bulk_cloud_model )  THEN
406          WRITE ( io, 129 )
407       ELSE
408          WRITE ( io, 130 )
409       ENDIF
410    ENDIF
411    IF ( passive_scalar )  WRITE ( io, 134 )
412    IF ( conserve_volume_flow )  THEN
413       WRITE ( io, 150 )  conserve_volume_flow_mode
414       IF ( TRIM( conserve_volume_flow_mode ) == 'bulk_velocity' )  THEN
415          WRITE ( io, 151 )  u_bulk, v_bulk
416       ENDIF
417    ELSEIF ( dp_external )  THEN
418       IF ( dp_smooth )  THEN
419          WRITE ( io, 152 )  dpdxy, dp_level_b, ', vertically smoothed.'
420       ELSE
421          WRITE ( io, 152 )  dpdxy, dp_level_b, '.'
422       ENDIF
423    ENDIF
424    WRITE ( io, 99 )
425
426!
427!-- Runtime and timestep information
428    WRITE ( io, 200 )
429    IF ( .NOT. dt_fixed )  THEN
430       WRITE ( io, 201 )  dt_max, cfl_factor
431    ELSE
432       WRITE ( io, 202 )  dt
433    ENDIF
434    WRITE ( io, 203 )  simulated_time_at_begin, end_time
435
436    IF ( time_restart /= 9999999.9_wp  .AND. &
437         simulated_time_at_begin == simulated_time )  THEN
438       IF ( dt_restart == 9999999.9_wp )  THEN
439          WRITE ( io, 204 )  ' Restart at:       ',time_restart
440       ELSE
441          WRITE ( io, 205 )  ' Restart at:       ',time_restart, dt_restart
442       ENDIF
443    ENDIF
444
445    IF ( simulated_time_at_begin /= simulated_time )  THEN
446       i = MAX ( log_point_s(10)%counts, 1 )
447       IF ( ( simulated_time - simulated_time_at_begin ) == 0.0_wp )  THEN
448          cpuseconds_per_simulated_second = 0.0_wp
449       ELSE
450          cpuseconds_per_simulated_second = log_point_s(10)%sum / &
451                                            ( simulated_time -    &
452                                              simulated_time_at_begin )
453       ENDIF
454       WRITE ( io, 206 )  simulated_time, log_point_s(10)%sum,      &
455                          log_point_s(10)%sum / REAL( i, KIND=wp ), &
456                          cpuseconds_per_simulated_second
457       IF ( time_restart /= 9999999.9_wp  .AND.  time_restart < end_time )  THEN
458          IF ( dt_restart == 9999999.9_wp )  THEN
459             WRITE ( io, 204 )  ' Next restart at:     ',time_restart
460          ELSE
461             WRITE ( io, 205 )  ' Next restart at:     ',time_restart, dt_restart
462          ENDIF
463       ENDIF
464    ENDIF
465
466
467!
468!-- Start time for coupled runs, if independent precursor runs for atmosphere
469!-- and ocean are used or have been used. In this case, coupling_start_time
470!-- defines the time when the coupling is switched on.
471    IF ( coupling_start_time /= 0.0_wp )  THEN
472       WRITE ( io, 207 )  coupling_start_time
473    ENDIF
474
475!
476!-- Computational grid
477    IF ( .NOT. ocean_mode )  THEN
478       WRITE ( io, 250 )  dx, dy
479       
480       DO i = 1, number_stretch_level_start+1
481          WRITE ( io, 253 )  i, dz(i)
482       ENDDO
483       
484       WRITE( io, 251 ) (nx+1)*dx, (ny+1)*dy, zu(nzt+1)
485       
486       IF ( ANY( dz_stretch_level_start_index < nzt+1 ) )  THEN
487          WRITE( io, '(A)', advance='no') ' Vertical stretching starts at height:'
488          DO i = 1, number_stretch_level_start
489             WRITE ( io, '(F10.1,A3)', advance='no' )  dz_stretch_level_start(i), ' m,'
490          ENDDO
491          WRITE( io, '(/,A)', advance='no') ' Vertical stretching starts at index: '
492          DO i = 1, number_stretch_level_start
493             WRITE ( io, '(I12,A1)', advance='no' )  dz_stretch_level_start_index(i), ','
494          ENDDO
495          WRITE( io, '(/,A)', advance='no') ' Vertical stretching ends at height:  '
496          DO i = 1, number_stretch_level_start
497             WRITE ( io, '(F10.1,A3)', advance='no' )  dz_stretch_level_end(i), ' m,'
498          ENDDO
499          WRITE( io, '(/,A)', advance='no') ' Vertical stretching ends at index:   '
500          DO i = 1, number_stretch_level_start
501             WRITE ( io, '(I12,A1)', advance='no' )  dz_stretch_level_end_index(i), ','
502          ENDDO
503          WRITE( io, '(/,A)', advance='no') ' Factor used for stretching:          '
504          DO i = 1, number_stretch_level_start
505             WRITE ( io, '(F12.3,A1)', advance='no' )  dz_stretch_factor_array(i), ','
506          ENDDO
507       ENDIF
508       
509    ELSE
510       WRITE ( io, 250 )  dx, dy
511       DO i = 1, number_stretch_level_start+1
512          WRITE ( io, 253 )  i, dz(i)
513       ENDDO
514       
515       WRITE ( io, 251 ) (nx+1)*dx, (ny+1)*dy, zu(0)
516       
517       IF ( ANY( dz_stretch_level_start_index > 0 ) )  THEN
518          WRITE( io, '(A)', advance='no') ' Vertical stretching starts at height:'
519          DO i = 1, number_stretch_level_start
520             WRITE ( io, '(F10.1,A3)', advance='no' )  dz_stretch_level_start(i), ' m,'
521          ENDDO
522          WRITE( io, '(/,A)', advance='no') ' Vertical stretching starts at index: '
523          DO i = 1, number_stretch_level_start
524             WRITE ( io, '(I12,A1)', advance='no' )  dz_stretch_level_start_index(i), ','
525          ENDDO
526          WRITE( io, '(/,A)', advance='no') ' Vertical stretching ends at height:  '
527          DO i = 1, number_stretch_level_start
528             WRITE ( io, '(F10.1,A3)', advance='no' )  dz_stretch_level_end(i), ' m,'
529          ENDDO
530          WRITE( io, '(/,A)', advance='no') ' Vertical stretching ends at index:   '
531          DO i = 1, number_stretch_level_start
532             WRITE ( io, '(I12,A1)', advance='no' )  dz_stretch_level_end_index(i), ','
533          ENDDO
534          WRITE( io, '(/,A)', advance='no') ' Factor used for stretching:          '
535          DO i = 1, number_stretch_level_start
536             WRITE ( io, '(F12.3,A1)', advance='no' )  dz_stretch_factor_array(i), ','
537          ENDDO
538       ENDIF
539    ENDIF
540    WRITE ( io, 254 )  nx, ny, nzt+1, MIN( nnx, nx+1 ), MIN( nny, ny+1 ),      &
541                       MIN( nnz+2, nzt+2 )
542    IF ( sloping_surface )  WRITE ( io, 260 )  alpha_surface
543
544!
545!-- Profile for the large scale vertial velocity
546!-- Building output strings, starting with surface value
547    IF ( large_scale_subsidence )  THEN
548       temperatures = '   0.0'
549       gradients = '------'
550       slices = '     0'
551       coordinates = '   0.0'
552       i = 1
553       DO  WHILE ( subs_vertical_gradient_level_i(i) /= -9999 )
554
555          WRITE (coor_chr,'(E10.2,7X)')  &
556                                w_subs(subs_vertical_gradient_level_i(i))
557          temperatures = TRIM( temperatures ) // ' ' // TRIM( coor_chr )
558
559          WRITE (coor_chr,'(E10.2,7X)')  subs_vertical_gradient(i)
560          gradients = TRIM( gradients ) // ' ' // TRIM( coor_chr )
561
562          WRITE (coor_chr,'(I10,7X)')  subs_vertical_gradient_level_i(i)
563          slices = TRIM( slices ) // ' ' // TRIM( coor_chr )
564
565          WRITE (coor_chr,'(F10.2,7X)')  subs_vertical_gradient_level(i)
566          coordinates = TRIM( coordinates ) // ' '  // TRIM( coor_chr )
567
568          IF ( i == 10 )  THEN
569             EXIT
570          ELSE
571             i = i + 1
572          ENDIF
573
574       ENDDO
575
576 
577       IF ( .NOT. large_scale_forcing )  THEN
578          WRITE ( io, 426 )  TRIM( coordinates ), TRIM( temperatures ), &
579                             TRIM( gradients ), TRIM( slices )
580       ENDIF
581
582
583    ENDIF
584
585!-- Profile of the geostrophic wind (component ug)
586!-- Building output strings
587    WRITE ( ugcomponent, '(F6.2)' )  ug_surface
588    gradients = '------'
589    slices = '     0'
590    coordinates = '   0.0'
591    i = 1
592    DO  WHILE ( ug_vertical_gradient_level_ind(i) /= -9999 )
593     
594       WRITE (coor_chr,'(F6.2,1X)')  ug(ug_vertical_gradient_level_ind(i))
595       ugcomponent = TRIM( ugcomponent ) // '  ' // TRIM( coor_chr )
596
597       WRITE (coor_chr,'(F6.2,1X)')  ug_vertical_gradient(i)
598       gradients = TRIM( gradients ) // '  ' // TRIM( coor_chr )
599
600       WRITE (coor_chr,'(I6,1X)')  ug_vertical_gradient_level_ind(i)
601       slices = TRIM( slices ) // '  ' // TRIM( coor_chr )
602
603       WRITE (coor_chr,'(F6.1,1X)')  ug_vertical_gradient_level(i)
604       coordinates = TRIM( coordinates ) // '  ' // TRIM( coor_chr )
605
606       IF ( i == 10 )  THEN
607          EXIT
608       ELSE
609          i = i + 1
610       ENDIF
611
612    ENDDO
613
614    IF ( .NOT. large_scale_forcing )  THEN
615       WRITE ( io, 423 )  TRIM( coordinates ), TRIM( ugcomponent ), &
616                          TRIM( gradients ), TRIM( slices )
617    ENDIF
618
619!-- Profile of the geostrophic wind (component vg)
620!-- Building output strings
621    WRITE ( vgcomponent, '(F6.2)' )  vg_surface
622    gradients = '------'
623    slices = '     0'
624    coordinates = '   0.0'
625    i = 1
626    DO  WHILE ( vg_vertical_gradient_level_ind(i) /= -9999 )
627
628       WRITE (coor_chr,'(F6.2,1X)')  vg(vg_vertical_gradient_level_ind(i))
629       vgcomponent = TRIM( vgcomponent ) // '  ' // TRIM( coor_chr )
630
631       WRITE (coor_chr,'(F6.2,1X)')  vg_vertical_gradient(i)
632       gradients = TRIM( gradients ) // '  ' // TRIM( coor_chr )
633
634       WRITE (coor_chr,'(I6,1X)')  vg_vertical_gradient_level_ind(i)
635       slices = TRIM( slices ) // '  ' // TRIM( coor_chr )
636
637       WRITE (coor_chr,'(F6.1,1X)')  vg_vertical_gradient_level(i)
638       coordinates = TRIM( coordinates ) // '  ' // TRIM( coor_chr )
639
640       IF ( i == 10 )  THEN
641          EXIT
642       ELSE
643          i = i + 1
644       ENDIF
645 
646    ENDDO
647
648    IF ( .NOT. large_scale_forcing )  THEN
649       WRITE ( io, 424 )  TRIM( coordinates ), TRIM( vgcomponent ), &
650                          TRIM( gradients ), TRIM( slices )
651    ENDIF
652
653!
654!-- Topography
655    WRITE ( io, 270 )  topography
656    SELECT CASE ( TRIM( topography ) )
657
658       CASE ( 'flat' )
659          ! no actions necessary
660
661       CASE ( 'single_building' )
662          blx = INT( building_length_x / dx )
663          bly = INT( building_length_y / dy )
664          bh  = MINLOC( ABS( zw - building_height ), 1 ) - 1
665          IF ( ABS( zw(bh  ) - building_height ) == &
666               ABS( zw(bh+1) - building_height )    )  bh = bh + 1
667
668          IF ( building_wall_left == 9999999.9_wp )  THEN
669             building_wall_left = ( nx + 1 - blx ) / 2 * dx
670          ENDIF
671          bxl = INT ( building_wall_left / dx + 0.5_wp )
672          bxr = bxl + blx
673
674          IF ( building_wall_south == 9999999.9_wp )  THEN
675             building_wall_south = ( ny + 1 - bly ) / 2 * dy
676          ENDIF
677          bys = INT ( building_wall_south / dy + 0.5_wp )
678          byn = bys + bly
679
680          WRITE ( io, 271 )  building_length_x, building_length_y, &
681                             building_height, bxl, bxr, bys, byn
682
683       CASE ( 'single_street_canyon' )
684          ch  = MINLOC( ABS( zw - canyon_height ), 1 ) - 1
685          IF ( ABS( zw(ch  ) - canyon_height ) == &
686               ABS( zw(ch+1) - canyon_height )    )  ch = ch + 1
687          IF ( canyon_width_x /= 9999999.9_wp )  THEN
688!
689!--          Street canyon in y direction
690             cwx = NINT( canyon_width_x / dx )
691             IF ( canyon_wall_left == 9999999.9_wp )  THEN
692                canyon_wall_left = ( nx + 1 - cwx ) / 2 * dx
693             ENDIF
694             cxl = NINT( canyon_wall_left / dx )
695             cxr = cxl + cwx
696             WRITE ( io, 272 )  'y', canyon_height, ch, 'u', cxl, cxr
697
698          ELSEIF ( canyon_width_y /= 9999999.9_wp )  THEN
699!
700!--          Street canyon in x direction
701             cwy = NINT( canyon_width_y / dy )
702             IF ( canyon_wall_south == 9999999.9_wp )  THEN
703                canyon_wall_south = ( ny + 1 - cwy ) / 2 * dy
704             ENDIF
705             cys = NINT( canyon_wall_south / dy )
706             cyn = cys + cwy
707             WRITE ( io, 272 )  'x', canyon_height, ch, 'v', cys, cyn
708          ENDIF
709
710       CASE ( 'tunnel' )
711          IF ( tunnel_width_x /= 9999999.9_wp )  THEN
712!
713!--          Tunnel axis in y direction
714             IF ( tunnel_length == 9999999.9_wp  .OR.                          &
715                  tunnel_length >= ( nx + 1 ) * dx )  THEN
716                WRITE ( io, 273 )  'y', tunnel_height, tunnel_wall_depth,      &
717                                        tunnel_width_x
718             ELSE
719                WRITE ( io, 274 )  'y', tunnel_height, tunnel_wall_depth,      &
720                                        tunnel_width_x, tunnel_length
721             ENDIF
722
723          ELSEIF ( tunnel_width_y /= 9999999.9_wp )  THEN
724!
725!--          Tunnel axis in x direction
726             IF ( tunnel_length == 9999999.9_wp  .OR.                          &
727                  tunnel_length >= ( ny + 1 ) * dy )  THEN
728                WRITE ( io, 273 )  'x', tunnel_height, tunnel_wall_depth,      &
729                                        tunnel_width_y
730             ELSE
731                WRITE ( io, 274 )  'x', tunnel_height, tunnel_wall_depth,      &
732                                        tunnel_width_y, tunnel_length
733             ENDIF
734          ENDIF
735
736    END SELECT
737
738    IF ( TRIM( topography ) /= 'flat' )  THEN
739       IF ( TRIM( topography_grid_convention ) == ' ' )  THEN
740          IF ( TRIM( topography ) == 'single_building' .OR.  &
741               TRIM( topography ) == 'single_street_canyon' )  THEN
742             WRITE ( io, 278 )
743          ELSEIF ( TRIM( topography ) == 'read_from_file' )  THEN
744             WRITE ( io, 279 )
745          ENDIF
746       ELSEIF ( TRIM( topography_grid_convention ) == 'cell_edge' )  THEN
747          WRITE ( io, 278 )
748       ELSEIF ( TRIM( topography_grid_convention ) == 'cell_center' )  THEN
749          WRITE ( io, 279 )
750       ENDIF
751    ENDIF
752
753!-- Complex terrain
754    IF ( complex_terrain )  THEN
755       WRITE( io, 280 ) 
756       IF ( turbulent_inflow )  THEN
757          WRITE( io, 281 )  zu(topo_top_ind(0,0,0))
758       ENDIF
759       IF ( TRIM( initializing_actions ) == 'cyclic_fill' )  THEN
760          WRITE( io, 282 )
761       ENDIF
762    ENDIF
763!
764!-- Boundary conditions
765    IF ( ibc_p_b == 0 )  THEN
766       r_lower = 'p(0)     = 0      |'
767    ELSEIF ( ibc_p_b == 1 )  THEN
768       r_lower = 'p(0)     = p(1)   |'
769    ENDIF
770    IF ( ibc_p_t == 0 )  THEN
771       r_upper  = 'p(nzt+1) = 0      |'
772    ELSE
773       r_upper  = 'p(nzt+1) = p(nzt) |'
774    ENDIF
775
776    IF ( ibc_uv_b == 0 )  THEN
777       r_lower = TRIM( r_lower ) // ' uv(0)     = -uv(1)                |'
778    ELSE
779       r_lower = TRIM( r_lower ) // ' uv(0)     = uv(1)                 |'
780    ENDIF
781    IF ( TRIM( bc_uv_t ) == 'dirichlet_0' )  THEN
782       r_upper  = TRIM( r_upper  ) // ' uv(nzt+1) = 0                     |'
783    ELSEIF ( ibc_uv_t == 0 )  THEN
784       r_upper  = TRIM( r_upper  ) // ' uv(nzt+1) = ug(nzt+1), vg(nzt+1)  |'
785    ELSE
786       r_upper  = TRIM( r_upper  ) // ' uv(nzt+1) = uv(nzt)               |'
787    ENDIF
788
789    IF ( ibc_pt_b == 0 )  THEN
790       IF ( land_surface )  THEN
791          r_lower = TRIM( r_lower ) // ' pt(0)     = from soil model'
792       ELSE
793          r_lower = TRIM( r_lower ) // ' pt(0)     = pt_surface'
794       ENDIF
795    ELSEIF ( ibc_pt_b == 1 )  THEN
796       r_lower = TRIM( r_lower ) // ' pt(0)     = pt(1)'
797    ELSEIF ( ibc_pt_b == 2 )  THEN
798       r_lower = TRIM( r_lower ) // ' pt(0)     = from coupled model'
799    ENDIF
800    IF ( ibc_pt_t == 0 )  THEN
801       r_upper  = TRIM( r_upper  ) // ' pt(nzt+1) = pt_top'
802    ELSEIF( ibc_pt_t == 1 )  THEN
803       r_upper  = TRIM( r_upper  ) // ' pt(nzt+1) = pt(nzt)'
804    ELSEIF( ibc_pt_t == 2 )  THEN
805       r_upper  = TRIM( r_upper  ) // ' pt(nzt+1) = pt(nzt) + dpt/dz_ini'
806
807    ENDIF
808
809    WRITE ( io, 300 )  r_lower, r_upper
810
811    IF ( .NOT. constant_diffusion )  THEN
812       IF ( ibc_e_b == 1 )  THEN
813          r_lower = 'e(0)     = e(1)'
814       ELSE
815          r_lower = 'e(0)     = e(1) = (u*/0.1)**2'
816       ENDIF
817       r_upper = 'e(nzt+1) = e(nzt) = e(nzt-1)'
818
819       WRITE ( io, 301 )  'e', r_lower, r_upper       
820
821    ENDIF
822
823    IF ( ocean_mode )  THEN
824       r_lower = 'sa(0)    = sa(1)'
825       IF ( ibc_sa_t == 0 )  THEN
826          r_upper =  'sa(nzt+1) = sa_surface'
827       ELSE
828          r_upper =  'sa(nzt+1) = sa(nzt)'
829       ENDIF
830       WRITE ( io, 301 ) 'sa', r_lower, r_upper
831    ENDIF
832
833    IF ( humidity )  THEN
834       IF ( ibc_q_b == 0 )  THEN
835          IF ( land_surface )  THEN
836             r_lower = 'q(0)     = from soil model'
837          ELSE
838             r_lower = 'q(0)     = q_surface'
839          ENDIF
840
841       ELSE
842          r_lower = 'q(0)      = q(1)'
843       ENDIF
844       IF ( ibc_q_t == 0 )  THEN
845          r_upper =  'q(nzt+1) = q_top'
846       ELSE
847          r_upper =  'q(nzt+1) = q(nzt) + dq/dz'
848       ENDIF
849       WRITE ( io, 301 ) 'q', r_lower, r_upper
850    ENDIF
851
852    IF ( passive_scalar )  THEN
853       IF ( ibc_s_b == 0 )  THEN
854          r_lower = 's(0)      = s_surface'
855       ELSE
856          r_lower = 's(0)      = s(1)'
857       ENDIF
858       IF ( ibc_s_t == 0 )  THEN
859          r_upper =  's(nzt+1) = s_top'
860       ELSEIF ( ibc_s_t == 1 )  THEN
861          r_upper =  's(nzt+1) = s(nzt)'
862       ELSEIF ( ibc_s_t == 2 )  THEN
863          r_upper =  's(nzt+1) = s(nzt) + ds/dz'
864       ENDIF
865       WRITE ( io, 301 ) 's', r_lower, r_upper
866    ENDIF
867
868    IF ( use_surface_fluxes )  THEN
869       WRITE ( io, 303 )
870       IF ( constant_heatflux )  THEN
871          IF ( large_scale_forcing .AND. lsf_surf )  THEN
872             IF ( surf_def_h(0)%ns >= 1 )  WRITE ( io, 306 )  surf_def_h(0)%shf(1)
873          ELSE
874             WRITE ( io, 306 )  surface_heatflux
875          ENDIF
876          IF ( random_heatflux )  WRITE ( io, 307 )
877       ENDIF
878       IF ( humidity  .AND.  constant_waterflux )  THEN
879          IF ( large_scale_forcing .AND. lsf_surf )  THEN
880             WRITE ( io, 311 ) surf_def_h(0)%qsws(1)
881          ELSE
882             WRITE ( io, 311 ) surface_waterflux
883          ENDIF
884       ENDIF
885       IF ( passive_scalar  .AND.  constant_scalarflux )  THEN
886          WRITE ( io, 313 ) surface_scalarflux
887       ENDIF
888    ENDIF
889
890    IF ( use_top_fluxes )  THEN
891       WRITE ( io, 304 )
892       IF ( coupling_mode == 'uncoupled' )  THEN
893          WRITE ( io, 320 )  top_momentumflux_u, top_momentumflux_v
894          IF ( constant_top_heatflux )  THEN
895             WRITE ( io, 306 )  top_heatflux
896          ENDIF
897       ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
898          WRITE ( io, 316 )
899       ENDIF
900       IF ( ocean_mode  .AND.  constant_top_salinityflux )                          &
901          WRITE ( io, 309 )  top_salinityflux
902       IF ( humidity       )  WRITE ( io, 315 )
903       IF ( passive_scalar .AND.  constant_top_scalarflux )                    &
904          WRITE ( io, 302 ) top_scalarflux
905    ENDIF
906
907    IF ( constant_flux_layer )  THEN
908       WRITE ( io, 305 )  (zu(1)-zu(0)), roughness_length,                     &
909                          z0h_factor*roughness_length, kappa,                  &
910                          zeta_min, zeta_max
911       IF ( .NOT. constant_heatflux )  WRITE ( io, 308 )
912       IF ( humidity  .AND.  .NOT. constant_waterflux )  THEN
913          WRITE ( io, 312 )
914       ENDIF
915       IF ( passive_scalar  .AND.  .NOT. constant_scalarflux )  THEN
916          WRITE ( io, 314 )
917       ENDIF
918    ELSE
919       IF ( INDEX(initializing_actions, 'set_1d-model_profiles') /= 0 )  THEN
920          WRITE ( io, 310 )  zeta_min, zeta_max
921       ENDIF
922    ENDIF
923
924    WRITE ( io, 317 )  bc_lr, bc_ns
925    IF ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )  THEN
926       WRITE ( io, 318 )  use_cmax, pt_damping_width, pt_damping_factor       
927       IF ( turbulent_inflow )  THEN
928          IF ( recycling_yshift == 0 ) THEN
929             WRITE ( io, 319 )  recycling_width, recycling_plane, &
930                                inflow_damping_height, inflow_damping_width
931          ELSE
932             WRITE ( io, 322 )  recycling_yshift, recycling_width, recycling_plane, &
933                                inflow_damping_height, inflow_damping_width
934          END IF
935       ENDIF
936       IF ( turbulent_outflow )  THEN
937          WRITE ( io, 323 )  outflow_source_plane, INT(outflow_source_plane/dx)
938       ENDIF
939    ENDIF
940
941!
942!-- Initial Profiles
943    WRITE ( io, 321 )
944!
945!-- Initial wind profiles
946    IF ( u_profile(1) /= 9999999.9_wp )  WRITE ( io, 427 )
947
948!
949!-- Initial temperature profile
950!-- Building output strings, starting with surface temperature
951    WRITE ( temperatures, '(F6.2)' )  pt_surface
952    gradients = '------'
953    slices = '     0'
954    coordinates = '   0.0'
955    i = 1
956    DO  WHILE ( pt_vertical_gradient_level_ind(i) /= -9999 )
957
958       WRITE (coor_chr,'(F7.2)')  pt_init(pt_vertical_gradient_level_ind(i))
959       temperatures = TRIM( temperatures ) // ' ' // TRIM( coor_chr )
960
961       WRITE (coor_chr,'(F7.2)')  pt_vertical_gradient(i)
962       gradients = TRIM( gradients ) // ' ' // TRIM( coor_chr )
963
964       WRITE (coor_chr,'(I7)')  pt_vertical_gradient_level_ind(i)
965       slices = TRIM( slices ) // ' ' // TRIM( coor_chr )
966
967       WRITE (coor_chr,'(F7.1)')  pt_vertical_gradient_level(i)
968       coordinates = TRIM( coordinates ) // ' '  // TRIM( coor_chr )
969
970       IF ( i == 10 )  THEN
971          EXIT
972       ELSE
973          i = i + 1
974       ENDIF
975
976    ENDDO
977
978    IF ( .NOT. nudging )  THEN
979       WRITE ( io, 420 )  TRIM( coordinates ), TRIM( temperatures ), &
980                          TRIM( gradients ), TRIM( slices )
981    ELSE
982       WRITE ( io, 428 ) 
983    ENDIF
984
985!
986!-- Initial humidity profile
987!-- Building output strings, starting with surface humidity
988    IF ( humidity )  THEN
989       WRITE ( temperatures, '(E8.1)' )  q_surface
990       gradients = '--------'
991       slices = '       0'
992       coordinates = '     0.0'
993       i = 1
994       DO  WHILE ( q_vertical_gradient_level_ind(i) /= -9999 )
995         
996          WRITE (coor_chr,'(E8.1,4X)')  q_init(q_vertical_gradient_level_ind(i))
997          temperatures = TRIM( temperatures ) // '  ' // TRIM( coor_chr )
998
999          WRITE (coor_chr,'(E8.1,4X)')  q_vertical_gradient(i)
1000          gradients = TRIM( gradients ) // '  ' // TRIM( coor_chr )
1001         
1002          WRITE (coor_chr,'(I8,4X)')  q_vertical_gradient_level_ind(i)
1003          slices = TRIM( slices ) // '  ' // TRIM( coor_chr )
1004         
1005          WRITE (coor_chr,'(F8.1,4X)')  q_vertical_gradient_level(i)
1006          coordinates = TRIM( coordinates ) // '  '  // TRIM( coor_chr )
1007
1008          IF ( i == 10 )  THEN
1009             EXIT
1010          ELSE
1011             i = i + 1
1012          ENDIF
1013
1014       ENDDO
1015
1016       IF ( .NOT. nudging )  THEN
1017          WRITE ( io, 421 )  TRIM( coordinates ), TRIM( temperatures ),        &
1018                             TRIM( gradients ), TRIM( slices )
1019       ENDIF
1020    ENDIF
1021!
1022!-- Initial scalar profile
1023!-- Building output strings, starting with surface humidity
1024    IF ( passive_scalar )  THEN
1025       WRITE ( temperatures, '(E8.1)' )  s_surface
1026       gradients = '--------'
1027       slices = '       0'
1028       coordinates = '     0.0'
1029       i = 1
1030       DO  WHILE ( s_vertical_gradient_level_ind(i) /= -9999 )
1031         
1032          WRITE (coor_chr,'(E8.1,4X)')  s_init(s_vertical_gradient_level_ind(i))
1033          temperatures = TRIM( temperatures ) // '  ' // TRIM( coor_chr )
1034
1035          WRITE (coor_chr,'(E8.1,4X)')  s_vertical_gradient(i)
1036          gradients = TRIM( gradients ) // '  ' // TRIM( coor_chr )
1037         
1038          WRITE (coor_chr,'(I8,4X)')  s_vertical_gradient_level_ind(i)
1039          slices = TRIM( slices ) // '  ' // TRIM( coor_chr )
1040         
1041          WRITE (coor_chr,'(F8.1,4X)')  s_vertical_gradient_level(i)
1042          coordinates = TRIM( coordinates ) // '  '  // TRIM( coor_chr )
1043
1044          IF ( i == 10 )  THEN
1045             EXIT
1046          ELSE
1047             i = i + 1
1048          ENDIF
1049
1050       ENDDO
1051
1052       WRITE ( io, 422 )  TRIM( coordinates ), TRIM( temperatures ),           &
1053                          TRIM( gradients ), TRIM( slices )
1054    ENDIF   
1055
1056!
1057!-- Initial salinity profile
1058!-- Building output strings, starting with surface salinity
1059    IF ( ocean_mode )  THEN
1060       WRITE ( temperatures, '(F6.2)' )  sa_surface
1061       gradients = '------'
1062       slices = '     0'
1063       coordinates = '   0.0'
1064       i = 1
1065       DO  WHILE ( sa_vertical_gradient_level_ind(i) /= -9999 )
1066
1067          WRITE (coor_chr,'(F7.2)')  sa_init(sa_vertical_gradient_level_ind(i))
1068          temperatures = TRIM( temperatures ) // ' ' // TRIM( coor_chr )
1069
1070          WRITE (coor_chr,'(F7.2)')  sa_vertical_gradient(i)
1071          gradients = TRIM( gradients ) // ' ' // TRIM( coor_chr )
1072
1073          WRITE (coor_chr,'(I7)')  sa_vertical_gradient_level_ind(i)
1074          slices = TRIM( slices ) // ' ' // TRIM( coor_chr )
1075
1076          WRITE (coor_chr,'(F7.1)')  sa_vertical_gradient_level(i)
1077          coordinates = TRIM( coordinates ) // ' '  // TRIM( coor_chr )
1078
1079          IF ( i == 10 )  THEN
1080             EXIT
1081          ELSE
1082             i = i + 1
1083          ENDIF
1084
1085       ENDDO
1086
1087       WRITE ( io, 425 )  TRIM( coordinates ), TRIM( temperatures ), &
1088                          TRIM( gradients ), TRIM( slices )
1089    ENDIF
1090
1091
1092!
1093!-- Listing of 1D-profiles
1094    WRITE ( io, 325 )  dt_dopr_listing
1095    IF ( averaging_interval_pr /= 0.0_wp )  THEN
1096       WRITE ( io, 326 )  averaging_interval_pr, dt_averaging_input_pr
1097    ENDIF
1098
1099!
1100!-- DATA output
1101    WRITE ( io, 330 )
1102    IF ( averaging_interval_pr /= 0.0_wp )  THEN
1103       WRITE ( io, 326 )  averaging_interval_pr, dt_averaging_input_pr
1104    ENDIF
1105
1106!
1107!-- 1D-profiles
1108    dopr_chr = 'Profile:'
1109    IF ( dopr_n /= 0 )  THEN
1110       WRITE ( io, 331 )
1111
1112       output_format = ''
1113       output_format = netcdf_data_format_string
1114       IF ( netcdf_deflate == 0 )  THEN
1115          WRITE ( io, 344 )  output_format
1116       ELSE
1117          WRITE ( io, 354 )  TRIM( output_format ), netcdf_deflate
1118       ENDIF
1119
1120       DO  i = 1, dopr_n
1121          dopr_chr = TRIM( dopr_chr ) // ' ' // TRIM( data_output_pr(i) ) // ','
1122          IF ( LEN_TRIM( dopr_chr ) >= 60 )  THEN
1123             WRITE ( io, 332 )  dopr_chr
1124             dopr_chr = '       :'
1125          ENDIF
1126       ENDDO
1127
1128       IF ( dopr_chr /= '' )  THEN
1129          WRITE ( io, 332 )  dopr_chr
1130       ENDIF
1131       WRITE ( io, 333 )  dt_dopr, averaging_interval_pr, dt_averaging_input_pr
1132       IF ( skip_time_dopr /= 0.0_wp )  WRITE ( io, 339 )  skip_time_dopr
1133    ENDIF
1134
1135!
1136!-- 2D-arrays
1137    DO  av = 0, 1
1138
1139       i = 1
1140       do2d_xy = ''
1141       do2d_xz = ''
1142       do2d_yz = ''
1143       DO  WHILE ( do2d(av,i) /= ' ' )
1144
1145          l = MAX( 2, LEN_TRIM( do2d(av,i) ) )
1146          do2d_mode = do2d(av,i)(l-1:l)
1147
1148          SELECT CASE ( do2d_mode )
1149             CASE ( 'xy' )
1150                ll = LEN_TRIM( do2d_xy )
1151                do2d_xy = do2d_xy(1:ll) // ' ' // do2d(av,i)(1:l-3) // ','
1152             CASE ( 'xz' )
1153                ll = LEN_TRIM( do2d_xz )
1154                do2d_xz = do2d_xz(1:ll) // ' ' // do2d(av,i)(1:l-3) // ','
1155             CASE ( 'yz' )
1156                ll = LEN_TRIM( do2d_yz )
1157                do2d_yz = do2d_yz(1:ll) // ' ' // do2d(av,i)(1:l-3) // ','
1158          END SELECT
1159
1160          i = i + 1
1161
1162       ENDDO
1163
1164       IF ( ( ( do2d_xy /= ''  .AND.  section(1,1) /= -9999 )  .OR.    &
1165              ( do2d_xz /= ''  .AND.  section(1,2) /= -9999 )  .OR.    &
1166              ( do2d_yz /= ''  .AND.  section(1,3) /= -9999 ) ) )  THEN
1167
1168          IF (  av == 0 )  THEN
1169             WRITE ( io, 334 )  ''
1170          ELSE
1171             WRITE ( io, 334 )  '(time-averaged)'
1172          ENDIF
1173
1174          IF ( do2d_at_begin )  THEN
1175             begin_chr = 'and at the start'
1176          ELSE
1177             begin_chr = ''
1178          ENDIF
1179
1180          output_format = ''
1181          output_format = netcdf_data_format_string
1182          IF ( netcdf_deflate == 0 )  THEN
1183             WRITE ( io, 344 )  output_format
1184          ELSE
1185             WRITE ( io, 354 )  TRIM( output_format ), netcdf_deflate
1186          ENDIF
1187
1188          IF ( do2d_xy /= ''  .AND.  section(1,1) /= -9999 )  THEN
1189             i = 1
1190             slices = '/'
1191             coordinates = '/'
1192!
1193!--          Building strings with index and coordinate information of the
1194!--          slices
1195             DO  WHILE ( section(i,1) /= -9999 )
1196
1197                WRITE (section_chr,'(I5)')  section(i,1)
1198                section_chr = ADJUSTL( section_chr )
1199                slices = TRIM( slices ) // TRIM( section_chr ) // '/'
1200
1201                IF ( section(i,1) == -1 )  THEN
1202                   WRITE (coor_chr,'(F10.1)')  -1.0_wp
1203                ELSE
1204                   WRITE (coor_chr,'(F10.1)')  zu(section(i,1))
1205                ENDIF
1206                coor_chr = ADJUSTL( coor_chr )
1207                coordinates = TRIM( coordinates ) // TRIM( coor_chr ) // '/'
1208
1209                i = i + 1
1210             ENDDO
1211             IF ( av == 0 )  THEN
1212                WRITE ( io, 335 )  'XY', do2d_xy, dt_do2d_xy, &
1213                                   TRIM( begin_chr ), 'k', TRIM( slices ), &
1214                                   TRIM( coordinates )
1215                IF ( skip_time_do2d_xy /= 0.0_wp )  THEN
1216                   WRITE ( io, 339 )  skip_time_do2d_xy
1217                ENDIF
1218             ELSE
1219                WRITE ( io, 342 )  'XY', do2d_xy, dt_data_output_av, &
1220                                   TRIM( begin_chr ), averaging_interval, &
1221                                   dt_averaging_input, 'k', TRIM( slices ), &
1222                                   TRIM( coordinates )
1223                IF ( skip_time_data_output_av /= 0.0_wp )  THEN
1224                   WRITE ( io, 339 )  skip_time_data_output_av
1225                ENDIF
1226             ENDIF
1227             IF ( netcdf_data_format > 4 )  THEN
1228                WRITE ( io, 352 )  ntdim_2d_xy(av)
1229             ELSE
1230                WRITE ( io, 353 )
1231             ENDIF
1232          ENDIF
1233
1234          IF ( do2d_xz /= ''  .AND.  section(1,2) /= -9999 )  THEN
1235             i = 1
1236             slices = '/'
1237             coordinates = '/'
1238!
1239!--          Building strings with index and coordinate information of the
1240!--          slices
1241             DO  WHILE ( section(i,2) /= -9999 )
1242
1243                WRITE (section_chr,'(I5)')  section(i,2)
1244                section_chr = ADJUSTL( section_chr )
1245                slices = TRIM( slices ) // TRIM( section_chr ) // '/'
1246
1247                WRITE (coor_chr,'(F10.1)')  section(i,2) * dy
1248                coor_chr = ADJUSTL( coor_chr )
1249                coordinates = TRIM( coordinates ) // TRIM( coor_chr ) // '/'
1250
1251                i = i + 1
1252             ENDDO
1253             IF ( av == 0 )  THEN
1254                WRITE ( io, 335 )  'XZ', do2d_xz, dt_do2d_xz, &
1255                                   TRIM( begin_chr ), 'j', TRIM( slices ), &
1256                                   TRIM( coordinates )
1257                IF ( skip_time_do2d_xz /= 0.0_wp )  THEN
1258                   WRITE ( io, 339 )  skip_time_do2d_xz
1259                ENDIF
1260             ELSE
1261                WRITE ( io, 342 )  'XZ', do2d_xz, dt_data_output_av, &
1262                                   TRIM( begin_chr ), averaging_interval, &
1263                                   dt_averaging_input, 'j', TRIM( slices ), &
1264                                   TRIM( coordinates )
1265                IF ( skip_time_data_output_av /= 0.0_wp )  THEN
1266                   WRITE ( io, 339 )  skip_time_data_output_av
1267                ENDIF
1268             ENDIF
1269             IF ( netcdf_data_format > 4 )  THEN
1270                WRITE ( io, 352 )  ntdim_2d_xz(av)
1271             ELSE
1272                WRITE ( io, 353 )
1273             ENDIF
1274          ENDIF
1275
1276          IF ( do2d_yz /= ''  .AND.  section(1,3) /= -9999 )  THEN
1277             i = 1
1278             slices = '/'
1279             coordinates = '/'
1280!
1281!--          Building strings with index and coordinate information of the
1282!--          slices
1283             DO  WHILE ( section(i,3) /= -9999 )
1284
1285                WRITE (section_chr,'(I5)')  section(i,3)
1286                section_chr = ADJUSTL( section_chr )
1287                slices = TRIM( slices ) // TRIM( section_chr ) // '/'
1288
1289                WRITE (coor_chr,'(F10.1)')  section(i,3) * dx
1290                coor_chr = ADJUSTL( coor_chr )
1291                coordinates = TRIM( coordinates ) // TRIM( coor_chr ) // '/'
1292
1293                i = i + 1
1294             ENDDO
1295             IF ( av == 0 )  THEN
1296                WRITE ( io, 335 )  'YZ', do2d_yz, dt_do2d_yz, &
1297                                   TRIM( begin_chr ), 'i', TRIM( slices ), &
1298                                   TRIM( coordinates )
1299                IF ( skip_time_do2d_yz /= 0.0_wp )  THEN
1300                   WRITE ( io, 339 )  skip_time_do2d_yz
1301                ENDIF
1302             ELSE
1303                WRITE ( io, 342 )  'YZ', do2d_yz, dt_data_output_av, &
1304                                   TRIM( begin_chr ), averaging_interval, &
1305                                   dt_averaging_input, 'i', TRIM( slices ), &
1306                                   TRIM( coordinates )
1307                IF ( skip_time_data_output_av /= 0.0_wp )  THEN
1308                   WRITE ( io, 339 )  skip_time_data_output_av
1309                ENDIF
1310             ENDIF
1311             IF ( netcdf_data_format > 4 )  THEN
1312                WRITE ( io, 352 )  ntdim_2d_yz(av)
1313             ELSE
1314                WRITE ( io, 353 )
1315             ENDIF
1316          ENDIF
1317
1318       ENDIF
1319
1320    ENDDO
1321
1322!
1323!-- 3d-arrays
1324    DO  av = 0, 1
1325
1326       i = 1
1327       do3d_chr = ''
1328       DO  WHILE ( do3d(av,i) /= ' ' )
1329
1330          do3d_chr = TRIM( do3d_chr ) // ' ' // TRIM( do3d(av,i) ) // ','
1331          i = i + 1
1332
1333       ENDDO
1334
1335       IF ( do3d_chr /= '' )  THEN
1336          IF ( av == 0 )  THEN
1337             WRITE ( io, 336 )  ''
1338          ELSE
1339             WRITE ( io, 336 )  '(time-averaged)'
1340          ENDIF
1341
1342          output_format = netcdf_data_format_string
1343          IF ( netcdf_deflate == 0 )  THEN
1344             WRITE ( io, 344 )  output_format
1345          ELSE
1346             WRITE ( io, 354 )  TRIM( output_format ), netcdf_deflate
1347          ENDIF
1348
1349          IF ( do3d_at_begin )  THEN
1350             begin_chr = 'and at the start'
1351          ELSE
1352             begin_chr = ''
1353          ENDIF
1354          IF ( av == 0 )  THEN
1355             WRITE ( io, 337 )  do3d_chr, dt_do3d, TRIM( begin_chr ), &
1356                                zu(nz_do3d), nz_do3d
1357          ELSE
1358             WRITE ( io, 343 )  do3d_chr, dt_data_output_av,           &
1359                                TRIM( begin_chr ), averaging_interval, &
1360                                dt_averaging_input, zu(nz_do3d), nz_do3d
1361          ENDIF
1362
1363          IF ( netcdf_data_format > 4 )  THEN
1364             WRITE ( io, 352 )  ntdim_3d(av)
1365          ELSE
1366             WRITE ( io, 353 )
1367          ENDIF
1368
1369          IF ( av == 0 )  THEN
1370             IF ( skip_time_do3d /= 0.0_wp )  THEN
1371                WRITE ( io, 339 )  skip_time_do3d
1372             ENDIF
1373          ELSE
1374             IF ( skip_time_data_output_av /= 0.0_wp )  THEN
1375                WRITE ( io, 339 )  skip_time_data_output_av
1376             ENDIF
1377          ENDIF
1378
1379       ENDIF
1380
1381    ENDDO
1382
1383!
1384!-- masked arrays
1385    IF ( masks > 0 )  WRITE ( io, 345 )  &
1386         mask_scale_x, mask_scale_y, mask_scale_z
1387    DO  mid = 1, masks
1388       DO  av = 0, 1
1389
1390          i = 1
1391          domask_chr = ''
1392          DO  WHILE ( domask(mid,av,i) /= ' ' )
1393             domask_chr = TRIM( domask_chr ) // ' ' //  &
1394                          TRIM( domask(mid,av,i) ) // ','
1395             i = i + 1
1396          ENDDO
1397
1398          IF ( domask_chr /= '' )  THEN
1399             IF ( av == 0 )  THEN
1400                WRITE ( io, 346 )  '', mid
1401             ELSE
1402                WRITE ( io, 346 )  ' (time-averaged)', mid
1403             ENDIF
1404
1405             output_format = netcdf_data_format_string
1406!--          Parallel output not implemented for mask data, hence
1407!--          output_format must be adjusted.
1408             IF ( netcdf_data_format == 5 ) output_format = 'netCDF4/HDF5'
1409             IF ( netcdf_data_format == 6 ) output_format = 'netCDF4/HDF5 classic'
1410             IF ( netcdf_deflate == 0 )  THEN
1411                WRITE ( io, 344 )  output_format
1412             ELSE
1413                WRITE ( io, 354 )  TRIM( output_format ), netcdf_deflate
1414             ENDIF
1415
1416             IF ( av == 0 )  THEN
1417                WRITE ( io, 347 )  domask_chr, dt_domask(mid)
1418             ELSE
1419                WRITE ( io, 348 )  domask_chr, dt_data_output_av, &
1420                                   averaging_interval, dt_averaging_input
1421             ENDIF
1422
1423             IF ( av == 0 )  THEN
1424                IF ( skip_time_domask(mid) /= 0.0_wp )  THEN
1425                   WRITE ( io, 339 )  skip_time_domask(mid)
1426                ENDIF
1427             ELSE
1428                IF ( skip_time_data_output_av /= 0.0_wp )  THEN
1429                   WRITE ( io, 339 )  skip_time_data_output_av
1430                ENDIF
1431             ENDIF
1432!
1433!--          output locations
1434             DO  dim = 1, 3
1435                IF ( mask(mid,dim,1) >= 0.0_wp )  THEN
1436                   count = 0
1437                   DO  WHILE ( mask(mid,dim,count+1) >= 0.0_wp )
1438                      count = count + 1
1439                   ENDDO
1440                   WRITE ( io, 349 )  dir(dim), dir(dim), mid, dir(dim), &
1441                                      mask(mid,dim,:count)
1442                ELSEIF ( mask_loop(mid,dim,1) < 0.0_wp .AND.  &
1443                         mask_loop(mid,dim,2) < 0.0_wp .AND.  &
1444                         mask_loop(mid,dim,3) == 0.0_wp )  THEN
1445                   WRITE ( io, 350 )  dir(dim), dir(dim)
1446                ELSEIF ( mask_loop(mid,dim,3) == 0.0_wp )  THEN
1447                   WRITE ( io, 351 )  dir(dim), dir(dim), mid, dir(dim), &
1448                                      mask_loop(mid,dim,1:2)
1449                ELSE
1450                   WRITE ( io, 351 )  dir(dim), dir(dim), mid, dir(dim), &
1451                                      mask_loop(mid,dim,1:3)
1452                ENDIF
1453             ENDDO
1454          ENDIF
1455
1456       ENDDO
1457    ENDDO
1458
1459!
1460!-- Timeseries
1461    IF ( dt_dots /= 9999999.9_wp )  THEN
1462       WRITE ( io, 340 )
1463
1464       output_format = netcdf_data_format_string
1465       IF ( netcdf_deflate == 0 )  THEN
1466          WRITE ( io, 344 )  output_format
1467       ELSE
1468          WRITE ( io, 354 )  TRIM( output_format ), netcdf_deflate
1469       ENDIF
1470       WRITE ( io, 341 )  dt_dots
1471    ENDIF
1472
1473    WRITE ( io, 99 )
1474
1475!
1476!-- Physical quantities
1477    WRITE ( io, 400 )
1478
1479!
1480!-- Geostrophic parameters
1481    WRITE ( io, 410 )  latitude, longitude, rotation_angle, omega, f, fs
1482
1483!
1484!-- Day and time during model start
1485    CALL get_date_time( 0.0_wp, date_time_str=date_time_str )
1486    WRITE ( io, 456 )  TRIM( date_time_str )
1487
1488!
1489!-- Other quantities
1490    WRITE ( io, 411 )  g
1491
1492    WRITE ( io, 412 )  TRIM( reference_state )
1493    IF ( use_single_reference_value )  THEN
1494       IF ( ocean_mode )  THEN
1495          WRITE ( io, 413 )  prho_reference
1496       ELSE
1497          WRITE ( io, 414 )  pt_reference
1498       ENDIF
1499    ENDIF
1500
1501!
1502!-- Cloud physcis parameters / quantities / numerical methods
1503    WRITE ( io, 430 )
1504    IF ( humidity .AND. .NOT. bulk_cloud_model .AND. .NOT. cloud_droplets)  THEN
1505       WRITE ( io, 431 )
1506    ENDIF
1507!
1508!-- LES / turbulence parameters
1509    WRITE ( io, 450 )
1510
1511!--
1512! ... LES-constants used must still be added here
1513!--
1514    IF ( constant_diffusion )  THEN
1515       WRITE ( io, 451 )  km_constant, km_constant/prandtl_number, &
1516                          prandtl_number
1517    ENDIF
1518    IF ( .NOT. constant_diffusion)  THEN
1519       IF ( e_init > 0.0_wp )  WRITE ( io, 455 )  e_init
1520       IF ( e_min > 0.0_wp )  WRITE ( io, 454 )  e_min
1521       IF ( wall_adjustment )  WRITE ( io, 453 )  wall_adjustment_factor
1522    ENDIF
1523    IF ( rans_mode )  THEN
1524       WRITE ( io, 457 )  rans_const_c, rans_const_sigma
1525    ENDIF
1526!
1527!-- Special actions during the run
1528    WRITE ( io, 470 )
1529    IF ( create_disturbances )  THEN
1530       WRITE ( io, 471 )  dt_disturb, disturbance_amplitude,                   &
1531                          zu(disturbance_level_ind_b), disturbance_level_ind_b,&
1532                          zu(disturbance_level_ind_t), disturbance_level_ind_t
1533       IF ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )  THEN
1534          WRITE ( io, 472 )  inflow_disturbance_begin, inflow_disturbance_end
1535       ELSE
1536          WRITE ( io, 473 )  disturbance_energy_limit
1537       ENDIF
1538       WRITE ( io, 474 )  TRIM( random_generator )
1539    ENDIF
1540    IF ( pt_surface_initial_change /= 0.0_wp )  THEN
1541       WRITE ( io, 475 )  pt_surface_initial_change
1542    ENDIF
1543    IF ( humidity  .AND.  q_surface_initial_change /= 0.0_wp )  THEN
1544       WRITE ( io, 476 )  q_surface_initial_change       
1545    ENDIF
1546    IF ( passive_scalar  .AND.  q_surface_initial_change /= 0.0_wp )  THEN
1547       WRITE ( io, 477 )  q_surface_initial_change       
1548    ENDIF
1549
1550!
1551!-- Parameters of 1D-model
1552    IF ( INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 )  THEN
1553       WRITE ( io, 500 )  end_time_1d, dt_run_control_1d, dt_pr_1d, &
1554                          mixing_length_1d, dissipation_1d
1555       IF ( damp_level_ind_1d /= nzt+1 )  THEN
1556          WRITE ( io, 502 )  zu(damp_level_ind_1d), damp_level_ind_1d
1557       ENDIF
1558    ENDIF
1559
1560!
1561!-- Header information from other modules
1562    CALL module_interface_header( io )
1563
1564
1565    WRITE ( io, 99 )
1566
1567!
1568!-- Write buffer contents to disc immediately
1569    FLUSH( io )
1570
1571!
1572!-- Here the FORMATs start
1573
1574 99 FORMAT (1X,78('-'))
1575100 FORMAT (/1X,'******************************',4X,44('-')/        &
1576            1X,'* ',A,' *',4X,A/                               &
1577            1X,'******************************',4X,44('-'))
1578101 FORMAT (35X,'coupled run: ',A/ &
1579            35X,42('-'))
1580102 FORMAT (/' Date:               ',A10,4X,'Run:       ',A34/      &
1581            ' Time:                 ',A8,4X,'Run-No.:   ',I2.2/     &
1582            ' Run on host:        ',A10)
1583#if defined( __parallel )
1584103 FORMAT (' Number of PEs:',10X,I6,4X,'Processor grid (x,y): (',I4,',',I4, &
1585              ')',1X,A)
1586104 FORMAT (' Number of PEs:',10X,I6,4X,'Tasks:',I4,'   threads per task:',I4/ &
1587              35X,'Processor grid (x,y): (',I4,',',I4,')',1X,A)
1588107 FORMAT (35X,'A 1d-decomposition along ',A,' is used')
1589108 FORMAT (35X,'Max. # of parallel I/O streams is ',I5)
1590109 FORMAT (35X,'Precursor run for coupled atmos-ocean run'/ &
1591            35X,42('-'))
1592114 FORMAT (35X,'Coupled atmosphere-ocean run following'/ &
1593            35X,'independent precursor runs'/             &
1594            35X,42('-'))
1595#endif
1596110 FORMAT (/' Numerical Schemes:'/ &
1597             ' -----------------'/)
1598124 FORMAT (' --> Use the ',A,' turbulence closure (',A,' mode).')
1599121 FORMAT (' --> Use the ',A,' approximation for the model equations.')
1600111 FORMAT (' --> Solve perturbation pressure via FFT using ',A,' routines')
1601112 FORMAT (' --> Solve perturbation pressure via SOR-Red/Black-Schema'/ &
1602            '     Iterations (initial/other): ',I3,'/',I3,'  omega =',F6.3)
1603113 FORMAT (' --> Momentum advection via Piascek-Williams-Scheme (Form C3)', &
1604                  ' or Upstream')
1605115 FORMAT ('     FFT and transpositions are overlapping')
1606116 FORMAT (' --> Scalar advection via Piascek-Williams-Scheme (Form C3)', &
1607                  ' or Upstream')
1608118 FORMAT (' --> Scalar advection via Bott-Chlond-Scheme')
1609119 FORMAT (' --> Galilei-Transform applied to horizontal advection:'/ &
1610            '     translation velocity = ',A/ &
1611            '     distance advected ',A,':  ',F8.3,' km(x)  ',F8.3,' km(y)')
1612122 FORMAT (' --> Time differencing scheme: ',A)
1613123 FORMAT (' --> Rayleigh-Damping active, starts ',A,' z = ',F8.2,' m'/ &
1614            '     maximum damping coefficient:',F6.3, ' 1/s')
1615129 FORMAT (' --> Additional prognostic equation for the specific humidity')
1616130 FORMAT (' --> Additional prognostic equation for the total water content')
1617131 FORMAT (' --> No pt-equation solved. Neutral stratification with pt = ', &
1618                  F6.2, ' K assumed')
1619134 FORMAT (' --> Additional prognostic equation for a passive scalar')
1620135 FORMAT (' --> Solve perturbation pressure via ',A,' method (', &
1621                  A,'-cycle)'/ &
1622            '     number of grid levels:                   ',I2/ &
1623            '     Gauss-Seidel red/black iterations:       ',I2)
1624136 FORMAT ('     gridpoints of coarsest subdomain (x,y,z): (',I3,',',I3,',', &
1625                  I3,')')
1626137 FORMAT ('     level data gathered on PE0 at level:     ',I2/ &
1627            '     gridpoints of coarsest subdomain (x,y,z): (',I3,',',I3,',', &
1628                  I3,')'/ &
1629            '     gridpoints of coarsest domain (x,y,z):    (',I3,',',I3,',', &
1630                  I3,')')
1631139 FORMAT (' --> Loop optimization method: ',A)
1632140 FORMAT ('     maximum residual allowed:                ',E10.3)
1633141 FORMAT ('     fixed number of multigrid cycles:        ',I4)
1634142 FORMAT ('     perturbation pressure is calculated at every Runge-Kutta ', &
1635                  'step')
1636143 FORMAT ('     Euler/upstream scheme is used for the SGS turbulent ', &
1637                  'kinetic energy')
1638144 FORMAT ('     masking method is used')
1639150 FORMAT (' --> Volume flow at the right and north boundary will be ', &
1640                  'conserved'/ &
1641            '     using the ',A,' mode')
1642151 FORMAT ('     with u_bulk = ',F7.3,' m/s and v_bulk = ',F7.3,' m/s')
1643152 FORMAT (' --> External pressure gradient directly prescribed by the user:',&
1644           /'     ',2(1X,E12.5),'Pa/m in x/y direction', &
1645           /'     starting from dp_level_b =', F8.3, 'm', A /)
1646200 FORMAT (//' Run time and time step information:'/ &
1647             ' ----------------------------------'/)
1648201 FORMAT ( ' Timestep:             variable     maximum value: ',F6.3,' s', &
1649             '    CFL-factor:',F5.2)
1650202 FORMAT ( ' Timestep:          dt = ',F6.3,' s'/)
1651203 FORMAT ( ' Start time:        ',F11.3,' s'/ &
1652             ' End time:          ',F11.3,' s')
1653204 FORMAT ( A,F11.3,' s')
1654205 FORMAT ( A,F11.3,' s',5X,'restart every',17X,F11.3,' s')
1655206 FORMAT (/' Time reached:      ',F11.3,' s'/ &
1656             ' CPU-time used:       ',F9.3,' s     per timestep:                 ',F9.3,' s'/ &
1657             '                                      per second of simulated time: ',F9.3,' s')
1658207 FORMAT ( ' Spinup time:       ',F11.3,' s')
1659250 FORMAT (//' Computational grid and domain size:'/ &
1660              ' ----------------------------------'// &
1661              ' Grid length:      dx =    ',F8.3,' m    dy =    ',F8.3, ' m')
1662251 FORMAT (  /' Domain size:       x = ',F10.3,' m     y = ',F10.3, &
1663              ' m  z(u) = ',F10.3,' m'/)
1664253 FORMAT ( '                dz(',I1,') =    ', F8.3, ' m')
1665254 FORMAT (//' Number of gridpoints (x,y,z):  (0:',I4,', 0:',I4,', 0:',I4,')'/ &
1666            ' Subdomain size (x,y,z):        (  ',I4,',   ',I4,',   ',I4,')'/)
1667260 FORMAT (/' The model has a slope in x-direction. Inclination angle: ',F6.2,&
1668             ' degrees')
1669270 FORMAT (//' Topography information:'/ &
1670              ' ----------------------'// &
1671              1X,'Topography: ',A)
1672271 FORMAT (  ' Building size (x/y/z) in m: ',F5.1,' / ',F5.1,' / ',F5.1/ &
1673              ' Horizontal index bounds (l/r/s/n): ',I4,' / ',I4,' / ',I4, &
1674                ' / ',I4)
1675272 FORMAT (  ' Single quasi-2D street canyon of infinite length in ',A, &
1676              ' direction' / &
1677              ' Canyon height: ', F6.2, 'm, ch = ', I4, '.'      / &
1678              ' Canyon position (',A,'-walls): cxl = ', I4,', cxr = ', I4, '.')
1679273 FORMAT (  ' Tunnel of infinite length in ',A, &
1680              ' direction' / &
1681              ' Tunnel height: ', F6.2, / &
1682              ' Tunnel-wall depth: ', F6.2      / &
1683              ' Tunnel width: ', F6.2 )
1684274 FORMAT (  ' Tunnel in ', A, ' direction.' / &
1685              ' Tunnel height: ', F6.2, / &   
1686              ' Tunnel-wall depth: ', F6.2      / &
1687              ' Tunnel width: ', F6.2, / &
1688              ' Tunnel length: ', F6.2 )
1689278 FORMAT (' Topography grid definition convention:'/ &
1690            ' cell edge (staggered grid points'/  &
1691            ' (u in x-direction, v in y-direction))' /)
1692279 FORMAT (' Topography grid definition convention:'/ &
1693            ' cell center (scalar grid points)' /)
1694280 FORMAT (' Complex terrain simulation is activated.')
1695281 FORMAT ('    --> Mean inflow profiles are adjusted.' / &
1696            '    --> Elevation of inflow boundary: ', F7.1, ' m' )
1697282 FORMAT ('    --> Initial data from 3D-precursor run is shifted' / &
1698            '        vertically depending on local surface height.')
1699300 FORMAT (//' Boundary conditions:'/ &
1700             ' -------------------'// &
1701             '                     p                    uv             ', &
1702             '                     pt'// &
1703             ' B. bound.: ',A/ &
1704             ' T. bound.: ',A)
1705301 FORMAT (/'                     ',A// &
1706             ' B. bound.: ',A/ &
1707             ' T. bound.: ',A)
1708303 FORMAT (/' Bottom surface fluxes are used in diffusion terms at k=1')
1709304 FORMAT (/' Top surface fluxes are used in diffusion terms at k=nzt')
1710305 FORMAT (//'    Constant flux layer between bottom surface and first ',     &
1711              'computational u,v-level:'// &
1712             '       z_mo = ',F6.2,' m   z0 =',F7.4,' m   z0h =',F8.5,&
1713             ' m   kappa =',F5.2/ &
1714             '       Rif value range:   ',F8.2,' <= rif <=',F6.2)
1715306 FORMAT ('       Predefined constant heatflux:   ',F9.6,' K m/s')
1716307 FORMAT ('       Heatflux has a random normal distribution')
1717308 FORMAT ('       Predefined surface temperature')
1718309 FORMAT ('       Predefined constant salinityflux:   ',F9.6,' psu m/s')
1719310 FORMAT (//'    1D-Model:'// &
1720             '       Rif value range:   ',F6.2,' <= rif <=',F6.2)
1721311 FORMAT ('       Predefined constant humidity flux: ',E10.3,' kg/kg m/s')
1722312 FORMAT ('       Predefined surface humidity')
1723313 FORMAT ('       Predefined constant scalar flux: ',E10.3,' kg/(m**2 s)')
1724314 FORMAT ('       Predefined scalar value at the surface')
1725302 FORMAT ('       Predefined constant scalarflux:   ',F9.6,' kg/(m**2 s)')
1726315 FORMAT ('       Humidity flux at top surface is 0.0')
1727316 FORMAT ('       Sensible heatflux and momentum flux from coupled ', &
1728                    'atmosphere model')
1729317 FORMAT (//' Lateral boundaries:'/ &
1730            '       left/right:  ',A/    &
1731            '       north/south: ',A)
1732318 FORMAT (/'       use_cmax: ',L1 / &
1733            '       pt damping layer width = ',F8.2,' m, pt ', &
1734                    'damping factor =',F7.4)
1735319 FORMAT ('       turbulence recycling at inflow switched on'/ &
1736            '       width of recycling domain: ',F7.1,' m   grid index: ',I4/ &
1737            '       inflow damping height: ',F6.1,' m   width: ',F6.1,' m')
1738320 FORMAT ('       Predefined constant momentumflux:  u: ',F9.6,' m**2/s**2'/ &
1739            '                                          v: ',F9.6,' m**2/s**2')
1740321 FORMAT (//' Initial profiles:'/ &
1741              ' ----------------')
1742322 FORMAT ('       turbulence recycling at inflow switched on'/ &
1743            '       y shift of the recycled inflow turbulence is',I3,' PE'/ &
1744            '       width of recycling domain: ',F7.1,' m   grid index: ',I4/ &
1745            '       inflow damping height: ',F6.1,' m   width: ',F6.1,' m'/)
1746323 FORMAT ('       turbulent outflow conditon switched on'/ &
1747            '       position of outflow source plane: ',F7.1,' m   ', &
1748                    'grid index: ', I4)
1749325 FORMAT (//' List output:'/ &
1750             ' -----------'//  &
1751            '    1D-Profiles:'/    &
1752            '       Output every             ',F10.2,' s')
1753326 FORMAT ('       Time averaged over       ',F8.2,' s'/ &
1754            '       Averaging input every    ',F8.2,' s')
1755330 FORMAT (//' Data output:'/ &
1756             ' -----------'/)
1757331 FORMAT (/'    1D-Profiles:')
1758332 FORMAT (/'       ',A)
1759333 FORMAT ('       Output every             ',F8.2,' s',/ &
1760            '       Time averaged over       ',F8.2,' s'/ &
1761            '       Averaging input every    ',F8.2,' s')
1762334 FORMAT (/'    2D-Arrays',A,':')
1763335 FORMAT (/'       ',A2,'-cross-section  Arrays: ',A/ &
1764            '       Output every             ',F8.2,' s  ',A/ &
1765            '       Cross sections at ',A1,' = ',A/ &
1766            '       scalar-coordinates:   ',A,' m'/)
1767336 FORMAT (/'    3D-Arrays',A,':')
1768337 FORMAT (/'       Arrays: ',A/ &
1769            '       Output every             ',F8.2,' s  ',A/ &
1770            '       Upper output limit at    ',F8.2,' m  (GP ',I4,')'/)
1771339 FORMAT ('       No output during initial ',F8.2,' s')
1772340 FORMAT (/'    Time series:')
1773341 FORMAT ('       Output every             ',F8.2,' s'/)
1774342 FORMAT (/'       ',A2,'-cross-section  Arrays: ',A/ &
1775            '       Output every             ',F8.2,' s  ',A/ &
1776            '       Time averaged over       ',F8.2,' s'/ &
1777            '       Averaging input every    ',F8.2,' s'/ &
1778            '       Cross sections at ',A1,' = ',A/ &
1779            '       scalar-coordinates:   ',A,' m'/)
1780343 FORMAT (/'       Arrays: ',A/ &
1781            '       Output every             ',F8.2,' s  ',A/ &
1782            '       Time averaged over       ',F8.2,' s'/ &
1783            '       Averaging input every    ',F8.2,' s'/ &
1784            '       Upper output limit at    ',F8.2,' m  (GP ',I4,')'/)
1785344 FORMAT ('       Output format: ',A/)
1786345 FORMAT (/'    Scaling lengths for output locations of all subsequent mask IDs:',/ &
1787            '       mask_scale_x (in x-direction): ',F9.3, ' m',/ &
1788            '       mask_scale_y (in y-direction): ',F9.3, ' m',/ &
1789            '       mask_scale_z (in z-direction): ',F9.3, ' m' )
1790346 FORMAT (/'    Masked data output',A,' for mask ID ',I2, ':')
1791347 FORMAT ('       Variables: ',A/ &
1792            '       Output every             ',F8.2,' s')
1793348 FORMAT ('       Variables: ',A/ &
1794            '       Output every             ',F8.2,' s'/ &
1795            '       Time averaged over       ',F8.2,' s'/ &
1796            '       Averaging input every    ',F8.2,' s')
1797349 FORMAT (/'       Output locations in ',A,'-direction in multiples of ', &
1798            'mask_scale_',A,' predefined by array mask_',I2.2,'_',A,':'/ &
1799            13('       ',8(F8.2,',')/) )
1800350 FORMAT (/'       Output locations in ',A,'-direction: ', &
1801            'all gridpoints along ',A,'-direction (default).' )
1802351 FORMAT (/'       Output locations in ',A,'-direction in multiples of ', &
1803            'mask_scale_',A,' constructed from array mask_',I2.2,'_',A,'_loop:'/ &
1804            '          loop begin:',F8.2,', end:',F8.2,', stride:',F8.2 )
1805352 FORMAT  (/'       Number of output time levels allowed: ',I3 /)
1806353 FORMAT  (/'       Number of output time levels allowed: unlimited' /)
1807354 FORMAT ('       Output format: ',A, '   compressed with level: ',I1/)
1808400 FORMAT (//' Physical quantities:'/ &
1809              ' -------------------'/)
1810410 FORMAT ('    Geograph. latitude  :   latitude  = ',F5.1,' degr'/   &
1811            '    Geograph. longitude :   longitude = ',F5.1,' degr'/   &
1812            '    Rotation angle      :   rotation_angle = ',F5.1,' degr'/   &
1813            '    Angular velocity    :   omega  =',E10.3,' rad/s'/  &
1814            '    Coriolis parameter  :   f      = ',F9.6,' 1/s'/    &
1815            '                            f*     = ',F9.6,' 1/s')
1816411 FORMAT (/'    Gravity             :   g      = ',F4.1,' m/s**2')
1817412 FORMAT (/'    Reference state used in buoyancy terms: ',A)
1818413 FORMAT ('       Reference density in buoyancy terms: ',F8.3,' kg/m**3')
1819414 FORMAT ('       Reference temperature in buoyancy terms: ',F8.4,' K')
1820420 FORMAT (/'    Characteristic levels of the initial temperature profile:'// &
1821            '       Height:        ',A,'  m'/ &
1822            '       Temperature:   ',A,'  K'/ &
1823            '       Gradient:      ',A,'  K/100m'/ &
1824            '       Gridpoint:     ',A)
1825421 FORMAT (/'    Characteristic levels of the initial humidity profile:'// &
1826            '       Height:      ',A,'  m'/ &
1827            '       Humidity:    ',A,'  kg/kg'/ &
1828            '       Gradient:    ',A,'  (kg/kg)/100m'/ &
1829            '       Gridpoint:   ',A)
1830422 FORMAT (/'    Characteristic levels of the initial scalar profile:'// &
1831            '       Height:                  ',A,'  m'/ &
1832            '       Scalar concentration:    ',A,'  kg/m**3'/ &
1833            '       Gradient:                ',A,'  (kg/m**3)/100m'/ &
1834            '       Gridpoint:               ',A)
1835423 FORMAT (/'    Characteristic levels of the geo. wind component ug:'// &
1836            '       Height:      ',A,'  m'/ &
1837            '       ug:          ',A,'  m/s'/ &
1838            '       Gradient:    ',A,'  1/100s'/ &
1839            '       Gridpoint:   ',A)
1840424 FORMAT (/'    Characteristic levels of the geo. wind component vg:'// &
1841            '       Height:      ',A,'  m'/ &
1842            '       vg:          ',A,'  m/s'/ &
1843            '       Gradient:    ',A,'  1/100s'/ &
1844            '       Gridpoint:   ',A)
1845425 FORMAT (/'    Characteristic levels of the initial salinity profile:'// &
1846            '       Height:     ',A,'  m'/ &
1847            '       Salinity:   ',A,'  psu'/ &
1848            '       Gradient:   ',A,'  psu/100m'/ &
1849            '       Gridpoint:  ',A)
1850426 FORMAT (/'    Characteristic levels of the subsidence/ascent profile:'// &
1851            '       Height:      ',A,'  m'/ &
1852            '       w_subs:      ',A,'  m/s'/ &
1853            '       Gradient:    ',A,'  (m/s)/100m'/ &
1854            '       Gridpoint:   ',A)
1855427 FORMAT (/'    Initial wind profiles (u,v) are interpolated from given'// &
1856                  ' profiles')
1857428 FORMAT (/'    Initial profiles (u, v, pt, q) are taken from file '/ &
1858             '    NUDGING_DATA')
1859430 FORMAT (//' Cloud physics quantities / methods:'/ &
1860              ' ----------------------------------'/)
1861431 FORMAT ('    Humidity is considered, bu no condensation')
1862450 FORMAT (//' LES / Turbulence quantities:'/ &
1863              ' ---------------------------'/)
1864451 FORMAT ('    Diffusion coefficients are constant:'/ &
1865            '    Km = ',F6.2,' m**2/s   Kh = ',F6.2,' m**2/s   Pr = ',F5.2)
1866453 FORMAT ('    Mixing length is limited to',F5.2,' * z')
1867454 FORMAT ('    TKE is not allowed to fall below ',E9.2,' (m/s)**2')
1868455 FORMAT ('    initial TKE is prescribed as ',E9.2,' (m/s)**2')
1869456 FORMAT (/'    Date and time at model start : ',A)
1870457 FORMAT ('    RANS-mode constants: c_0 = ',F9.5/         &
1871            '                         c_1 = ',F9.5/         &
1872            '                         c_2 = ',F9.5/         &
1873            '                         c_3 = ',F9.5/         &
1874            '                         c_4 = ',F9.5/         &
1875            '                         sigma_e    = ',F9.5/  &
1876            '                         sigma_diss = ',F9.5)
1877470 FORMAT (//' Actions during the simulation:'/ &
1878              ' -----------------------------'/)
1879471 FORMAT ('    Disturbance impulse (u,v) every :   ',F6.2,' s'/            &
1880            '    Disturbance amplitude           :    ',F5.2, ' m/s'/       &
1881            '    Lower disturbance level         : ',F8.2,' m (GP ',I4,')'/  &
1882            '    Upper disturbance level         : ',F8.2,' m (GP ',I4,')')
1883472 FORMAT ('    Disturbances continued during the run from i/j =',I4, &
1884                 ' to i/j =',I4)
1885473 FORMAT ('    Disturbances cease as soon as the disturbance energy exceeds',&
1886                 F6.3, ' m**2/s**2')
1887474 FORMAT ('    Random number generator used    : ',A/)
1888475 FORMAT ('    The surface temperature is increased (or decreased, ', &
1889                 'respectively, if'/ &
1890            '    the value is negative) by ',F5.2,' K at the beginning of the',&
1891                 ' 3D-simulation'/)
1892476 FORMAT ('    The surface humidity is increased (or decreased, ',&
1893                 'respectively, if the'/ &
1894            '    value is negative) by ',E8.1,' kg/kg at the beginning of', &
1895                 ' the 3D-simulation'/)
1896477 FORMAT ('    The scalar value is increased at the surface (or decreased, ',&
1897                 'respectively, if the'/ &
1898            '    value is negative) by ',E8.1,' kg/m**3 at the beginning of', &
1899                 ' the 3D-simulation'/)
1900500 FORMAT (//' 1D-Model parameters:'/                           &
1901              ' -------------------'//                           &
1902            '    Simulation time:                   ',F8.1,' s'/ &
1903            '    Run-controll output every:         ',F8.1,' s'/ &
1904            '    Vertical profile output every:     ',F8.1,' s'/ &
1905            '    Mixing length calculation:         ',A/         &
1906            '    Dissipation calculation:           ',A/)
1907502 FORMAT ('    Damping layer starts from ',F7.1,' m (GP ',I4,')'/)
1908503 FORMAT (' --> Momentum advection via Wicker-Skamarock-Scheme 5th order')
1909504 FORMAT (' --> Scalar advection via Wicker-Skamarock-Scheme 5th order')
1910512 FORMAT (/' Date:               ',A10,6X,'Run:       ',A34/      &
1911            ' Time:                 ',A8,6X,'Run-No.:   ',I2.2/     &
1912            ' Run on host:        ',A10,6X,'En-No.:    ',I2.2)
1913600 FORMAT (/' Nesting informations:'/ &
1914            ' --------------------'/ &
1915            ' Nesting mode:                     ',A/ &
1916            ' Nesting-datatransfer mode:        ',A// &
1917            ' Nest id  parent  number   lower left coordinates   name'/ &
1918            ' (*=me)     id    of PEs      x (m)     y (m)' )
1919601 FORMAT (2X,A1,1X,I2.2,6X,I2.2,5X,I5,5X,F8.2,2X,F8.2,5X,A)
1920
1921 END SUBROUTINE header
Note: See TracBrowser for help on using the repository browser.