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

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