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

Last change on this file since 150 was 147, checked in by raasch, 16 years ago

further updates for turbulent inflow: reading input data of a precursor run using a smaller total domain is working

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