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

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

further preliminary changes concerning coupling

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