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

Last change on this file since 1003 was 1003, checked in by raasch, 12 years ago

subdomains must have identical size, i.e. grid_matching = "match" not allowed any more
parameter grid_matching removed
some obsolete variables removed

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