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

Last change on this file since 102 was 102, checked in by raasch, 17 years ago

preliminary version for coupled runs

  • Property svn:keywords set to Id
File size: 58.2 KB
Line 
1 SUBROUTINE header
2
3!------------------------------------------------------------------------------!
4! Actual revisions:
5! -----------------
6! Output of informations for coupled model runs (boundary conditions etc.)
7!
8! Former revisions:
9! -----------------
10! $Id: header.f90 102 2007-07-27 09:09:17Z raasch $
11!
12! 97 2007-06-21 08:23:15Z raasch
13! Adjustments for the ocean version.
14! use_pt_reference renamed use_reference
15!
16! 87 2007-05-22 15:46:47Z raasch
17! Bugfix: output of use_upstream_for_tke
18!
19! 82 2007-04-16 15:40:52Z raasch
20! Preprocessor strings for different linux clusters changed to "lc",
21! routine local_flush is used for buffer flushing
22!
23! 76 2007-03-29 00:58:32Z raasch
24! Output of netcdf_64bit_3d, particles-package is now part of the default code,
25! output of the loop optimization method, moisture renamed humidity,
26! output of subversion revision number
27!
28! 19 2007-02-23 04:53:48Z raasch
29! Output of scalar flux applied at top boundary
30!
31! RCS Log replace by Id keyword, revision history cleaned up
32!
33! Revision 1.63  2006/08/22 13:53:13  raasch
34! Output of dz_max
35!
36! Revision 1.1  1997/08/11 06:17:20  raasch
37! Initial revision
38!
39!
40! Description:
41! ------------
42! Writing a header with all important informations about the actual run.
43! This subroutine is called three times, two times at the beginning
44! (writing information on files RUN_CONTROL and HEADER) and one time at the
45! end of the run, then writing additional information about CPU-usage on file
46! header.
47!------------------------------------------------------------------------------!
48
49    USE arrays_3d
50    USE control_parameters
51    USE cloud_parameters
52    USE cpulog
53    USE dvrp_variables
54    USE grid_variables
55    USE indices
56    USE model_1d
57    USE particle_attributes
58    USE pegrid
59    USE spectrum
60
61    IMPLICIT NONE
62
63    CHARACTER (LEN=1)  ::  prec
64    CHARACTER (LEN=2)  ::  do2d_mode
65    CHARACTER (LEN=5)  ::  section_chr
66    CHARACTER (LEN=9)  ::  time_to_string
67    CHARACTER (LEN=10) ::  coor_chr, host_chr
68    CHARACTER (LEN=16) ::  begin_chr
69    CHARACTER (LEN=21) ::  ver_rev
70    CHARACTER (LEN=40) ::  output_format
71    CHARACTER (LEN=70) ::  char1, char2, coordinates, gradients, dopr_chr, &
72                           do2d_xy, do2d_xz, do2d_yz, do3d_chr, &
73                           run_classification, slices, temperatures, &
74                           ugcomponent, vgcomponent
75    CHARACTER (LEN=85) ::  roben, runten
76
77    INTEGER ::  av, bh, blx, bly, bxl, bxr, byn, bys, i, ihost, io, j, l, ll
78    REAL    ::  cpuseconds_per_simulated_second
79
80!
81!-- Open the output file. At the end of the simulation, output is directed
82!-- to unit 19.
83    IF ( ( runnr == 0 .OR. force_print_header )  .AND. &
84         .NOT. simulated_time_at_begin /= simulated_time )  THEN
85       io = 15   !  header output on file RUN_CONTROL
86    ELSE
87       io = 19   !  header output on file HEADER
88    ENDIF
89    CALL check_open( io )
90
91!
92!-- At the end of the run, output file (HEADER) will be rewritten with
93!-- new informations
94    IF ( io == 19 .AND. simulated_time_at_begin /= simulated_time ) REWIND( 19 )
95
96!
97!-- Determine kind of model run
98    IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
99       run_classification = '3D - restart run'
100    ELSE
101       IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 )  THEN
102          run_classification = '3D - run without 1D - prerun'
103       ELSEIF ( INDEX(initializing_actions, 'set_1d-model_profiles') /= 0 ) THEN
104          run_classification = '3D - run with 1D - prerun'
105       ELSE
106          PRINT*,'+++ header:  unknown action(s): ',initializing_actions
107       ENDIF
108    ENDIF
109    IF ( ocean )  THEN
110       run_classification = 'ocean - ' // run_classification
111    ELSE
112       run_classification = 'atmosphere - ' // run_classification
113    ENDIF
114
115!
116!-- Run-identification, date, time, host
117    host_chr = host(1:10)
118    ver_rev = TRIM( version ) // '  ' // TRIM( revision )
119    WRITE ( io, 100 )  ver_rev, TRIM( run_classification )
120    IF ( coupling_mode /= 'uncoupled' )  WRITE ( io, 101 )  coupling_mode
121    WRITE ( io, 102 )  run_date, run_identifier, run_time, runnr, &
122                       ADJUSTR( host_chr )
123#if defined( __parallel )
124    IF ( npex == -1  .AND.  pdims(2) /= 1 )  THEN
125       char1 = 'calculated'
126    ELSEIF ( ( host(1:3) == 'ibm'  .OR.  host(1:3) == 'nec'  .OR.  &
127               host(1:2) == 'lc' )  .AND.                          &
128             npex == -1  .AND.  pdims(2) == 1 )  THEN
129       char1 = 'forced'
130    ELSE
131       char1 = 'predefined'
132    ENDIF
133    IF ( threads_per_task == 1 )  THEN
134       WRITE ( io, 103 )  numprocs, pdims(1), pdims(2), TRIM( char1 )
135    ELSE
136       WRITE ( io, 104 )  numprocs*threads_per_task, numprocs, &
137                          threads_per_task, pdims(1), pdims(2), TRIM( char1 )
138    ENDIF
139    IF ( ( host(1:3) == 'ibm'  .OR.  host(1:3) == 'nec'  .OR.    &
140           host(1:2) == 'lc'   .OR.  host(1:3) == 'dec' )  .AND. &
141         npex == -1  .AND.  pdims(2) == 1 )                      &
142    THEN
143       WRITE ( io, 106 )
144    ELSEIF ( pdims(2) == 1 )  THEN
145       WRITE ( io, 107 )  'x'
146    ELSEIF ( pdims(1) == 1 )  THEN
147       WRITE ( io, 107 )  'y'
148    ENDIF
149    IF ( use_seperate_pe_for_dvrp_output )  WRITE ( io, 105 )
150#endif
151    WRITE ( io, 99 )
152
153!
154!-- Numerical schemes
155    WRITE ( io, 110 )
156    IF ( psolver(1:7) == 'poisfft' )  THEN
157       WRITE ( io, 111 )  TRIM( fft_method )
158       IF ( psolver == 'poisfft_hybrid' )  WRITE ( io, 138 )
159    ELSEIF ( psolver == 'sor' )  THEN
160       WRITE ( io, 112 )  nsor_ini, nsor, omega_sor
161    ELSEIF ( psolver == 'multigrid' )  THEN
162       WRITE ( io, 135 )  cycle_mg, maximum_grid_level, ngsrb
163       IF ( mg_cycles == -1 )  THEN
164          WRITE ( io, 140 )  residual_limit
165       ELSE
166          WRITE ( io, 141 )  mg_cycles
167       ENDIF
168       IF ( mg_switch_to_pe0_level == 0 )  THEN
169          WRITE ( io, 136 )  nxr_mg(1)-nxl_mg(1)+1, nyn_mg(1)-nys_mg(1)+1, &
170                             nzt_mg(1)
171       ELSE
172          WRITE ( io, 137 )  mg_switch_to_pe0_level,            &
173                             mg_loc_ind(2,0)-mg_loc_ind(1,0)+1, &
174                             mg_loc_ind(4,0)-mg_loc_ind(3,0)+1, &
175                             nzt_mg(mg_switch_to_pe0_level),    &
176                             nxr_mg(1)-nxl_mg(1)+1, nyn_mg(1)-nys_mg(1)+1, &
177                             nzt_mg(1)
178       ENDIF
179    ENDIF
180    IF ( call_psolver_at_all_substeps  .AND. timestep_scheme(1:5) == 'runge' ) &
181    THEN
182       WRITE ( io, 142 )
183    ENDIF
184
185    IF ( momentum_advec == 'pw-scheme' )  THEN
186       WRITE ( io, 113 )
187    ELSE
188       WRITE ( io, 114 )
189       IF ( cut_spline_overshoot )  WRITE ( io, 124 )
190       IF ( overshoot_limit_u /= 0.0  .OR.  overshoot_limit_v /= 0.0  .OR. &
191            overshoot_limit_w /= 0.0 )  THEN
192          WRITE ( io, 127 )  overshoot_limit_u, overshoot_limit_v, &
193                             overshoot_limit_w
194       ENDIF
195       IF ( ups_limit_u /= 0.0  .OR.  ups_limit_v /= 0.0  .OR. &
196            ups_limit_w /= 0.0 )                               &
197       THEN
198          WRITE ( io, 125 )  ups_limit_u, ups_limit_v, ups_limit_w
199       ENDIF
200       IF ( long_filter_factor /= 0.0 )  WRITE ( io, 115 )  long_filter_factor
201    ENDIF
202    IF ( scalar_advec == 'pw-scheme' )  THEN
203       WRITE ( io, 116 )
204    ELSEIF ( scalar_advec == 'ups-scheme' )  THEN
205       WRITE ( io, 117 )
206       IF ( cut_spline_overshoot )  WRITE ( io, 124 )
207       IF ( overshoot_limit_e /= 0.0  .OR.  overshoot_limit_pt /= 0.0 )  THEN
208          WRITE ( io, 128 )  overshoot_limit_e, overshoot_limit_pt
209       ENDIF
210       IF ( ups_limit_e /= 0.0  .OR.  ups_limit_pt /= 0.0 )  THEN
211          WRITE ( io, 126 )  ups_limit_e, ups_limit_pt
212       ENDIF
213    ELSE
214       WRITE ( io, 118 )
215    ENDIF
216
217    WRITE ( io, 139 )  TRIM( loop_optimization )
218
219    IF ( galilei_transformation )  THEN
220       IF ( use_ug_for_galilei_tr )  THEN
221          char1 = 'geostrophic wind'
222       ELSE
223          char1 = 'mean wind in model domain'
224       ENDIF
225       IF ( simulated_time_at_begin == simulated_time )  THEN
226          char2 = 'at the start of the run'
227       ELSE
228          char2 = 'at the end of the run'
229       ENDIF
230       WRITE ( io, 119 )  TRIM( char1 ), TRIM( char2 ), &
231                          advected_distance_x/1000.0, advected_distance_y/1000.0
232    ENDIF
233    IF ( timestep_scheme == 'leapfrog' )  THEN
234       WRITE ( io, 120 )
235    ELSEIF ( timestep_scheme == 'leapfrog+euler' )  THEN
236       WRITE ( io, 121 )
237    ELSE
238       WRITE ( io, 122 )  timestep_scheme
239    ENDIF
240    IF ( use_upstream_for_tke )  WRITE ( io, 143 )
241    IF ( rayleigh_damping_factor /= 0.0 )  THEN
242       WRITE ( io, 123 )  rayleigh_damping_height, rayleigh_damping_factor
243    ENDIF
244    IF ( humidity )  THEN
245       IF ( .NOT. cloud_physics )  THEN
246          WRITE ( io, 129 )
247       ELSE
248          WRITE ( io, 130 )
249          WRITE ( io, 131 )
250          IF ( radiation )      WRITE ( io, 132 )
251          IF ( precipitation )  WRITE ( io, 133 )
252       ENDIF
253    ENDIF
254    IF ( passive_scalar )  WRITE ( io, 134 )
255    IF ( conserve_volume_flow )  WRITE ( io, 150 )
256    WRITE ( io, 99 )
257
258!
259!-- Runtime and timestep informations
260    WRITE ( io, 200 )
261    IF ( .NOT. dt_fixed )  THEN
262       WRITE ( io, 201 )  dt_max, cfl_factor
263    ELSE
264       WRITE ( io, 202 )  dt
265    ENDIF
266    WRITE ( io, 203 )  simulated_time_at_begin, end_time
267
268    IF ( time_restart /= 9999999.9  .AND. &
269         simulated_time_at_begin == simulated_time )  THEN
270       IF ( dt_restart == 9999999.9 )  THEN
271          WRITE ( io, 204 )  ' Restart at:       ',time_restart
272       ELSE
273          WRITE ( io, 205 )  ' Restart at:       ',time_restart, dt_restart
274       ENDIF
275    ENDIF
276
277    IF ( simulated_time_at_begin /= simulated_time )  THEN
278       i = MAX ( log_point_s(10)%counts, 1 )
279       IF ( ( simulated_time - simulated_time_at_begin ) == 0.0 )  THEN
280          cpuseconds_per_simulated_second = 0.0
281       ELSE
282          cpuseconds_per_simulated_second = log_point_s(10)%sum / &
283                                            ( simulated_time -    &
284                                              simulated_time_at_begin )
285       ENDIF
286       WRITE ( io, 206 )  simulated_time, log_point_s(10)%sum, &
287                          log_point_s(10)%sum / REAL( i ),     &
288                          cpuseconds_per_simulated_second
289       IF ( time_restart /= 9999999.9  .AND.  time_restart < end_time )  THEN
290          IF ( dt_restart == 9999999.9 )  THEN
291             WRITE ( io, 204 )  ' Next restart at:  ',time_restart
292          ELSE
293             WRITE ( io, 205 )  ' Next restart at:  ',time_restart, dt_restart
294          ENDIF
295       ENDIF
296    ENDIF
297
298!
299!-- Computational grid
300    IF ( .NOT. ocean )  THEN
301       WRITE ( io, 250 )  dx, dy, dz, (nx+1)*dx, (ny+1)*dy, zu(nzt+1)
302       IF ( dz_stretch_level_index < nzt+1 )  THEN
303          WRITE ( io, 252 )  dz_stretch_level, dz_stretch_level_index, &
304                             dz_stretch_factor, dz_max
305       ENDIF
306    ELSE
307       WRITE ( io, 250 )  dx, dy, dz, (nx+1)*dx, (ny+1)*dy, zu(0)
308       IF ( dz_stretch_level_index > 0 )  THEN
309          WRITE ( io, 252 )  dz_stretch_level, dz_stretch_level_index, &
310                             dz_stretch_factor, dz_max
311       ENDIF
312    ENDIF
313    WRITE ( io, 254 )  nx, ny, nzt+1, MIN( nnx, nx+1 ), MIN( nny, ny+1 ), &
314                       MIN( nnz+2, nzt+2 )
315    IF ( numprocs > 1 )  THEN
316       IF ( nxa == nx  .AND.  nya == ny  .AND.  nza == nz )  THEN
317          WRITE ( io, 255 )
318       ELSE
319          WRITE ( io, 256 )  nnx-(nxa-nx), nny-(nya-ny), nzt+2
320       ENDIF
321    ENDIF
322    IF ( sloping_surface )  WRITE ( io, 260 )  alpha_surface
323
324!
325!-- Topography
326    WRITE ( io, 270 )  topography
327    SELECT CASE ( TRIM( topography ) )
328
329       CASE ( 'flat' )
330          ! no actions necessary
331
332       CASE ( 'single_building' )
333          blx = INT( building_length_x / dx )
334          bly = INT( building_length_y / dy )
335          bh  = INT( building_height / dz )
336
337          IF ( building_wall_left == 9999999.9 )  THEN
338             building_wall_left = ( nx + 1 - blx ) / 2 * dx
339          ENDIF
340          bxl = INT ( building_wall_left / dx + 0.5 )
341          bxr = bxl + blx
342
343          IF ( building_wall_south == 9999999.9 )  THEN
344             building_wall_south = ( ny + 1 - bly ) / 2 * dy
345          ENDIF
346          bys = INT ( building_wall_south / dy + 0.5 )
347          byn = bys + bly
348
349          WRITE ( io, 271 )  building_length_x, building_length_y, &
350                             building_height, bxl, bxr, bys, byn
351
352    END SELECT
353
354!
355!-- Boundary conditions
356    IF ( ibc_p_b == 0 )  THEN
357       runten = 'p(0)     = 0      |'
358    ELSEIF ( ibc_p_b == 1 )  THEN
359       runten = 'p(0)     = p(1)   |'
360    ELSE
361       runten = 'p(0)     = p(1) +R|'
362    ENDIF
363    IF ( ibc_p_t == 0 )  THEN
364       roben  = 'p(nzt+1) = 0      |'
365    ELSE
366       roben  = 'p(nzt+1) = p(nzt) |'
367    ENDIF
368
369    IF ( ibc_uv_b == 0 )  THEN
370       runten = TRIM( runten ) // ' uv(0)     = -uv(1)                |'
371    ELSE
372       runten = TRIM( runten ) // ' uv(0)     = uv(1)                 |'
373    ENDIF
374    IF ( ibc_uv_t == 0 )  THEN
375       roben  = TRIM( roben  ) // ' uv(nzt+1) = ug(nzt+1), vg(nzt+1)  |'
376    ELSE
377       roben  = TRIM( roben  ) // ' uv(nzt+1) = uv(nzt)               |'
378    ENDIF
379
380    IF ( ibc_pt_b == 0 )  THEN
381       runten = TRIM( runten ) // ' pt(0)   = pt_surface'
382    ELSEIF ( ibc_pt_b == 1 )  THEN
383       runten = TRIM( runten ) // ' pt(0)   = pt(1)'
384    ELSEIF ( ibc_pt_b == 2 )  THEN
385       runten = TRIM( runten ) // ' pt(0) = from coupled model'
386    ENDIF
387    IF ( ibc_pt_t == 0 )  THEN
388       roben  = TRIM( roben  ) // ' pt(nzt+1) = pt_top'
389    ELSEIF( ibc_pt_t == 1 )  THEN
390       roben  = TRIM( roben  ) // ' pt(nzt+1) = pt(nzt)'
391    ELSEIF( ibc_pt_t == 2 )  THEN
392       roben  = TRIM( roben  ) // ' pt(nzt+1) = pt(nzt) + dpt/dz_ini'
393    ENDIF
394
395    WRITE ( io, 300 )  runten, roben
396
397    IF ( .NOT. constant_diffusion )  THEN
398       IF ( ibc_e_b == 1 )  THEN
399          runten = 'e(0)     = e(1)'
400       ELSE
401          runten = 'e(0)     = e(1) = (u*/0.1)**2'
402       ENDIF
403       roben = 'e(nzt+1) = e(nzt) = e(nzt-1)'
404
405       WRITE ( io, 301 )  'e', runten, roben       
406
407    ENDIF
408
409    IF ( ocean )  THEN
410       runten = 'sa(0)    = sa(1)'
411       IF ( ibc_sa_t == 0 )  THEN
412          roben =  'sa(nzt+1) = sa_surface'
413       ELSE
414          roben =  'sa(nzt+1) = sa(nzt)'
415       ENDIF
416       WRITE ( io, 301 ) 'sa', runten, roben
417    ENDIF
418
419    IF ( humidity )  THEN
420       IF ( ibc_q_b == 0 )  THEN
421          runten = 'q(0)     = q_surface'
422       ELSE
423          runten = 'q(0)     = q(1)'
424       ENDIF
425       IF ( ibc_q_t == 0 )  THEN
426          roben =  'q(nzt)   = q_top'
427       ELSE
428          roben =  'q(nzt)   = q(nzt-1) + dq/dz'
429       ENDIF
430       WRITE ( io, 301 ) 'q', runten, roben
431    ENDIF
432
433    IF ( passive_scalar )  THEN
434       IF ( ibc_q_b == 0 )  THEN
435          runten = 's(0)     = s_surface'
436       ELSE
437          runten = 's(0)     = s(1)'
438       ENDIF
439       IF ( ibc_q_t == 0 )  THEN
440          roben =  's(nzt)   = s_top'
441       ELSE
442          roben =  's(nzt)   = s(nzt-1) + ds/dz'
443       ENDIF
444       WRITE ( io, 301 ) 's', runten, roben
445    ENDIF
446
447    IF ( use_surface_fluxes )  THEN
448       WRITE ( io, 303 )
449       IF ( constant_heatflux )  THEN
450          WRITE ( io, 306 )  surface_heatflux
451          IF ( random_heatflux )  WRITE ( io, 307 )
452       ENDIF
453       IF ( humidity  .AND.  constant_waterflux )  THEN
454          WRITE ( io, 311 ) surface_waterflux
455       ENDIF
456       IF ( passive_scalar  .AND.  constant_waterflux )  THEN
457          WRITE ( io, 313 ) surface_waterflux
458       ENDIF
459    ENDIF
460
461    IF ( use_top_fluxes )  THEN
462       WRITE ( io, 304 )
463       IF ( coupling_mode == 'uncoupled' )  THEN
464          IF ( constant_top_heatflux )  THEN
465             WRITE ( io, 306 )  top_heatflux
466          ENDIF
467       ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
468          WRITE ( io, 316 )
469       ENDIF
470       IF ( ocean  .AND.  constant_top_salinityflux )  THEN
471          WRITE ( io, 309 )  top_salinityflux
472       ENDIF
473       IF ( humidity  .OR.  passive_scalar )  THEN
474          WRITE ( io, 315 )
475       ENDIF
476    ENDIF
477
478    IF ( prandtl_layer )  THEN
479       WRITE ( io, 305 )  0.5 * (zu(1)-zu(0)), roughness_length, kappa, &
480                          rif_min, rif_max
481       IF ( .NOT. constant_heatflux )  WRITE ( io, 308 )
482       IF ( humidity  .AND.  .NOT. constant_waterflux )  THEN
483          WRITE ( io, 312 )
484       ENDIF
485       IF ( passive_scalar  .AND.  .NOT. constant_waterflux )  THEN
486          WRITE ( io, 314 )
487       ENDIF
488    ELSE
489       IF ( INDEX(initializing_actions, 'set_1d-model_profiles') /= 0 )  THEN
490          WRITE ( io, 310 )  rif_min, rif_max
491       ENDIF
492    ENDIF
493
494    WRITE ( io, 317 )  bc_lr, bc_ns
495    IF ( bc_lr /= 'cyclic'  .OR.  bc_ns /= 'cyclic' )  THEN
496       WRITE ( io, 318 )  outflow_damping_width, km_damp_max
497    ENDIF
498
499!
500!-- Listing of 1D-profiles
501    WRITE ( io, 320 )  dt_dopr_listing
502    IF ( averaging_interval_pr /= 0.0 )  THEN
503       WRITE ( io, 321 )  averaging_interval_pr, dt_averaging_input_pr
504    ENDIF
505
506!
507!-- DATA output
508    WRITE ( io, 330 )
509    IF ( averaging_interval_pr /= 0.0 )  THEN
510       WRITE ( io, 321 )  averaging_interval_pr, dt_averaging_input_pr
511    ENDIF
512
513!
514!-- 1D-profiles
515    dopr_chr = 'Profile:'
516    IF ( dopr_n /= 0 )  THEN
517       WRITE ( io, 331 )
518
519       output_format = ''
520       IF ( netcdf_output )  THEN
521          IF ( netcdf_64bit )  THEN
522             output_format = 'netcdf (64 bit offset)'
523          ELSE
524             output_format = 'netcdf'
525          ENDIF
526       ENDIF
527       IF ( profil_output )  THEN
528          IF ( netcdf_output )  THEN
529             output_format = TRIM( output_format ) // ' and profil'
530          ELSE
531             output_format = 'profil'
532          ENDIF
533       ENDIF
534       WRITE ( io, 345 )  output_format
535
536       DO  i = 1, dopr_n
537          dopr_chr = TRIM( dopr_chr ) // ' ' // TRIM( data_output_pr(i) ) // ','
538          IF ( LEN_TRIM( dopr_chr ) >= 60 )  THEN
539             WRITE ( io, 332 )  dopr_chr
540             dopr_chr = '       :'
541          ENDIF
542       ENDDO
543
544       IF ( dopr_chr /= '' )  THEN
545          WRITE ( io, 332 )  dopr_chr
546       ENDIF
547       WRITE ( io, 333 )  dt_dopr, averaging_interval_pr, dt_averaging_input_pr
548       IF ( skip_time_dopr /= 0.0 )  WRITE ( io, 339 )  skip_time_dopr
549    ENDIF
550
551!
552!-- 2D-arrays
553    DO  av = 0, 1
554
555       i = 1
556       do2d_xy = ''
557       do2d_xz = ''
558       do2d_yz = ''
559       DO  WHILE ( do2d(av,i) /= ' ' )
560
561          l = MAX( 2, LEN_TRIM( do2d(av,i) ) )
562          do2d_mode = do2d(av,i)(l-1:l)
563
564          SELECT CASE ( do2d_mode )
565             CASE ( 'xy' )
566                ll = LEN_TRIM( do2d_xy )
567                do2d_xy = do2d_xy(1:ll) // ' ' // do2d(av,i)(1:l-3) // ','
568             CASE ( 'xz' )
569                ll = LEN_TRIM( do2d_xz )
570                do2d_xz = do2d_xz(1:ll) // ' ' // do2d(av,i)(1:l-3) // ','
571             CASE ( 'yz' )
572                ll = LEN_TRIM( do2d_yz )
573                do2d_yz = do2d_yz(1:ll) // ' ' // do2d(av,i)(1:l-3) // ','
574          END SELECT
575
576          i = i + 1
577
578       ENDDO
579
580       IF ( ( ( do2d_xy /= ''  .AND.  section(1,1) /= -9999 )  .OR.    &
581              ( do2d_xz /= ''  .AND.  section(1,2) /= -9999 )  .OR.    &
582              ( do2d_yz /= ''  .AND.  section(1,3) /= -9999 ) )  .AND. &
583            ( netcdf_output  .OR.  iso2d_output ) )  THEN
584
585          IF (  av == 0 )  THEN
586             WRITE ( io, 334 )  ''
587          ELSE
588             WRITE ( io, 334 )  '(time-averaged)'
589          ENDIF
590
591          IF ( do2d_at_begin )  THEN
592             begin_chr = 'and at the start'
593          ELSE
594             begin_chr = ''
595          ENDIF
596
597          output_format = ''
598          IF ( netcdf_output )  THEN
599             IF ( netcdf_64bit )  THEN
600                output_format = 'netcdf (64 bit offset)'
601             ELSE
602                output_format = 'netcdf'
603             ENDIF
604          ENDIF
605          IF ( iso2d_output )  THEN
606             IF ( netcdf_output )  THEN
607                output_format = TRIM( output_format ) // ' and iso2d'
608             ELSE
609                output_format = 'iso2d'
610             ENDIF
611          ENDIF
612          WRITE ( io, 345 )  output_format
613
614          IF ( do2d_xy /= ''  .AND.  section(1,1) /= -9999 )  THEN
615             i = 1
616             slices = '/'
617             coordinates = '/'
618!
619!--          Building strings with index and coordinate informations of the
620!--          slices
621             DO  WHILE ( section(i,1) /= -9999 )
622
623                WRITE (section_chr,'(I5)')  section(i,1)
624                section_chr = ADJUSTL( section_chr )
625                slices = TRIM( slices ) // TRIM( section_chr ) // '/'
626
627                WRITE (coor_chr,'(F10.1)')  zu(section(i,1))
628                coor_chr = ADJUSTL( coor_chr )
629                coordinates = TRIM( coordinates ) // TRIM( coor_chr ) // '/'
630
631                i = i + 1
632             ENDDO
633             IF ( av == 0 )  THEN
634                WRITE ( io, 335 )  'XY', do2d_xy, dt_do2d_xy, &
635                                   TRIM( begin_chr ), 'k', TRIM( slices ), &
636                                   TRIM( coordinates )
637                IF ( skip_time_do2d_xy /= 0.0 )  THEN
638                   WRITE ( io, 339 )  skip_time_do2d_xy
639                ENDIF
640             ELSE
641                WRITE ( io, 342 )  'XY', do2d_xy, dt_data_output_av, &
642                                   TRIM( begin_chr ), averaging_interval, &
643                                   dt_averaging_input, 'k', TRIM( slices ), &
644                                   TRIM( coordinates )
645                IF ( skip_time_data_output_av /= 0.0 )  THEN
646                   WRITE ( io, 339 )  skip_time_data_output_av
647                ENDIF
648             ENDIF
649
650          ENDIF
651
652          IF ( do2d_xz /= ''  .AND.  section(1,2) /= -9999 )  THEN
653             i = 1
654             slices = '/'
655             coordinates = '/'
656!
657!--          Building strings with index and coordinate informations of the
658!--          slices
659             DO  WHILE ( section(i,2) /= -9999 )
660
661                WRITE (section_chr,'(I5)')  section(i,2)
662                section_chr = ADJUSTL( section_chr )
663                slices = TRIM( slices ) // TRIM( section_chr ) // '/'
664
665                WRITE (coor_chr,'(F10.1)')  section(i,2) * dy
666                coor_chr = ADJUSTL( coor_chr )
667                coordinates = TRIM( coordinates ) // TRIM( coor_chr ) // '/'
668
669                i = i + 1
670             ENDDO
671             IF ( av == 0 )  THEN
672                WRITE ( io, 335 )  'XZ', do2d_xz, dt_do2d_xz, &
673                                   TRIM( begin_chr ), 'j', TRIM( slices ), &
674                                   TRIM( coordinates )
675                IF ( skip_time_do2d_xz /= 0.0 )  THEN
676                   WRITE ( io, 339 )  skip_time_do2d_xz
677                ENDIF
678             ELSE
679                WRITE ( io, 342 )  'XZ', do2d_xz, dt_data_output_av, &
680                                   TRIM( begin_chr ), averaging_interval, &
681                                   dt_averaging_input, 'j', TRIM( slices ), &
682                                   TRIM( coordinates )
683                IF ( skip_time_data_output_av /= 0.0 )  THEN
684                   WRITE ( io, 339 )  skip_time_data_output_av
685                ENDIF
686             ENDIF
687          ENDIF
688
689          IF ( do2d_yz /= ''  .AND.  section(1,3) /= -9999 )  THEN
690             i = 1
691             slices = '/'
692             coordinates = '/'
693!
694!--          Building strings with index and coordinate informations of the
695!--          slices
696             DO  WHILE ( section(i,3) /= -9999 )
697
698                WRITE (section_chr,'(I5)')  section(i,3)
699                section_chr = ADJUSTL( section_chr )
700                slices = TRIM( slices ) // TRIM( section_chr ) // '/'
701
702                WRITE (coor_chr,'(F10.1)')  section(i,3) * dx
703                coor_chr = ADJUSTL( coor_chr )
704                coordinates = TRIM( coordinates ) // TRIM( coor_chr ) // '/'
705
706                i = i + 1
707             ENDDO
708             IF ( av == 0 )  THEN
709                WRITE ( io, 335 )  'YZ', do2d_yz, dt_do2d_yz, &
710                                   TRIM( begin_chr ), 'i', TRIM( slices ), &
711                                   TRIM( coordinates )
712                IF ( skip_time_do2d_yz /= 0.0 )  THEN
713                   WRITE ( io, 339 )  skip_time_do2d_yz
714                ENDIF
715             ELSE
716                WRITE ( io, 342 )  'YZ', do2d_yz, dt_data_output_av, &
717                                   TRIM( begin_chr ), averaging_interval, &
718                                   dt_averaging_input, 'i', TRIM( slices ), &
719                                   TRIM( coordinates )
720                IF ( skip_time_data_output_av /= 0.0 )  THEN
721                   WRITE ( io, 339 )  skip_time_data_output_av
722                ENDIF
723             ENDIF
724          ENDIF
725
726       ENDIF
727
728    ENDDO
729
730!
731!-- 3d-arrays
732    DO  av = 0, 1
733
734       i = 1
735       do3d_chr = ''
736       DO  WHILE ( do3d(av,i) /= ' ' )
737
738          do3d_chr = TRIM( do3d_chr ) // ' ' // TRIM( do3d(av,i) ) // ','
739          i = i + 1
740
741       ENDDO
742
743       IF ( do3d_chr /= '' )  THEN
744          IF ( av == 0 )  THEN
745             WRITE ( io, 336 )  ''
746          ELSE
747             WRITE ( io, 336 )  '(time-averaged)'
748          ENDIF
749
750          output_format = ''
751          IF ( netcdf_output )  THEN
752             IF ( netcdf_64bit .AND. netcdf_64bit_3d )  THEN
753                output_format = 'netcdf (64 bit offset)'
754             ELSE
755                output_format = 'netcdf'
756             ENDIF
757          ENDIF
758          IF ( avs_output )  THEN
759             IF ( netcdf_output )  THEN
760                output_format = TRIM( output_format ) // ' and avs'
761             ELSE
762                output_format = 'avs'
763             ENDIF
764          ENDIF
765          WRITE ( io, 345 )  output_format
766
767          IF ( do3d_at_begin )  THEN
768             begin_chr = 'and at the start'
769          ELSE
770             begin_chr = ''
771          ENDIF
772          IF ( av == 0 )  THEN
773             WRITE ( io, 337 )  do3d_chr, dt_do3d, TRIM( begin_chr ), &
774                                zu(nz_do3d), nz_do3d
775          ELSE
776             WRITE ( io, 343 )  do3d_chr, dt_data_output_av,           &
777                                TRIM( begin_chr ), averaging_interval, &
778                                dt_averaging_input, zu(nz_do3d), nz_do3d
779          ENDIF
780
781          IF ( do3d_compress )  THEN
782             do3d_chr = ''
783             i = 1
784             DO WHILE ( do3d(av,i) /= ' ' )
785
786                SELECT CASE ( do3d(av,i) )
787                   CASE ( 'u' )
788                      j = 1
789                   CASE ( 'v' )
790                      j = 2
791                   CASE ( 'w' )
792                      j = 3
793                   CASE ( 'p' )
794                      j = 4
795                   CASE ( 'pt' )
796                      j = 5
797                END SELECT
798                WRITE ( prec, '(I1)' )  plot_3d_precision(j)%precision
799                do3d_chr = TRIM( do3d_chr ) // ' ' // TRIM( do3d(av,i) ) // &
800                           ':' // prec // ','
801                i = i + 1
802
803             ENDDO
804             WRITE ( io, 338 )  do3d_chr
805
806          ENDIF
807
808          IF ( av == 0 )  THEN
809             IF ( skip_time_do3d /= 0.0 )  THEN
810                WRITE ( io, 339 )  skip_time_do3d
811             ENDIF
812          ELSE
813             IF ( skip_time_data_output_av /= 0.0 )  THEN
814                WRITE ( io, 339 )  skip_time_data_output_av
815             ENDIF
816          ENDIF
817
818       ENDIF
819
820    ENDDO
821
822!
823!-- Timeseries
824    IF ( dt_dots /= 9999999.9 )  THEN
825       WRITE ( io, 340 )
826
827       output_format = ''
828       IF ( netcdf_output )  THEN
829          IF ( netcdf_64bit )  THEN
830             output_format = 'netcdf (64 bit offset)'
831          ELSE
832             output_format = 'netcdf'
833          ENDIF
834       ENDIF
835       IF ( profil_output )  THEN
836          IF ( netcdf_output )  THEN
837             output_format = TRIM( output_format ) // ' and profil'
838          ELSE
839             output_format = 'profil'
840          ENDIF
841       ENDIF
842       WRITE ( io, 345 )  output_format
843       WRITE ( io, 341 )  dt_dots
844    ENDIF
845
846#if defined( __dvrp_graphics )
847!
848!-- Dvrp-output
849    IF ( dt_dvrp /= 9999999.9 )  THEN
850       WRITE ( io, 360 )  dt_dvrp, TRIM( dvrp_output ), TRIM( dvrp_host ), &
851                          TRIM( dvrp_username ), TRIM( dvrp_directory )
852       i = 1
853       l = 0
854       DO WHILE ( mode_dvrp(i) /= ' ' )
855          IF ( mode_dvrp(i)(1:10) == 'isosurface' )  THEN
856             READ ( mode_dvrp(i), '(10X,I1)' )  j
857             l = l + 1
858             IF ( do3d(0,j) /= ' ' )  THEN
859                WRITE ( io, 361 )  TRIM( do3d(0,j) ), threshold(l)
860             ENDIF
861          ELSEIF ( mode_dvrp(i)(1:6) == 'slicer' )  THEN
862             READ ( mode_dvrp(i), '(6X,I1)' )  j
863             IF ( do2d(0,j) /= ' ' )  WRITE ( io, 362 )  TRIM( do2d(0,j) )
864          ELSEIF ( mode_dvrp(i)(1:9) == 'particles' )  THEN
865             WRITE ( io, 363 )
866          ENDIF
867          i = i + 1
868       ENDDO
869    ENDIF
870#endif
871
872#if defined( __spectra )
873!
874!-- Spectra output
875    IF ( dt_dosp /= 9999999.9 ) THEN
876       WRITE ( io, 370 )
877
878       output_format = ''
879       IF ( netcdf_output )  THEN
880          IF ( netcdf_64bit )  THEN
881             output_format = 'netcdf (64 bit offset)'
882          ELSE
883             output_format = 'netcdf'
884          ENDIF
885       ENDIF
886       IF ( profil_output )  THEN
887          IF ( netcdf_output )  THEN
888             output_format = TRIM( output_format ) // ' and profil'
889          ELSE
890             output_format = 'profil'
891          ENDIF
892       ENDIF
893       WRITE ( io, 345 )  output_format
894       WRITE ( io, 371 )  dt_dosp
895       IF ( skip_time_dosp /= 0.0 )  WRITE ( io, 339 )  skip_time_dosp
896       WRITE ( io, 372 )  ( data_output_sp(i), i = 1,10 ),     &
897                          ( spectra_direction(i), i = 1,10 ),  &
898                          ( comp_spectra_level(i), i = 1,10 ), &
899                          ( plot_spectra_level(i), i = 1,10 ), &
900                          averaging_interval_sp, dt_averaging_input_pr
901    ENDIF
902#endif
903
904    WRITE ( io, 99 )
905
906!
907!-- Physical quantities
908    WRITE ( io, 400 )
909
910!
911!-- Geostrophic parameters
912    WRITE ( io, 410 )  omega, phi, f, fs
913
914!
915!-- Other quantities
916    WRITE ( io, 411 )  g
917    IF ( use_reference )  THEN
918       IF ( ocean )  THEN
919          WRITE ( io, 412 )  prho_reference
920       ELSE
921          WRITE ( io, 413 )  pt_reference
922       ENDIF
923    ENDIF
924
925!
926!-- Cloud physics parameters
927    IF ( cloud_physics ) THEN
928       WRITE ( io, 415 )
929       WRITE ( io, 416 ) surface_pressure, r_d, rho_surface, cp, l_v
930    ENDIF
931
932!-- Profile of the geostrophic wind (component ug)
933!-- Building output strings
934    WRITE ( ugcomponent, '(F6.2)' )  ug_surface
935    gradients = '------'
936    slices = '     0'
937    coordinates = '   0.0'
938    i = 1
939    DO  WHILE ( ug_vertical_gradient_level_ind(i) /= -9999 )
940     
941       WRITE (coor_chr,'(F6.2,4X)')  ug(ug_vertical_gradient_level_ind(i))
942       ugcomponent = TRIM( ugcomponent ) // '  ' // TRIM( coor_chr )
943
944       WRITE (coor_chr,'(F6.2,4X)')  ug_vertical_gradient(i)
945       gradients = TRIM( gradients ) // '  ' // TRIM( coor_chr )
946
947       WRITE (coor_chr,'(I6,4X)')  ug_vertical_gradient_level_ind(i)
948       slices = TRIM( slices ) // '  ' // TRIM( coor_chr )
949
950       WRITE (coor_chr,'(F6.1,4X)')  ug_vertical_gradient_level(i)
951       coordinates = TRIM( coordinates ) // '  ' // TRIM( coor_chr )
952
953       i = i + 1
954    ENDDO
955
956    WRITE ( io, 423 )  TRIM( coordinates ), TRIM( ugcomponent ), &
957                       TRIM( gradients ), TRIM( slices )
958
959!-- Profile of the geostrophic wind (component vg)
960!-- Building output strings
961    WRITE ( vgcomponent, '(F6.2)' )  vg_surface
962    gradients = '------'
963    slices = '     0'
964    coordinates = '   0.0'
965    i = 1
966    DO  WHILE ( vg_vertical_gradient_level_ind(i) /= -9999 )
967
968       WRITE (coor_chr,'(F6.2,4X)')  vg(vg_vertical_gradient_level_ind(i))
969       vgcomponent = TRIM( vgcomponent ) // '  ' // TRIM( coor_chr )
970
971       WRITE (coor_chr,'(F6.2,4X)')  vg_vertical_gradient(i)
972       gradients = TRIM( gradients ) // '  ' // TRIM( coor_chr )
973
974       WRITE (coor_chr,'(I6,4X)')  vg_vertical_gradient_level_ind(i)
975       slices = TRIM( slices ) // '  ' // TRIM( coor_chr )
976
977       WRITE (coor_chr,'(F6.1,4X)')  vg_vertical_gradient_level(i)
978       coordinates = TRIM( coordinates ) // '  ' // TRIM( coor_chr )
979
980       i = i + 1 
981    ENDDO
982
983    WRITE ( io, 424 )  TRIM( coordinates ), TRIM( vgcomponent ), &
984                       TRIM( gradients ), TRIM( slices )
985
986!
987!-- Initial temperature profile
988!-- Building output strings, starting with surface temperature
989    WRITE ( temperatures, '(F6.2)' )  pt_surface
990    gradients = '------'
991    slices = '     0'
992    coordinates = '   0.0'
993    i = 1
994    DO  WHILE ( pt_vertical_gradient_level_ind(i) /= -9999 )
995
996       WRITE (coor_chr,'(F7.2)')  pt_init(pt_vertical_gradient_level_ind(i))
997       temperatures = TRIM( temperatures ) // ' ' // TRIM( coor_chr )
998
999       WRITE (coor_chr,'(F7.2)')  pt_vertical_gradient(i)
1000       gradients = TRIM( gradients ) // ' ' // TRIM( coor_chr )
1001
1002       WRITE (coor_chr,'(I7)')  pt_vertical_gradient_level_ind(i)
1003       slices = TRIM( slices ) // ' ' // TRIM( coor_chr )
1004
1005       WRITE (coor_chr,'(F7.1)')  pt_vertical_gradient_level(i)
1006       coordinates = TRIM( coordinates ) // ' '  // TRIM( coor_chr )
1007
1008       i = i + 1
1009    ENDDO
1010
1011    WRITE ( io, 420 )  TRIM( coordinates ), TRIM( temperatures ), &
1012                       TRIM( gradients ), TRIM( slices )
1013
1014!
1015!-- Initial humidity profile
1016!-- Building output strings, starting with surface humidity
1017    IF ( humidity  .OR.  passive_scalar )  THEN
1018       WRITE ( temperatures, '(E8.1)' )  q_surface
1019       gradients = '--------'
1020       slices = '       0'
1021       coordinates = '     0.0'
1022       i = 1
1023       DO  WHILE ( q_vertical_gradient_level_ind(i) /= -9999 )
1024         
1025          WRITE (coor_chr,'(E8.1,4X)')  q_init(q_vertical_gradient_level_ind(i))
1026          temperatures = TRIM( temperatures ) // '  ' // TRIM( coor_chr )
1027
1028          WRITE (coor_chr,'(E8.1,4X)')  q_vertical_gradient(i)
1029          gradients = TRIM( gradients ) // '  ' // TRIM( coor_chr )
1030         
1031          WRITE (coor_chr,'(I8,4X)')  q_vertical_gradient_level_ind(i)
1032          slices = TRIM( slices ) // '  ' // TRIM( coor_chr )
1033         
1034          WRITE (coor_chr,'(F8.1,4X)')  q_vertical_gradient_level(i)
1035          coordinates = TRIM( coordinates ) // '  '  // TRIM( coor_chr )
1036
1037          i = i + 1
1038       ENDDO
1039
1040       IF ( humidity )  THEN
1041          WRITE ( io, 421 )  TRIM( coordinates ), TRIM( temperatures ), &
1042                             TRIM( gradients ), TRIM( slices )
1043       ELSE
1044          WRITE ( io, 422 )  TRIM( coordinates ), TRIM( temperatures ), &
1045                             TRIM( gradients ), TRIM( slices )
1046       ENDIF
1047    ENDIF
1048
1049!
1050!-- Initial salinity profile
1051!-- Building output strings, starting with surface salinity
1052    IF ( ocean )  THEN
1053       WRITE ( temperatures, '(F6.2)' )  sa_surface
1054       gradients = '------'
1055       slices = '     0'
1056       coordinates = '   0.0'
1057       i = 1
1058       DO  WHILE ( sa_vertical_gradient_level_ind(i) /= -9999 )
1059
1060          WRITE (coor_chr,'(F7.2)')  sa_init(sa_vertical_gradient_level_ind(i))
1061          temperatures = TRIM( temperatures ) // ' ' // TRIM( coor_chr )
1062
1063          WRITE (coor_chr,'(F7.2)')  sa_vertical_gradient(i)
1064          gradients = TRIM( gradients ) // ' ' // TRIM( coor_chr )
1065
1066          WRITE (coor_chr,'(I7)')  sa_vertical_gradient_level_ind(i)
1067          slices = TRIM( slices ) // ' ' // TRIM( coor_chr )
1068
1069          WRITE (coor_chr,'(F7.1)')  sa_vertical_gradient_level(i)
1070          coordinates = TRIM( coordinates ) // ' '  // TRIM( coor_chr )
1071
1072          i = i + 1
1073       ENDDO
1074
1075       WRITE ( io, 425 )  TRIM( coordinates ), TRIM( temperatures ), &
1076                          TRIM( gradients ), TRIM( slices )
1077    ENDIF
1078
1079!
1080!-- LES / turbulence parameters
1081    WRITE ( io, 450 )
1082
1083!--
1084! ... LES-constants used must still be added here
1085!--
1086    IF ( constant_diffusion )  THEN
1087       WRITE ( io, 451 )  km_constant, km_constant/prandtl_number, &
1088                          prandtl_number
1089    ENDIF
1090    IF ( .NOT. constant_diffusion)  THEN
1091       IF ( e_min > 0.0 )  WRITE ( io, 454 )  e_min
1092       IF ( wall_adjustment )  WRITE ( io, 453 )  wall_adjustment_factor
1093       IF ( adjust_mixing_length  .AND.  prandtl_layer )  WRITE ( io, 452 )
1094    ENDIF
1095
1096!
1097!-- Special actions during the run
1098    WRITE ( io, 470 )
1099    IF ( create_disturbances )  THEN
1100       WRITE ( io, 471 )  dt_disturb, disturbance_amplitude,                   &
1101                          zu(disturbance_level_ind_b), disturbance_level_ind_b,&
1102                          zu(disturbance_level_ind_t), disturbance_level_ind_t
1103       IF ( bc_lr /= 'cyclic'  .OR.  bc_ns /= 'cyclic' )  THEN
1104          WRITE ( io, 472 )  inflow_disturbance_begin, inflow_disturbance_end
1105       ELSE
1106          WRITE ( io, 473 )  disturbance_energy_limit
1107       ENDIF
1108       WRITE ( io, 474 )  TRIM( random_generator )
1109    ENDIF
1110    IF ( pt_surface_initial_change /= 0.0 )  THEN
1111       WRITE ( io, 475 )  pt_surface_initial_change
1112    ENDIF
1113    IF ( humidity  .AND.  q_surface_initial_change /= 0.0 )  THEN
1114       WRITE ( io, 476 )  q_surface_initial_change       
1115    ENDIF
1116    IF ( passive_scalar  .AND.  q_surface_initial_change /= 0.0 )  THEN
1117       WRITE ( io, 477 )  q_surface_initial_change       
1118    ENDIF
1119
1120    IF ( particle_advection )  THEN
1121!
1122!--    Particle attributes
1123       WRITE ( io, 480 )  particle_advection_start, dt_prel, bc_par_lr, &
1124                          bc_par_ns, bc_par_b, bc_par_t, particle_maximum_age, &
1125                          end_time_prel
1126       IF ( use_sgs_for_particles )  WRITE ( io, 488 )  dt_min_part
1127       IF ( random_start_position )  WRITE ( io, 481 )
1128       IF ( particles_per_point > 1 )  WRITE ( io, 489 )  particles_per_point
1129       WRITE ( io, 495 )  total_number_of_particles
1130       IF ( .NOT. vertical_particle_advection )  WRITE ( io, 482 )
1131       IF ( maximum_number_of_tailpoints /= 0 )  THEN
1132          WRITE ( io, 483 )  maximum_number_of_tailpoints
1133          IF ( minimum_tailpoint_distance /= 0 )  THEN
1134             WRITE ( io, 484 )  total_number_of_tails,      &
1135                                minimum_tailpoint_distance, &
1136                                maximum_tailpoint_age
1137          ENDIF
1138       ENDIF
1139       IF ( dt_write_particle_data /= 9999999.9 )  THEN
1140          WRITE ( io, 485 )  dt_write_particle_data
1141          output_format = ''
1142          IF ( netcdf_output )  THEN
1143             IF ( netcdf_64bit )  THEN
1144                output_format = 'netcdf (64 bit offset) and binary'
1145             ELSE
1146                output_format = 'netcdf and binary'
1147             ENDIF
1148          ELSE
1149             output_format = 'binary'
1150          ENDIF
1151          WRITE ( io, 345 )  output_format
1152       ENDIF
1153       IF ( dt_dopts /= 9999999.9 )  WRITE ( io, 494 )  dt_dopts
1154       IF ( write_particle_statistics )  WRITE ( io, 486 )
1155
1156       WRITE ( io, 487 )  number_of_particle_groups
1157
1158       DO  i = 1, number_of_particle_groups
1159          IF ( i == 1  .AND.  density_ratio(i) == 9999999.9 )  THEN
1160             WRITE ( io, 490 )  i, 0.0
1161             WRITE ( io, 492 )
1162          ELSE
1163             WRITE ( io, 490 )  i, radius(i)
1164             IF ( density_ratio(i) /= 0.0 )  THEN
1165                WRITE ( io, 491 )  density_ratio(i)
1166             ELSE
1167                WRITE ( io, 492 )
1168             ENDIF
1169          ENDIF
1170          WRITE ( io, 493 )  psl(i), psr(i), pss(i), psn(i), psb(i), pst(i), &
1171                             pdx(i), pdy(i), pdz(i)
1172       ENDDO
1173
1174    ENDIF
1175
1176
1177!
1178!-- Parameters of 1D-model
1179    IF ( INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 )  THEN
1180       WRITE ( io, 500 )  end_time_1d, dt_run_control_1d, dt_pr_1d, &
1181                          mixing_length_1d, dissipation_1d
1182       IF ( damp_level_ind_1d /= nzt+1 )  THEN
1183          WRITE ( io, 502 )  zu(damp_level_ind_1d), damp_level_ind_1d
1184       ENDIF
1185    ENDIF
1186
1187!
1188!-- User-defined informations
1189    CALL user_header( io )
1190
1191    WRITE ( io, 99 )
1192
1193!
1194!-- Write buffer contents to disc immediately
1195    CALL local_flush( io )
1196
1197!
1198!-- Here the FORMATs start
1199
1200 99 FORMAT (1X,78('-'))
1201100 FORMAT (/1X,'*************************',11X,42('-')/        &
1202            1X,'* ',A,' *',11X,A/                               &
1203            1X,'*************************',11X,42('-'))
1204101 FORMAT (37X,'coupled run: ',A/ &
1205            37X,42('-'))
1206102 FORMAT (/' Date:            ',A8,11X,'Run:       ',A20/      &
1207            ' Time:            ',A8,11X,'Run-No.:   ',I2.2/     &
1208            ' Run on host:   ',A10)
1209#if defined( __parallel )
1210103 FORMAT (' Number of PEs:',7X,I4,11X,'Processor grid (x,y): (',I3,',',I3, &
1211              ')',1X,A)
1212104 FORMAT (' Number of PEs:',7X,I4,11X,'Tasks:',I4,'   threads per task:',I4/ &
1213              37X,'Processor grid (x,y): (',I3,',',I3,')',1X,A)
1214105 FORMAT (37X,'One additional PE is used to handle'/37X,'the dvrp output!')
1215106 FORMAT (37X,'A 1d-decomposition along x is forced'/ &
1216            37X,'because the job is running on an SMP-cluster')
1217107 FORMAT (37X,'A 1d-decomposition along ',A,' is used')
1218#endif
1219110 FORMAT (/' Numerical Schemes:'/ &
1220             ' -----------------'/)
1221111 FORMAT (' --> Solve perturbation pressure via FFT using ',A,' routines')
1222112 FORMAT (' --> Solve perturbation pressure via SOR-Red/Black-Schema'/ &
1223            '     Iterations (initial/other): ',I3,'/',I3,'  omega = ',F5.3)
1224113 FORMAT (' --> Momentum advection via Piascek-Williams-Scheme (Form C3)', &
1225                  ' or Upstream')
1226114 FORMAT (' --> Momentum advection via Upstream-Spline-Scheme')
1227115 FORMAT ('     Tendencies are smoothed via Long-Filter with factor ',F5.3) 
1228116 FORMAT (' --> Scalar advection via Piascek-Williams-Scheme (Form C3)', &
1229                  ' or Upstream')
1230117 FORMAT (' --> Scalar advection via Upstream-Spline-Scheme')
1231118 FORMAT (' --> Scalar advection via Bott-Chlond-Scheme')
1232119 FORMAT (' --> Galilei-Transform applied to horizontal advection', &
1233            '     Translation velocity = ',A/ &
1234            '     distance advected ',A,':  ',F8.3,' km(x)  ',F8.3,' km(y)')
1235120 FORMAT (' --> Time differencing scheme: leapfrog only (no euler in case', &
1236                  ' of timestep changes)')
1237121 FORMAT (' --> Time differencing scheme: leapfrog + euler in case of', &
1238                  ' timestep changes')
1239122 FORMAT (' --> Time differencing scheme: ',A)
1240123 FORMAT (' --> Rayleigh-Damping active, starts above z = ',F8.2,' m'/ &
1241            '     maximum damping coefficient: ',F5.3, ' 1/s')
1242124 FORMAT ('     Spline-overshoots are being suppressed')
1243125 FORMAT ('     Upstream-Scheme is used if Upstream-differences fall short', &
1244                  ' of'/                                                       &
1245            '     delta_u = ',F6.4,4X,'delta_v = ',F6.4,4X,'delta_w = ',F6.4)
1246126 FORMAT ('     Upstream-Scheme is used if Upstream-differences fall short', &
1247                  ' of'/                                                       &
1248            '     delta_e = ',F6.4,4X,'delta_pt = ',F6.4)
1249127 FORMAT ('     The following absolute overshoot differences are tolerated:'/&
1250            '     delta_u = ',F6.4,4X,'delta_v = ',F6.4,4X,'delta_w = ',F6.4)
1251128 FORMAT ('     The following absolute overshoot differences are tolerated:'/&
1252            '     delta_e = ',F6.4,4X,'delta_pt = ',F6.4)
1253129 FORMAT (' --> Additional prognostic equation for the specific humidity')
1254130 FORMAT (' --> Additional prognostic equation for the total water content')
1255131 FORMAT (' --> Parameterization of condensation processes via (0%-or100%)')
1256132 FORMAT (' --> Parameterization of long-wave radiation processes via'/ &
1257            '     effective emissivity scheme')
1258133 FORMAT (' --> Precipitation parameterization via Kessler-Scheme')
1259134 FORMAT (' --> Additional prognostic equation for a passive scalar')
1260135 FORMAT (' --> Solve perturbation pressure via multigrid method (', &
1261                  A,'-cycle)'/ &
1262            '     number of grid levels:                   ',I2/ &
1263            '     Gauss-Seidel red/black iterations:       ',I2)
1264136 FORMAT ('     gridpoints of coarsest subdomain (x,y,z): (',I3,',',I3,',', &
1265                  I3,')')
1266137 FORMAT ('     level data gathered on PE0 at level:     ',I2/ &
1267            '     gridpoints of coarsest subdomain (x,y,z): (',I3,',',I3,',', &
1268                  I3,')'/ &
1269            '     gridpoints of coarsest domain (x,y,z):    (',I3,',',I3,',', &
1270                  I3,')')
1271138 FORMAT ('     Using hybrid version for 1d-domain-decomposition')
1272139 FORMAT (' --> Loop optimization method: ',A)
1273140 FORMAT ('     maximum residual allowed:                ',E10.3)
1274141 FORMAT ('     fixed number of multigrid cycles:        ',I4)
1275142 FORMAT ('     perturbation pressure is calculated at every Runge-Kutta ', &
1276                  'step')
1277143 FORMAT ('     Euler/upstream scheme is used for the SGS turbulent ', &
1278                  'kinetic energy')
1279150 FORMAT (' --> Volume flow at the right and north boundary will be ', &
1280                  'conserved')
1281200 FORMAT (//' Run time and time step information:'/ &
1282             ' ----------------------------------'/)
1283201 FORMAT ( ' Timestep:          variable     maximum value: ',F6.3,' s', &
1284             '    CFL-factor: ',F4.2)
1285202 FORMAT ( ' Timestep:       dt = ',F6.3,' s'/)
1286203 FORMAT ( ' Start time:       ',F9.3,' s'/ &
1287             ' End time:         ',F9.3,' s')
1288204 FORMAT ( A,F9.3,' s')
1289205 FORMAT ( A,F9.3,' s',5X,'restart every',17X,F9.3,' s')
1290206 FORMAT (/' Time reached:     ',F9.3,' s'/ &
1291             ' CPU-time used:    ',F9.3,' s     per timestep:               ', &
1292               '  ',F9.3,' s'/                                                 &
1293             '                                   per second of simulated tim', &
1294               'e: ',F9.3,' s')
1295250 FORMAT (//' Computational grid and domain size:'/ &
1296              ' ----------------------------------'// &
1297              ' Grid length:      dx =    ',F7.3,' m    dy =    ',F7.3, &
1298              ' m    dz =    ',F7.3,' m'/ &
1299              ' Domain size:       x = ',F10.3,' m     y = ',F10.3, &
1300              ' m  z(u) = ',F10.3,' m'/)
1301252 FORMAT (' dz constant up to ',F10.3,' m (k=',I4,'), then stretched by', &
1302              ' factor: ',F5.3/ &
1303            ' maximum dz not to be exceeded is dz_max = ',F10.3,' m'/)
1304254 FORMAT (' Number of gridpoints (x,y,z):  (0:',I4,', 0:',I4,', 0:',I4,')'/ &
1305            ' Subdomain size (x,y,z):        (  ',I4,',   ',I4,',   ',I4,')'/)
1306255 FORMAT (' Subdomains have equal size')
1307256 FORMAT (' Subdomains at the upper edges of the virtual processor grid ', &
1308              'have smaller sizes'/                                          &
1309            ' Size of smallest subdomain:    (  ',I4,',   ',I4,',   ',I4,')')
1310260 FORMAT (/' The model has a slope in x-direction. Inclination angle: ',F6.2,&
1311             ' degrees')
1312270 FORMAT (//' Topography informations:'/ &
1313              ' -----------------------'// &
1314              1X,'Topography: ',A)
1315271 FORMAT (  ' Building size (x/y/z) in m: ',F5.1,' / ',F5.1,' / ',F5.1/ &
1316              ' Horizontal index bounds (l/r/s/n): ',I4,' / ',I4,' / ',I4, &
1317                ' / ',I4)
1318300 FORMAT (//' Boundary conditions:'/ &
1319             ' -------------------'// &
1320             '                     p                    uv             ', &
1321             '                   pt'// &
1322             ' B. bound.: ',A/ &
1323             ' T. bound.: ',A)
1324301 FORMAT (/'                     ',A// &
1325             ' B. bound.: ',A/ &
1326             ' T. bound.: ',A)
1327303 FORMAT (/' Bottom surface fluxes are used in diffusion terms at k=1')
1328304 FORMAT (/' Top surface fluxes are used in diffusion terms at k=nzt')
1329305 FORMAT (//'    Prandtl-Layer between bottom surface and first ', &
1330               'computational u,v-level:'// &
1331             '       zp = ',F6.2,' m   z0 = ',F6.4,' m   kappa = ',F4.2/ &
1332             '       Rif value range:   ',F6.2,' <= rif <=',F6.2)
1333306 FORMAT ('       Predefined constant heatflux:   ',F9.6,' K m/s')
1334307 FORMAT ('       Heatflux has a random normal distribution')
1335308 FORMAT ('       Predefined surface temperature')
1336309 FORMAT ('       Predefined constant salinityflux:   ',F9.6,' psu m/s')
1337310 FORMAT (//'    1D-Model:'// &
1338             '       Rif value range:   ',F6.2,' <= rif <=',F6.2)
1339311 FORMAT ('       Predefined constant humidity flux: ',E10.3,' m/s')
1340312 FORMAT ('       Predefined surface humidity')
1341313 FORMAT ('       Predefined constant scalar flux: ',E10.3,' kg/(m**2 s)')
1342314 FORMAT ('       Predefined scalar value at the surface')
1343315 FORMAT ('       Humidity / scalar flux at top surface is 0.0')
1344316 FORMAT ('       Sensible heatflux and momentum flux from coupled ', &
1345                    'atmosphere model')
1346317 FORMAT (//' Lateral boundaries:'/ &
1347            '       left/right:  ',A/    &
1348            '       north/south: ',A)
1349318 FORMAT (/'       outflow damping layer width: ',I3,' gridpoints with km_', &
1350                    'max =',F5.1,' m**2/s')
1351320 FORMAT (//' List output:'/ &
1352             ' -----------'//  &
1353            '    1D-Profiles:'/    &
1354            '       Output every             ',F8.2,' s')
1355321 FORMAT ('       Time averaged over       ',F8.2,' s'/ &
1356            '       Averaging input every    ',F8.2,' s')
1357330 FORMAT (//' Data output:'/ &
1358             ' -----------'/)
1359331 FORMAT (/'    1D-Profiles:')
1360332 FORMAT (/'       ',A)
1361333 FORMAT ('       Output every             ',F8.2,' s',/ &
1362            '       Time averaged over       ',F8.2,' s'/ &
1363            '       Averaging input every    ',F8.2,' s')
1364334 FORMAT (/'    2D-Arrays',A,':')
1365335 FORMAT (/'       ',A2,'-cross-section  Arrays: ',A/ &
1366            '       Output every             ',F8.2,' s  ',A/ &
1367            '       Cross sections at ',A1,' = ',A/ &
1368            '       scalar-coordinates:   ',A,' m'/)
1369336 FORMAT (/'    3D-Arrays',A,':')
1370337 FORMAT (/'       Arrays: ',A/ &
1371            '       Output every             ',F8.2,' s  ',A/ &
1372            '       Upper output limit at    ',F8.2,' m  (GP ',I4,')'/)
1373338 FORMAT ('       Compressed data output'/ &
1374            '       Decimal precision: ',A/)
1375339 FORMAT ('       No output during initial ',F8.2,' s')
1376340 FORMAT (/'    Time series:')
1377341 FORMAT ('       Output every             ',F8.2,' s'/)
1378342 FORMAT (/'       ',A2,'-cross-section  Arrays: ',A/ &
1379            '       Output every             ',F8.2,' s  ',A/ &
1380            '       Time averaged over       ',F8.2,' s'/ &
1381            '       Averaging input every    ',F8.2,' s'/ &
1382            '       Cross sections at ',A1,' = ',A/ &
1383            '       scalar-coordinates:   ',A,' m'/)
1384343 FORMAT (/'       Arrays: ',A/ &
1385            '       Output every             ',F8.2,' s  ',A/ &
1386            '       Time averaged over       ',F8.2,' s'/ &
1387            '       Averaging input every    ',F8.2,' s'/ &
1388            '       Upper output limit at    ',F8.2,' m  (GP ',I4,')'/)
1389345 FORMAT ('       Output format: ',A/)
1390#if defined( __dvrp_graphics )
1391360 FORMAT ('    Plot-Sequence with dvrp-software:'/ &
1392            '       Output every      ',F7.1,' s'/ &
1393            '       Output mode:      ',A/ &
1394            '       Host / User:      ',A,' / ',A/ &
1395            '       Directory:        ',A// &
1396            '       The sequence contains:')
1397361 FORMAT ('       Isosurface of ',A,'  Threshold value: ', E12.3)
1398362 FORMAT ('       Sectional plane ',A)
1399363 FORMAT ('       Particles')
1400#endif
1401#if defined( __spectra )
1402370 FORMAT ('    Spectra:')
1403371 FORMAT ('       Output every ',F7.1,' s'/)
1404372 FORMAT ('       Arrays:     ', 10(A5,',')/                         &
1405            '       Directions: ', 10(A5,',')/                         &
1406            '       height levels  k = ', 9(I3,','),I3,'.'/            &
1407            '       height levels selected for standard plot:'/        &
1408            '                      k = ', 9(I3,','),I3,'.'/            &
1409            '       Time averaged over ', F7.1, ' s,' /                &
1410            '       Profiles for the time averaging are taken every ', &
1411                    F6.1,' s')
1412#endif
1413400 FORMAT (//' Physical quantities:'/ &
1414              ' -------------------'/)
1415410 FORMAT ('    Angular velocity    :   omega = ',E9.3,' rad/s'/  &
1416            '    Geograph. latitude  :   phi   = ',F4.1,' degr'/   &
1417            '    Coriolis parameter  :   f     = ',F9.6,' 1/s'/    &
1418            '                            f*    = ',F9.6,' 1/s')
1419411 FORMAT (/'    Gravity             :   g     = ',F4.1,' m/s**2')
1420412 FORMAT (/'    Reference density in buoyancy terms: ',F8.3,' kg/m**3')
1421413 FORMAT (/'    Reference temperature in buoyancy terms: ',F8.4,' K')
1422415 FORMAT (/'    Cloud physics parameters:'/ &
1423             '    ------------------------'/)
1424416 FORMAT ('        Surface pressure   :   p_0   = ',F7.2,' hPa'/      &
1425            '        Gas constant       :   R     = ',F5.1,' J/(kg K)'/ &
1426            '        Density of air     :   rho_0 = ',F5.3,' kg/m**3'/  &
1427            '        Specific heat cap. :   c_p   = ',F6.1,' J/(kg K)'/ &
1428            '        Vapourization heat :   L_v   = ',E8.2,' J/kg')
1429420 FORMAT (/'    Characteristic levels of the initial temperature profile:'// &
1430            '       Height:        ',A,'  m'/ &
1431            '       Temperature:   ',A,'  K'/ &
1432            '       Gradient:      ',A,'  K/100m'/ &
1433            '       Gridpoint:     ',A)
1434421 FORMAT (/'    Characteristic levels of the initial humidity profile:'// &
1435            '       Height:      ',A,'  m'/ &
1436            '       Humidity:    ',A,'  kg/kg'/ &
1437            '       Gradient:    ',A,'  (kg/kg)/100m'/ &
1438            '       Gridpoint:   ',A)
1439422 FORMAT (/'    Characteristic levels of the initial scalar profile:'// &
1440            '       Height:                  ',A,'  m'/ &
1441            '       Scalar concentration:    ',A,'  kg/m**3'/ &
1442            '       Gradient:                ',A,'  (kg/m**3)/100m'/ &
1443            '       Gridpoint:               ',A)
1444423 FORMAT (/'    Characteristic levels of the geo. wind component ug:'// &
1445            '       Height:      ',A,'  m'/ &
1446            '       ug:          ',A,'  m/s'/ &
1447            '       Gradient:    ',A,'  1/100s'/ &
1448            '       Gridpoint:   ',A)
1449424 FORMAT (/'    Characteristic levels of the geo. wind component vg:'// &
1450            '       Height:      ',A,'  m'/ &
1451            '       vg:          ',A,'  m/s'/ &
1452            '       Gradient:    ',A,'  1/100s'/ &
1453            '       Gridpoint:   ',A)
1454425 FORMAT (/'    Characteristic levels of the initial salinity profile:'// &
1455            '       Height:     ',A,'  m'/ &
1456            '       Salinity:   ',A,'  psu'/ &
1457            '       Gradient:   ',A,'  psu/100m'/ &
1458            '       Gridpoint:  ',A)
1459450 FORMAT (//' LES / Turbulence quantities:'/ &
1460              ' ---------------------------'/)
1461451 FORMAT ('   Diffusion coefficients are constant:'/ &
1462            '   Km = ',F6.2,' m**2/s   Kh = ',F6.2,' m**2/s   Pr = ',F5.2)
1463452 FORMAT ('   Mixing length is limited to the Prandtl mixing lenth.')
1464453 FORMAT ('   Mixing length is limited to ',F4.2,' * z')
1465454 FORMAT ('   TKE is not allowed to fall below ',E9.2,' (m/s)**2')
1466470 FORMAT (//' Actions during the simulation:'/ &
1467              ' -----------------------------'/)
1468471 FORMAT ('    Disturbance impulse (u,v) every :   ',F6.2,' s'/            &
1469            '    Disturbance amplitude           :     ',F4.2, ' m/s'/       &
1470            '    Lower disturbance level         : ',F8.2,' m (GP ',I4,')'/  &
1471            '    Upper disturbance level         : ',F8.2,' m (GP ',I4,')')
1472472 FORMAT ('    Disturbances continued during the run from i/j =',I4, &
1473                 ' to i/j =',I4)
1474473 FORMAT ('    Disturbances cease as soon as the disturbance energy exceeds',&
1475                 1X,F5.3, ' m**2/s**2')
1476474 FORMAT ('    Random number generator used    : ',A/)
1477475 FORMAT ('    The surface temperature is increased (or decreased, ', &
1478                 'respectively, if'/ &
1479            '    the value is negative) by ',F5.2,' K at the beginning of the',&
1480                 ' 3D-simulation'/)
1481476 FORMAT ('    The surface humidity is increased (or decreased, ',&
1482                 'respectively, if the'/ &
1483            '    value is negative) by ',E8.1,' kg/kg at the beginning of', &
1484                 ' the 3D-simulation'/)
1485477 FORMAT ('    The scalar value is increased at the surface (or decreased, ',&
1486                 'respectively, if the'/ &
1487            '    value is negative) by ',E8.1,' kg/m**3 at the beginning of', &
1488                 ' the 3D-simulation'/)
1489480 FORMAT ('    Particles:'/ &
1490            '    ---------'// &
1491            '       Particle advection is active (switched on at t = ', F7.1, &
1492                    ' s)'/ &
1493            '       Start of new particle generations every  ',F6.1,' s'/ &
1494            '       Boundary conditions: left/right: ', A, ' north/south: ', A/&
1495            '                            bottom:     ', A, ' top:         ', A/&
1496            '       Maximum particle age:                 ',F9.1,' s'/ &
1497            '       Advection stopped at t = ',F9.1,' s'/)
1498481 FORMAT ('       Particles have random start positions'/)
1499482 FORMAT ('       Particles are advected only horizontally'/)
1500483 FORMAT ('       Particles have tails with a maximum of ',I3,' points')
1501484 FORMAT ('            Number of tails of the total domain: ',I10/ &
1502            '            Minimum distance between tailpoints: ',F8.2,' m'/ &
1503            '            Maximum age of the end of the tail:  ',F8.2,' s')
1504485 FORMAT ('       Particle data are written on file every ', F9.1, ' s')
1505486 FORMAT ('       Particle statistics are written on file'/)
1506487 FORMAT ('       Number of particle groups: ',I2/)
1507488 FORMAT ('       SGS velocity components are used for particle advection'/ &
1508            '          minimum timestep for advection: ', F7.5/)
1509489 FORMAT ('       Number of particles simultaneously released at each ', &
1510                    'point: ', I5/)
1511490 FORMAT ('       Particle group ',I2,':'/ &
1512            '          Particle radius: ',E10.3, 'm')
1513491 FORMAT ('          Particle inertia is activated'/ &
1514            '             density_ratio (rho_fluid/rho_particle) = ',F5.3/)
1515492 FORMAT ('          Particles are advected only passively (no inertia)'/)
1516493 FORMAT ('          Boundaries of particle source: x:',F8.1,' - ',F8.1,' m'/&
1517            '                                         y:',F8.1,' - ',F8.1,' m'/&
1518            '                                         z:',F8.1,' - ',F8.1,' m'/&
1519            '          Particle distances:  dx = ',F8.1,' m  dy = ',F8.1, &
1520                       ' m  dz = ',F8.1,' m'/)
1521494 FORMAT ('       Output of particle time series in NetCDF format every ', &
1522                    F8.2,' s'/)
1523495 FORMAT ('       Number of particles in total domain: ',I10/)
1524500 FORMAT (//' 1D-Model parameters:'/                           &
1525              ' -------------------'//                           &
1526            '    Simulation time:                   ',F8.1,' s'/ &
1527            '    Run-controll output every:         ',F8.1,' s'/ &
1528            '    Vertical profile output every:     ',F8.1,' s'/ &
1529            '    Mixing length calculation:         ',A/         &
1530            '    Dissipation calculation:           ',A/)
1531502 FORMAT ('    Damping layer starts from ',F7.1,' m (GP ',I4,')'/)
1532
1533
1534 END SUBROUTINE header
Note: See TracBrowser for help on using the repository browser.