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

Last change on this file since 343 was 336, checked in by raasch, 15 years ago

several small bugfixes; some more dvrp changes

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