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

Last change on this file since 4581 was 4573, checked in by oliver.maas, 4 years ago

pt_surface_heating_rate: calculate pt(0) incrementally by using dt_3d instead of calculating it absolutely by using time_since_reference_point, because time_since_reference_point is set to zero for initializing_actions = 'cyclic_fill', add statement for pt_surface_heating_rate in header.f90

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