source: palm/trunk/SOURCE/read_var_list.f90 @ 581

Last change on this file since 581 was 581, checked in by heinze, 14 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 31.2 KB
Line 
1 SUBROUTINE read_var_list
2
3!------------------------------------------------------------------------------!
4! Current revisions:
5! -----------------
6!
7!
8! Former revisions:
9! -----------------
10! $Id: read_var_list.f90 581 2010-10-05 14:22:12Z heinze $
11!
12! 580 2010-10-05 13:59:11Z heinze
13! Renaming of ws_vertical_gradient to subs_vertical_gradient,
14! ws_vertical_gradient_level to subs_vertical_gradient_level and
15! ws_vertical_gradient_level_ind to subs_vertical_gradient_level_i
16!
17! 411 2009-12-11 14:15:58Z heinze
18! +large_scale_subsidence, ws_vertical_gradient, ws_vertical_gradient_level,
19! ws_vertical_gradient_level_ind
20!
21! 345 2009-07-01 14:37:56Z heinze
22! +output_for_t0
23! dt_fixed is read into a dummy variable.
24! Output of messages replaced by message handling routine.
25! +canyon_height, canyon_width_x, canyon_width_y, canyon_wall_left,
26! canyon_wall_south, conserve_volume_flow_mode, coupling_start_time,
27! dp_external, dp_level_b, dp_smooth, dpdxy, run_coupled,
28! time_since_reference_point, topography_grid_convention, u_bulk, v_bulk
29!
30! 216 2008-11-25 07:12:43Z raasch
31! limitations for nx_on_file, ny_on_file removed (read_parts_of_var_list)
32!
33! 173 2008-05-23 20:39:38Z raasch
34! +cthf, leaf_surface_concentration, scalar_exchange_coefficient
35! +numprocs_previous_run, hor_index_bounds_previous_run, inflow_damping_factor,
36! inflow_damping_height, inflow_damping_width, mean_inflow_profiles,
37! recycling_width, turbulent_inflow,
38! -cross_ts_*, npex, npey,
39! hom_sum, volume_flow_area, volume_flow_initial moved from
40! read_3d_binary to here,
41! routines read_parts_of_var_list and skip_var_list added at the end
42!
43! 138 2007-11-28 10:03:58Z letzel
44! +canopy_mode, drag_coefficient, lad, lad_surface, lad_vertical_gradient,
45! lad_vertical_gradient_level, lad_vertical_gradient_level_ind, pch_index,
46! plant_canopy, time_sort_particles
47!
48! 102 2007-07-27 09:09:17Z raasch
49! +time_coupling, top_momentumflux_u|v
50!
51! 95 2007-06-02 16:48:38Z raasch
52! +bc_sa_t, ocean, sa_init, sa_surface, sa_vertical_gradient,
53! sa_vertical_gradient_level, bottom/top_salinity_flux
54!
55! 87 2007-05-22 15:46:47Z raasch
56! +max_pr_user (version 3.1), var_hom renamed pr_palm
57!
58! 75 2007-03-22 09:54:05Z raasch
59! +loop_optimization, pt_reference, moisture renamed humidity
60!
61! 20 2007-02-26 00:12:32Z raasch
62! +top_heatflux, use_top_fluxes
63!
64! RCS Log replace by Id keyword, revision history cleaned up
65!
66! Revision 1.34  2006/08/22 14:14:27  raasch
67! +dz_max
68!
69! Revision 1.1  1998/03/18 20:18:48  raasch
70! Initial revision
71!
72!
73! Description:
74! ------------
75! Reading values of global control variables from restart-file (binary format)
76!------------------------------------------------------------------------------!
77
78    USE arrays_3d
79    USE averaging
80    USE control_parameters
81    USE grid_variables
82    USE indices
83    USE model_1d
84    USE netcdf_control
85    USE particle_attributes
86    USE pegrid
87    USE profil_parameter
88    USE statistics
89
90    IMPLICIT NONE
91
92    CHARACTER (LEN=10) ::  binary_version, version_on_file
93    CHARACTER (LEN=30) ::  variable_chr
94
95    LOGICAL ::  ldum
96
97
98    CALL check_open( 13 )
99
100!
101!-- Make version number check first
102    READ ( 13 )  version_on_file
103    binary_version = '3.4'
104    IF ( TRIM( version_on_file ) /= TRIM( binary_version ) )  THEN
105       WRITE( message_string, * ) 'version mismatch concerning control ', &
106                                  'variables',                            &
107                                  '&version on file    = "',              &
108                                  TRIM( version_on_file ), '"',           &
109                                  '&version on program = "',              &
110                                  TRIM( binary_version ), '"'
111       CALL message( 'read_var_list', 'PA0296', 1, 2, 0, 6, 0 )
112    ENDIF
113
114!
115!-- Read number of PEs and horizontal index bounds of all PEs used in previous
116!-- run
117    READ ( 13 )  variable_chr
118    IF ( TRIM( variable_chr ) /= 'numprocs' )  THEN
119       WRITE( message_string, * ) 'numprocs not found in data from prior ', &
120                                  'run on PE ', myid
121       CALL message( 'read_var_list', 'PA0297', 1, 2, 0, 6, 0 )
122    ENDIF
123    READ ( 13 )  numprocs_previous_run
124
125    IF ( .NOT. ALLOCATED( hor_index_bounds_previous_run ) )  THEN
126       ALLOCATE( hor_index_bounds_previous_run(4,0:numprocs_previous_run-1) )
127    ENDIF
128
129    READ ( 13 )  variable_chr
130    IF ( TRIM( variable_chr ) /= 'hor_index_bounds' )  THEN
131       WRITE( message_string, * ) 'hor_index_bounds not found in data from ', &
132                                  'prior run on PE ', myid
133       CALL message( 'read_var_list', 'PA0298', 1, 2, 0, 6, 0 )
134    ENDIF
135    READ ( 13 )  hor_index_bounds_previous_run
136
137!
138!-- Read vertical number of gridpoints and number of different areas used
139!-- for computing statistics. Allocate arrays depending on these values,
140!-- which are needed for the following read instructions.
141    READ ( 13 )  variable_chr
142    IF ( TRIM( variable_chr ) /= 'nz' )  THEN
143       WRITE( message_string, * ) 'nz not found in data from prior run on PE ',&
144                                  myid
145       CALL message( 'read_var_list', 'PA0299', 1, 2, 0, 6, 0 )
146    ENDIF
147    READ ( 13 )  nz
148
149    READ ( 13 )  variable_chr
150    IF ( TRIM( variable_chr ) /= 'max_pr_user' )  THEN
151       WRITE( message_string, * ) 'max_pr_user not found in data from ', &
152                    'prior run on PE ', myid
153       CALL message( 'read_var_list', 'PA0300', 1, 2, 0, 6, 0 )
154    ENDIF
155    READ ( 13 )  max_pr_user    ! This value is checked against the number of
156                                ! user profiles given for the current run
157                                ! in routine user_parin (it has to match)
158
159    READ ( 13 )  variable_chr
160    IF ( TRIM( variable_chr ) /= 'statistic_regions' )  THEN
161       WRITE( message_string, * ) 'statistic_regions not found in data from ', &
162                    'prior run on PE ', myid
163       CALL message( 'read_var_list', 'PA0301', 1, 2, 0, 6, 0 )
164    ENDIF
165    READ ( 13 )  statistic_regions
166    IF ( .NOT. ALLOCATED( ug ) )  THEN
167       ALLOCATE( lad(0:nz+1), ug(0:nz+1), u_init(0:nz+1), vg(0:nz+1),    &
168                 v_init(0:nz+1), pt_init(0:nz+1), q_init(0:nz+1),        &
169                 sa_init(0:nz+1),                                        &
170                 hom(0:nz+1,2,pr_palm+max_pr_user,0:statistic_regions),  &
171                 hom_sum(0:nz+1,pr_palm+max_pr_user,0:statistic_regions) )
172    ENDIF
173
174!
175!-- Now read all control parameters:
176!-- Caution: When the following read instructions have been changed, the
177!-- -------  version number stored in the variable binary_version has to be
178!--          increased. The same changes must also be done in write_var_list.
179    READ ( 13 )  variable_chr
180    DO  WHILE ( TRIM( variable_chr ) /= '*** end ***' )
181
182       SELECT CASE ( TRIM( variable_chr ) )
183
184          CASE ( 'adjust_mixing_length' )
185             READ ( 13 )  adjust_mixing_length
186          CASE ( 'advected_distance_x' )
187             READ ( 13 )  advected_distance_x
188          CASE ( 'advected_distance_y' )
189             READ ( 13 )  advected_distance_y
190          CASE ( 'alpha_surface' )
191             READ ( 13 )  alpha_surface
192          CASE ( 'average_count_pr' )
193             READ ( 13 )  average_count_pr
194          CASE ( 'average_count_sp' )
195             READ ( 13 )  average_count_sp
196          CASE ( 'average_count_3d' )
197             READ ( 13 )  average_count_3d
198          CASE ( 'bc_e_b' )
199             READ ( 13 )  bc_e_b
200          CASE ( 'bc_lr' )
201             READ ( 13 )  bc_lr
202          CASE ( 'bc_ns' )
203             READ ( 13 )  bc_ns
204          CASE ( 'bc_p_b' )
205             READ ( 13 )  bc_p_b
206          CASE ( 'bc_p_t' )
207             READ ( 13 )  bc_p_t
208          CASE ( 'bc_pt_b' )
209             READ ( 13 )  bc_pt_b
210          CASE ( 'bc_pt_t' )
211             READ ( 13 )  bc_pt_t
212          CASE ( 'bc_pt_t_val' )
213             READ ( 13 )  bc_pt_t_val
214          CASE ( 'bc_q_b' )
215             READ ( 13 )  bc_q_b
216          CASE ( 'bc_q_t' )
217             READ ( 13 )  bc_q_t
218          CASE ( 'bc_q_t_val' )
219             READ ( 13 )  bc_q_t_val
220          CASE ( 'bc_s_b' )
221             READ ( 13 )  bc_s_b
222          CASE ( 'bc_s_t' )
223             READ ( 13 )  bc_s_t
224          CASE ( 'bc_sa_t' )
225             READ ( 13 )  bc_sa_t
226          CASE ( 'bc_uv_b' )
227             READ ( 13 )  bc_uv_b
228          CASE ( 'bc_uv_t' )
229             READ ( 13 )  bc_uv_t
230          CASE ( 'bottom_salinityflux' )
231             READ ( 13 )  bottom_salinityflux
232          CASE ( 'building_height' )
233             READ ( 13 )  building_height
234          CASE ( 'building_length_x' )
235             READ ( 13 )  building_length_x
236          CASE ( 'building_length_y' )
237             READ ( 13 )  building_length_y
238          CASE ( 'building_wall_left' )
239             READ ( 13 )  building_wall_left
240          CASE ( 'building_wall_south' )
241             READ ( 13 )  building_wall_south
242          CASE ( 'canopy_mode' )
243             READ ( 13 )  canopy_mode
244          CASE ( 'canyon_height' )
245             READ ( 13 )  canyon_height
246          CASE ( 'canyon_width_x' )
247             READ ( 13 )  canyon_width_x
248          CASE ( 'canyon_width_y' )
249             READ ( 13 )  canyon_width_y
250          CASE ( 'canyon_wall_left' )
251             READ ( 13 )  canyon_wall_left
252          CASE ( 'canyon_wall_south' )
253             READ ( 13 )  canyon_wall_south
254          CASE ( 'cloud_droplets' )
255             READ ( 13 )  cloud_droplets
256          CASE ( 'cloud_physics' )
257             READ ( 13 )  cloud_physics
258          CASE ( 'conserve_volume_flow' )
259             READ ( 13 )  conserve_volume_flow
260          CASE ( 'conserve_volume_flow_mode' )
261             READ ( 13 )  conserve_volume_flow_mode
262          CASE ( 'coupling_start_time' )
263             READ ( 13 )  coupling_start_time
264          CASE ( 'cthf' )
265             READ ( 13 )  cthf
266          CASE ( 'current_timestep_number' )
267             READ ( 13 )  current_timestep_number
268          CASE ( 'cut_spline_overshoot' )
269             READ ( 13 )  cut_spline_overshoot
270          CASE ( 'damp_level_1d' )
271             READ ( 13 )  damp_level_1d
272          CASE ( 'dissipation_1d' )
273             READ ( 13 )  dissipation_1d
274          CASE ( 'dp_external' )
275             READ ( 13 )  dp_external
276          CASE ( 'dp_level_b' )
277             READ ( 13 )  dp_level_b
278          CASE ( 'dp_smooth' )
279             READ ( 13 )  dp_smooth
280          CASE ( 'dpdxy' )
281             READ ( 13 )  dpdxy
282          CASE ( 'drag_coefficient' )
283             READ ( 13 )  drag_coefficient
284          CASE ( 'dt_fixed' )
285             READ ( 13 )  ldum   ! restart files created before rev 333
286                                 ! contained dt_fixed by mistake; it is still
287                                 ! read here in order to allow usage of these
288                                 ! older restart files; can be removed in a
289                                 ! later version
290          CASE ( 'dt_pr_1d' )
291             READ ( 13 )  dt_pr_1d
292          CASE ( 'dt_run_control_1d' )
293             READ ( 13 )  dt_run_control_1d
294          CASE ( 'dt_3d' )
295             READ ( 13 )  dt_3d
296          CASE ( 'dvrp_filecount' )
297             READ ( 13 )  dvrp_filecount
298          CASE ( 'dx' )
299             READ ( 13 )  dx
300          CASE ( 'dy' )
301             READ ( 13 )  dy
302          CASE ( 'dz' )
303             READ ( 13 )  dz
304          CASE ( 'dz_max' )
305             READ ( 13 )  dz_max
306          CASE ( 'dz_stretch_factor' )
307             READ ( 13 )  dz_stretch_factor
308          CASE ( 'dz_stretch_level' )
309             READ ( 13 )  dz_stretch_level
310          CASE ( 'e_min' )
311             READ ( 13 )  e_min
312          CASE ( 'end_time_1d' )
313             READ ( 13 )  end_time_1d
314          CASE ( 'fft_method' )
315             READ ( 13 )  fft_method
316          CASE ( 'first_call_advec_particles' )
317             READ ( 13 )  first_call_advec_particles
318          CASE ( 'galilei_transformation' )
319             READ ( 13 )  galilei_transformation
320          CASE ( 'grid_matching' )
321             READ ( 13 )  grid_matching
322          CASE ( 'hom' )
323             READ ( 13 )  hom
324          CASE ( 'hom_sum' )
325             READ ( 13 )  hom_sum
326          CASE ( 'humidity' )
327             READ ( 13 )  humidity
328          CASE ( 'inflow_damping_factor' )
329             IF ( .NOT. ALLOCATED( inflow_damping_factor ) )  THEN
330                ALLOCATE( inflow_damping_factor(0:nz+1) )
331             ENDIF
332             READ ( 13 )  inflow_damping_factor
333          CASE ( 'inflow_damping_height' )
334             READ ( 13 )  inflow_damping_height
335          CASE ( 'inflow_damping_width' )
336             READ ( 13 )  inflow_damping_width
337          CASE ( 'inflow_disturbance_begin' )
338             READ ( 13 )  inflow_disturbance_begin
339          CASE ( 'inflow_disturbance_end' )
340             READ ( 13 )  inflow_disturbance_end
341          CASE ( 'km_constant' )
342             READ ( 13 )  km_constant
343          CASE ( 'km_damp_max' )
344             READ ( 13 )  km_damp_max
345          CASE ( 'lad' )
346             READ ( 13 )  lad
347          CASE ( 'lad_surface' )
348             READ ( 13 )  lad_surface
349          CASE ( 'lad_vertical_gradient' )
350             READ ( 13 )  lad_vertical_gradient
351          CASE ( 'lad_vertical_gradient_level' )
352             READ ( 13 )  lad_vertical_gradient_level
353          CASE ( 'lad_vertical_gradient_level_in' )
354             READ ( 13 )  lad_vertical_gradient_level_ind
355          CASE ( 'last_dt_change' )
356             READ ( 13 )  last_dt_change
357           CASE ( 'large_scale_subsidence' )
358             READ ( 13 )  large_scale_subsidence
359          CASE ( 'leaf_surface_concentration' )
360             READ ( 13 )  leaf_surface_concentration
361          CASE ( 'long_filter_factor' )
362             READ ( 13 )  long_filter_factor
363          CASE ( 'loop_optimization' )
364             READ ( 13 )  loop_optimization
365          CASE ( 'mean_inflow_profiles' )
366             IF ( .NOT. ALLOCATED( mean_inflow_profiles ) )  THEN
367                ALLOCATE( mean_inflow_profiles(0:nz+1,5) )
368             ENDIF
369             READ ( 13 )  mean_inflow_profiles
370          CASE ( 'mixing_length_1d' )
371             READ ( 13 )  mixing_length_1d
372          CASE ( 'momentum_advec' )
373             READ ( 13 )  momentum_advec
374          CASE ( 'netcdf_precision' )
375             READ ( 13 )  netcdf_precision
376          CASE ( 'nsor_ini' )
377             READ ( 13 )  nsor_ini
378          CASE ( 'nx' )
379             READ ( 13 )  nx
380             nx_on_file = nx
381          CASE ( 'ny' )
382             READ ( 13 )  ny
383             ny_on_file = ny
384          CASE ( 'ocean' )
385             READ ( 13 )  ocean
386          CASE ( 'old_dt' )
387             READ ( 13 )  old_dt
388          CASE ( 'omega' )
389             READ ( 13 )  omega
390          CASE ( 'outflow_damping_width' )
391             READ ( 13 )  outflow_damping_width
392          CASE ( 'output_for_t0' )
393             READ (13)    output_for_t0
394          CASE ( 'overshoot_limit_e' )
395             READ ( 13 )  overshoot_limit_e
396          CASE ( 'overshoot_limit_pt' )
397             READ ( 13 )  overshoot_limit_pt
398          CASE ( 'overshoot_limit_u' )
399             READ ( 13 )  overshoot_limit_u
400          CASE ( 'overshoot_limit_v' )
401             READ ( 13 )  overshoot_limit_v
402          CASE ( 'overshoot_limit_w' )
403             READ ( 13 )  overshoot_limit_w
404          CASE ( 'passive_scalar' )
405             READ ( 13 )  passive_scalar
406          CASE ( 'pch_index' )
407             READ ( 13 )  pch_index
408          CASE ( 'phi' )
409             READ ( 13 )  phi
410          CASE ( 'plant_canopy' )
411             READ ( 13 )  plant_canopy
412          CASE ( 'prandtl_layer' )
413             READ ( 13 )  prandtl_layer
414          CASE ( 'precipitation' )
415             READ ( 13 ) precipitation
416          CASE ( 'pt_init' )
417             READ ( 13 )  pt_init
418          CASE ( 'pt_reference' )
419             READ ( 13 )  pt_reference
420          CASE ( 'pt_surface' )
421             READ ( 13 )  pt_surface
422          CASE ( 'pt_surface_initial_change' )
423             READ ( 13 )  pt_surface_initial_change
424          CASE ( 'pt_vertical_gradient' )
425             READ ( 13 )  pt_vertical_gradient
426          CASE ( 'pt_vertical_gradient_level' )
427             READ ( 13 )  pt_vertical_gradient_level
428          CASE ( 'pt_vertical_gradient_level_ind' )
429             READ ( 13 )  pt_vertical_gradient_level_ind
430          CASE ( 'q_init' )
431             READ ( 13 )  q_init
432          CASE ( 'q_surface' )
433             READ ( 13 )  q_surface
434          CASE ( 'q_surface_initial_change' )
435             READ ( 13 )  q_surface_initial_change
436          CASE ( 'q_vertical_gradient' )
437             READ ( 13 )  q_vertical_gradient
438          CASE ( 'q_vertical_gradient_level' )
439             READ ( 13 )  q_vertical_gradient_level
440          CASE ( 'q_vertical_gradient_level_ind' )
441             READ ( 13 )  q_vertical_gradient_level_ind
442          CASE ( 'radiation' )
443             READ ( 13 )  radiation
444          CASE ( 'random_generator' )
445             READ ( 13 )  random_generator
446          CASE ( 'random_heatflux' )
447             READ ( 13 )  random_heatflux
448          CASE ( 'recycling_width' )
449             READ ( 13 )  recycling_width
450          CASE ( 'rif_max' )
451             READ ( 13 )  rif_max
452          CASE ( 'rif_min' )
453             READ ( 13 )  rif_min
454          CASE ( 'roughness_length' )
455             READ ( 13 )  roughness_length
456          CASE ( 'runnr' )
457             READ ( 13 )  runnr
458          CASE ( 'run_coupled' )
459             READ ( 13 )  run_coupled
460          CASE ( 'sa_init' )
461             READ ( 13 )  sa_init
462          CASE ( 'sa_surface' )
463             READ ( 13 )  sa_surface
464          CASE ( 'sa_vertical_gradient' )
465             READ ( 13 )  sa_vertical_gradient
466          CASE ( 'sa_vertical_gradient_level' )
467             READ ( 13 )  sa_vertical_gradient_level
468          CASE ( 'scalar_advec' )
469             READ ( 13 )  scalar_advec
470          CASE ( 'scalar_exchange_coefficient' )
471             READ ( 13 )  scalar_exchange_coefficient
472          CASE ( 'simulated_time' )
473             READ ( 13 )  simulated_time
474          CASE ( 'surface_heatflux' )
475             READ ( 13 )  surface_heatflux
476          CASE ( 'surface_pressure' )
477             READ ( 13 )  surface_pressure
478          CASE ( 'surface_scalarflux' )
479             READ ( 13 )  surface_scalarflux             
480          CASE ( 'surface_waterflux' )
481             READ ( 13 )  surface_waterflux             
482          CASE ( 's_surface' )
483             READ ( 13 )  s_surface
484          CASE ( 's_surface_initial_change' )
485             READ ( 13 )  s_surface_initial_change
486          CASE ( 's_vertical_gradient' )
487             READ ( 13 )  s_vertical_gradient
488          CASE ( 's_vertical_gradient_level' )
489             READ ( 13 )  s_vertical_gradient_level
490          CASE ( 'time_coupling' )
491             READ ( 13 )  time_coupling
492          CASE ( 'time_disturb' )
493             READ ( 13 )  time_disturb
494          CASE ( 'time_dopr' )
495             READ ( 13 )  time_dopr
496          CASE ( 'time_dopr_av' )
497             READ ( 13 )  time_dopr_av
498          CASE ( 'time_dopr_listing' )
499             READ ( 13 )  time_dopr_listing
500          CASE ( 'time_dopts' )
501             READ ( 13 )  time_dopts
502          CASE ( 'time_dosp' )
503             READ ( 13 )  time_dosp
504          CASE ( 'time_dots' )
505             READ ( 13 )  time_dots
506          CASE ( 'time_do2d_xy' )
507             READ ( 13 )  time_do2d_xy
508          CASE ( 'time_do2d_xz' )
509             READ ( 13 )  time_do2d_xz
510          CASE ( 'time_do2d_yz' )
511             READ ( 13 )  time_do2d_yz
512          CASE ( 'time_do3d' )
513             READ ( 13 )  time_do3d
514          CASE ( 'time_do_av' )
515             READ ( 13 )  time_do_av
516          CASE ( 'time_do_sla' )
517             READ ( 13 )  time_do_sla
518          CASE ( 'time_dvrp' )
519             READ ( 13 )  time_dvrp
520          CASE ( 'time_restart' )
521             READ ( 13 )  time_restart
522          CASE ( 'time_run_control' )
523             READ ( 13 )  time_run_control
524          CASE ( 'time_since_reference_point' )
525             READ ( 13 )  time_since_reference_point
526          CASE ( 'time_sort_particles' )
527             READ ( 13 )  time_sort_particles
528          CASE ( 'timestep_scheme' )
529             READ ( 13 )  timestep_scheme
530          CASE ( 'topography' )
531             READ ( 13 )  topography
532          CASE ( 'topography_grid_convention' )
533             READ ( 13 )  topography_grid_convention
534          CASE ( 'top_heatflux' )
535             READ ( 13 )  top_heatflux
536          CASE ( 'top_momentumflux_u' )
537             READ ( 13 )  top_momentumflux_u
538          CASE ( 'top_momentumflux_v' )
539             READ ( 13 )  top_momentumflux_v
540          CASE ( 'top_salinityflux' )
541             READ ( 13 )  top_salinityflux
542          CASE ( 'tsc' )
543             READ ( 13 )  tsc
544          CASE ( 'turbulent_inflow' )
545             READ ( 13 )  turbulent_inflow
546          CASE ( 'u_bulk' )
547             READ ( 13 )  u_bulk
548          CASE ( 'u_init' )
549             READ ( 13 )  u_init
550          CASE ( 'u_max' )
551             READ ( 13 )  u_max
552          CASE ( 'u_max_ijk' )
553             READ ( 13 )  u_max_ijk
554          CASE ( 'ug' )
555             READ ( 13 )  ug
556          CASE ( 'ug_surface' )
557             READ ( 13 )  ug_surface
558          CASE ( 'ug_vertical_gradient' )
559             READ ( 13 )  ug_vertical_gradient
560          CASE ( 'ug_vertical_gradient_level' )
561             READ ( 13 )  ug_vertical_gradient_level
562          CASE ( 'ug_vertical_gradient_level_ind' )
563             READ ( 13 )  ug_vertical_gradient_level_ind
564          CASE ( 'ups_limit_e' )
565             READ ( 13 )  ups_limit_e
566          CASE ( 'ups_limit_pt' )
567             READ ( 13 )  ups_limit_pt
568          CASE ( 'ups_limit_u' )
569             READ ( 13 )  ups_limit_u
570          CASE ( 'ups_limit_v' )
571             READ ( 13 )  ups_limit_v
572          CASE ( 'ups_limit_w' )
573             READ ( 13 )  ups_limit_w
574          CASE ( 'use_surface_fluxes' )
575             READ ( 13 )  use_surface_fluxes
576          CASE ( 'use_top_fluxes' )
577             READ ( 13 )  use_top_fluxes
578          CASE ( 'use_ug_for_galilei_tr' )
579             READ ( 13 )  use_ug_for_galilei_tr
580          CASE ( 'use_upstream_for_tke' )
581             READ ( 13 )  use_upstream_for_tke
582          CASE ( 'v_bulk' )
583             READ ( 13 )  v_bulk
584          CASE ( 'v_init' )
585             READ ( 13 )  v_init
586          CASE ( 'v_max' )
587             READ ( 13 )  v_max
588          CASE ( 'v_max_ijk' )
589             READ ( 13 )  v_max_ijk
590          CASE ( 'vg' )
591             READ ( 13 )  vg
592          CASE ( 'vg_surface' )
593             READ ( 13 )  vg_surface
594          CASE ( 'vg_vertical_gradient' )
595             READ ( 13 )  vg_vertical_gradient
596          CASE ( 'vg_vertical_gradient_level' )
597             READ ( 13 )  vg_vertical_gradient_level
598          CASE ( 'vg_vertical_gradient_level_ind' )
599             READ ( 13 )  vg_vertical_gradient_level_ind
600          CASE ( 'volume_flow_area' )
601             READ ( 13 )  volume_flow_area
602          CASE ( 'volume_flow_initial' )
603             READ ( 13 )  volume_flow_initial
604          CASE ( 'wall_adjustment' )
605             READ ( 13 )  wall_adjustment
606          CASE ( 'subs_vertical_gradient' )
607             READ ( 13 )  subs_vertical_gradient
608          CASE ( 'subs_vertical_gradient_level' )
609             READ ( 13 )  subs_vertical_gradient_level
610          CASE ( 'subs_vertical_gradient_level_i' )
611             READ ( 13 )  subs_vertical_gradient_level_i
612          CASE ( 'w_max' )
613             READ ( 13 )  w_max
614          CASE ( 'w_max_ijk' )
615             READ ( 13 )  w_max_ijk
616
617          CASE DEFAULT
618             WRITE( message_string, * ) 'unknown variable named "',         &
619                                        TRIM( variable_chr ), '" found in', &
620                                        ' data from prior run on PE ', myid 
621             CALL message( 'read_var_list', 'PA0302', 1, 2, 0, 6, 0 )
622        END SELECT
623!
624!--    Read next string
625       READ ( 13 )  variable_chr
626
627    ENDDO
628
629
630 END SUBROUTINE read_var_list
631
632
633
634 SUBROUTINE read_parts_of_var_list
635
636!------------------------------------------------------------------------------!
637! Description:
638! ------------
639! Skipping the global control variables from restart-file (binary format)
640! except some informations needed when reading restart data from a previous
641! run which used a smaller total domain or/and a different domain decomposition.
642!------------------------------------------------------------------------------!
643
644    USE arrays_3d
645    USE control_parameters
646    USE indices
647    USE pegrid
648    USE statistics
649
650    IMPLICIT NONE
651
652    CHARACTER (LEN=10) ::  version_on_file
653    CHARACTER (LEN=30) ::  variable_chr
654
655    INTEGER ::  idum, max_pr_user_on_file, nz_on_file, &
656                statistic_regions_on_file, tmp_mpru, tmp_sr
657
658    REAL, DIMENSION(:,:,:),   ALLOCATABLE ::  hom_sum_on_file
659    REAL, DIMENSION(:,:,:,:), ALLOCATABLE ::  hom_on_file
660
661
662    CALL check_open( 13 )
663
664    WRITE (9,*) 'rpovl: after check open 13'
665    CALL local_flush( 9 )
666    READ ( 13 )  version_on_file
667
668!
669!-- Read number of PEs and horizontal index bounds of all PEs used in previous
670!-- run
671    READ ( 13 )  variable_chr
672    IF ( TRIM( variable_chr ) /= 'numprocs' )  THEN
673       WRITE( message_string, * ) 'numprocs not found in data from prior ', &
674                                  'run on PE ', myid
675       CALL message( 'read_parts_of_var_list', 'PA0297', 1, 2, 0, 6, 0 )
676    ENDIF
677    READ ( 13 )  numprocs_previous_run
678
679    IF ( .NOT. ALLOCATED( hor_index_bounds_previous_run ) )  THEN
680       ALLOCATE( hor_index_bounds_previous_run(4,0:numprocs_previous_run-1) )
681    ENDIF
682
683    READ ( 13 )  variable_chr
684    IF ( TRIM( variable_chr ) /= 'hor_index_bounds' )  THEN
685       WRITE( message_string, * ) 'hor_index_bounds not found in data from ', &
686                                  'prior run on PE ', myid
687       CALL message( 'read_parts_of_var_list', 'PA0298', 1, 2, 0, 6, 0 )
688    ENDIF
689    READ ( 13 )  hor_index_bounds_previous_run
690
691!
692!-- Read vertical number of gridpoints and number of different areas used
693!-- for computing statistics. Allocate arrays depending on these values,
694!-- which are needed for the following read instructions.
695    READ ( 13 )  variable_chr
696    IF ( TRIM( variable_chr ) /= 'nz' )  THEN
697       message_string = 'nz not found in restart data file'
698       CALL message( 'read_parts_of_var_list', 'PA0303', 1, 2, 0, 6, 0 )
699    ENDIF
700    READ ( 13 )  nz_on_file
701    IF ( nz_on_file /= nz )  THEN
702       WRITE( message_string, * ) 'mismatch concerning number of ',      &
703                                  'gridpoints along z',                  &
704                                  '&nz on file    = "', nz_on_file, '"', &
705                                  '&nz from run   = "', nz, '"'
706       CALL message( 'read_parts_of_var_list', 'PA0304', 1, 2, 0, 6, 0 )
707    ENDIF
708
709    READ ( 13 )  variable_chr
710    IF ( TRIM( variable_chr ) /= 'max_pr_user' )  THEN
711       message_string = 'max_pr_user not found in restart data file'
712       CALL message( 'read_parts_of_var_list', 'PA0305', 1, 2, 0, 6, 0 )
713    ENDIF
714    READ ( 13 )  max_pr_user_on_file
715    IF ( max_pr_user_on_file /= max_pr_user )  THEN
716       WRITE( message_string, * ) 'number of user profiles on res',           &
717                                  'tart data file differs from the current ', &
718                                  'run&max_pr_user on file    = "',           &
719                                  max_pr_user_on_file, '"',                   &
720                                  '&max_pr_user from run   = "',              &
721                                  max_pr_user, '"'
722       CALL message( 'read_parts_of_var_list', 'PA0306', 0, 0, 0, 6, 0 )
723       tmp_mpru = MIN( max_pr_user_on_file, max_pr_user )
724    ELSE
725       tmp_mpru = max_pr_user
726    ENDIF
727
728    READ ( 13 )  variable_chr
729    IF ( TRIM( variable_chr ) /= 'statistic_regions' )  THEN
730       message_string = 'statistic_regions not found in restart data file'
731       CALL message( 'read_parts_of_var_list', 'PA0307', 1, 2, 0, 6, 0 )
732    ENDIF
733    READ ( 13 )  statistic_regions_on_file
734    IF ( statistic_regions_on_file /= statistic_regions )  THEN
735       WRITE( message_string, * ) 'statistic regions on restart data file ',& 
736                                  'differ from the current run',            &
737                                  '&statistic regions on file    = "',      &
738                                  statistic_regions_on_file, '"',           &
739                                  '&statistic regions from run   = "',      &
740                                   statistic_regions, '"',                  &
741                                  '&statistic data may be lost!'
742       CALL message( 'read_parts_of_var_list', 'PA0308', 0, 1, 0, 6, 0 )
743       tmp_sr = MIN( statistic_regions_on_file, statistic_regions )
744    ELSE
745       tmp_sr = statistic_regions
746    ENDIF
747
748
749!
750!-- Now read and check some control parameters and skip the rest
751    WRITE (9,*) 'wpovl: begin reading variables'
752    CALL local_flush( 9 )
753    READ ( 13 )  variable_chr
754
755    DO  WHILE ( TRIM( variable_chr ) /= '*** end ***' )
756
757       SELECT CASE ( TRIM( variable_chr ) )
758
759          CASE ( 'average_count_pr' )
760             READ ( 13 )  average_count_pr
761             IF ( average_count_pr /= 0 )  THEN
762                WRITE( message_string, * ) 'inflow profiles not temporally ',  &
763                               'averaged. &Averaging will be done now using ', &
764                               average_count_pr, ' samples.'
765                CALL message( 'read_parts_of_var_list', 'PA0309', &
766                                                                 0, 1, 0, 6, 0 )
767             ENDIF
768
769          CASE ( 'hom' )
770             ALLOCATE( hom_on_file(0:nz+1,2,pr_palm+max_pr_user_on_file, &
771                       0:statistic_regions_on_file) )
772             READ ( 13 )  hom_on_file
773             hom(:,:,1:pr_palm+tmp_mpru,0:tmp_sr) = &
774                          hom_on_file(:,:,1:pr_palm+tmp_mpru,0:tmp_sr)
775             DEALLOCATE( hom_on_file )
776
777          CASE ( 'hom_sum' )
778             ALLOCATE( hom_sum_on_file(0:nz+1,pr_palm+max_pr_user_on_file, &
779                       0:statistic_regions_on_file) )
780             READ ( 13 )  hom_sum_on_file
781             hom_sum(:,1:pr_palm+tmp_mpru,0:tmp_sr) = &
782                          hom_sum_on_file(:,1:pr_palm+tmp_mpru,0:tmp_sr)
783             DEALLOCATE( hom_sum_on_file )
784
785          CASE ( 'nx' )
786             READ ( 13 )  nx_on_file
787
788          CASE ( 'ny' )
789             READ ( 13 )  ny_on_file
790
791
792          CASE DEFAULT
793
794             READ ( 13 )  idum
795
796       END SELECT
797
798       READ ( 13 )  variable_chr
799
800    ENDDO
801
802!
803!-- Calculate the temporal average of vertical profiles, if neccessary
804    IF ( average_count_pr /= 0 )  THEN
805       hom_sum = hom_sum / REAL( average_count_pr )
806    ENDIF
807
808
809 END SUBROUTINE read_parts_of_var_list
810
811
812
813 SUBROUTINE skip_var_list
814
815!------------------------------------------------------------------------------!
816! Description:
817! ------------
818! Skipping the global control variables from restart-file (binary format)
819!------------------------------------------------------------------------------!
820
821    IMPLICIT NONE
822
823    CHARACTER (LEN=10) ::  version_on_file
824    CHARACTER (LEN=30) ::  variable_chr
825
826    INTEGER ::  idum
827
828
829    WRITE (9,*) 'skipvl #1'
830    CALL local_flush( 9 )
831    READ ( 13 )  version_on_file
832
833    WRITE (9,*) 'skipvl before variable_chr'
834    CALL local_flush( 9 )
835    READ ( 13 )  variable_chr
836    WRITE (9,*) 'skipvl after variable_chr'
837    CALL local_flush( 9 )
838
839    DO  WHILE ( TRIM( variable_chr ) /= '*** end ***' )
840
841    WRITE (9,*) 'skipvl chr = ', variable_chr
842    CALL local_flush( 9 )
843       READ ( 13 )  idum
844       READ ( 13 )  variable_chr
845
846    ENDDO
847    WRITE (9,*) 'skipvl last'
848    CALL local_flush( 9 )
849
850
851 END SUBROUTINE skip_var_list
Note: See TracBrowser for help on using the repository browser.