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

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