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

Last change on this file since 4180 was 4180, checked in by scharf, 5 years ago

removed comments in 'Former revisions' section that are older than 01.01.2019

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