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

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

In case of turbulent inflow: Adjusted recycling_yshift, so that y-shift can be given as multiples of PE (as in y_shift for cyclic BCs).

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