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

Last change on this file since 601 was 601, checked in by raasch, 13 years ago

last commit documented

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