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

Last change on this file since 152 was 151, checked in by raasch, 16 years ago

preliminary update for the turbulence recycling method

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