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

Last change on this file since 626 was 626, checked in by suehring, 13 years ago

idum replaced by cdum

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