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

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

last commit documented

  • Property svn:keywords set to Id
File size: 32.5 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 1002 2012-09-13 15:12:24Z 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 ( 'grid_matching' )
366             READ ( 13 )  grid_matching
367          CASE ( 'hom' )
368             READ ( 13 )  hom
369          CASE ( 'hom_sum' )
370             READ ( 13 )  hom_sum
371          CASE ( 'humidity' )
372             READ ( 13 )  humidity
373          CASE ( 'inflow_damping_factor' )
374             IF ( .NOT. ALLOCATED( inflow_damping_factor ) )  THEN
375                ALLOCATE( inflow_damping_factor(0:nz+1) )
376             ENDIF
377             READ ( 13 )  inflow_damping_factor
378          CASE ( 'inflow_damping_height' )
379             READ ( 13 )  inflow_damping_height
380          CASE ( 'inflow_damping_width' )
381             READ ( 13 )  inflow_damping_width
382          CASE ( 'inflow_disturbance_begin' )
383             READ ( 13 )  inflow_disturbance_begin
384          CASE ( 'inflow_disturbance_end' )
385             READ ( 13 )  inflow_disturbance_end
386          CASE ( 'km_constant' )
387             READ ( 13 )  km_constant
388          CASE ( 'lad' )
389             READ ( 13 )  lad
390          CASE ( 'lad_surface' )
391             READ ( 13 )  lad_surface
392          CASE ( 'lad_vertical_gradient' )
393             READ ( 13 )  lad_vertical_gradient
394          CASE ( 'lad_vertical_gradient_level' )
395             READ ( 13 )  lad_vertical_gradient_level
396          CASE ( 'lad_vertical_gradient_level_in' )
397             READ ( 13 )  lad_vertical_gradient_level_ind
398           CASE ( 'large_scale_subsidence' )
399             READ ( 13 )  large_scale_subsidence
400          CASE ( 'leaf_surface_concentration' )
401             READ ( 13 )  leaf_surface_concentration
402          CASE ( 'loop_optimization' )
403             READ ( 13 )  loop_optimization
404          CASE ( 'masking_method' )
405             READ ( 13 )  masking_method
406          CASE ( 'mean_inflow_profiles' )
407             IF ( .NOT. ALLOCATED( mean_inflow_profiles ) )  THEN
408                ALLOCATE( mean_inflow_profiles(0:nz+1,5) )
409             ENDIF
410             READ ( 13 )  mean_inflow_profiles
411          CASE ( 'mg_cycles' )
412             READ ( 13 )  mg_cycles
413          CASE ( 'mg_switch_to_pe0_level' )
414             READ ( 13 )  mg_switch_to_pe0_level
415          CASE ( 'mixing_length_1d' )
416             READ ( 13 )  mixing_length_1d
417          CASE ( 'momentum_advec' )
418             READ ( 13 )  momentum_advec
419          CASE ( 'netcdf_precision' )
420             READ ( 13 )  netcdf_precision
421          CASE ( 'neutral' )
422             READ ( 13 )  neutral
423          CASE ( 'ngsrb' )
424             READ ( 13 )  ngsrb
425          CASE ( 'nsor' )
426             READ ( 13 )  nsor
427          CASE ( 'nsor_ini' )
428             READ ( 13 )  nsor_ini
429          CASE ( 'nx' )
430             READ ( 13 )  nx
431             nx_on_file = nx
432          CASE ( 'ny' )
433             READ ( 13 )  ny
434             ny_on_file = ny
435          CASE ( 'ocean' )
436             READ ( 13 )  ocean
437          CASE ( 'old_dt' )
438             READ ( 13 )  old_dt
439          CASE ( 'omega' )
440             READ ( 13 )  omega
441          CASE ( 'omega_sor' )
442             READ ( 13 )  omega_sor
443          CASE ( 'output_for_t0' )
444             READ (13)    output_for_t0
445          CASE ( 'passive_scalar' )
446             READ ( 13 )  passive_scalar
447          CASE ( 'pch_index' )
448             READ ( 13 )  pch_index
449          CASE ( 'phi' )
450             READ ( 13 )  phi
451          CASE ( 'plant_canopy' )
452             READ ( 13 )  plant_canopy
453          CASE ( 'prandtl_layer' )
454             READ ( 13 )  prandtl_layer
455          CASE ( 'prandtl_number' )
456             READ ( 13 )  prandtl_number
457          CASE ( 'precipitation' )
458             READ ( 13 ) precipitation
459          CASE ( 'psolver' )
460             READ ( 13 )  psolver
461          CASE ( 'pt_damping_factor' )
462             READ ( 13 )  pt_damping_factor
463          CASE ( 'pt_damping_width' )
464             READ ( 13 )  pt_damping_width
465          CASE ( 'pt_init' )
466             READ ( 13 )  pt_init
467          CASE ( 'pt_reference' )
468             READ ( 13 )  pt_reference
469          CASE ( 'pt_surface' )
470             READ ( 13 )  pt_surface
471          CASE ( 'pt_surface_initial_change' )
472             READ ( 13 )  pt_surface_initial_change
473          CASE ( 'pt_vertical_gradient' )
474             READ ( 13 )  pt_vertical_gradient
475          CASE ( 'pt_vertical_gradient_level' )
476             READ ( 13 )  pt_vertical_gradient_level
477          CASE ( 'pt_vertical_gradient_level_ind' )
478             READ ( 13 )  pt_vertical_gradient_level_ind
479          CASE ( 'q_init' )
480             READ ( 13 )  q_init
481          CASE ( 'q_surface' )
482             READ ( 13 )  q_surface
483          CASE ( 'q_surface_initial_change' )
484             READ ( 13 )  q_surface_initial_change
485          CASE ( 'q_vertical_gradient' )
486             READ ( 13 )  q_vertical_gradient
487          CASE ( 'q_vertical_gradient_level' )
488             READ ( 13 )  q_vertical_gradient_level
489          CASE ( 'q_vertical_gradient_level_ind' )
490             READ ( 13 )  q_vertical_gradient_level_ind
491          CASE ( 'radiation' )
492             READ ( 13 )  radiation
493          CASE ( 'random_generator' )
494             READ ( 13 )  random_generator
495          CASE ( 'random_heatflux' )
496             READ ( 13 )  random_heatflux
497          CASE ( 'rayleigh_damping_factor' )
498             READ ( 13 )  rayleigh_damping_factor
499          CASE ( 'rayleigh_damping_height' )
500             READ ( 13 )  rayleigh_damping_height
501          CASE ( 'recycling_width' )
502             READ ( 13 )  recycling_width
503          CASE ( 'residual_limit' )
504             READ ( 13 )  residual_limit
505          CASE ( 'rif_max' )
506             READ ( 13 )  rif_max
507          CASE ( 'rif_min' )
508             READ ( 13 )  rif_min
509          CASE ( 'roughness_length' )
510             READ ( 13 )  roughness_length
511          CASE ( 'runnr' )
512             READ ( 13 )  runnr
513          CASE ( 'run_coupled' )
514             READ ( 13 )  run_coupled
515          CASE ( 'sa_init' )
516             READ ( 13 )  sa_init
517          CASE ( 'sa_surface' )
518             READ ( 13 )  sa_surface
519          CASE ( 'sa_vertical_gradient' )
520             READ ( 13 )  sa_vertical_gradient
521          CASE ( 'sa_vertical_gradient_level' )
522             READ ( 13 )  sa_vertical_gradient_level
523          CASE ( 'scalar_advec' )
524             READ ( 13 )  scalar_advec
525          CASE ( 'scalar_exchange_coefficient' )
526             READ ( 13 )  scalar_exchange_coefficient
527          CASE ( 'simulated_time' )
528             READ ( 13 )  simulated_time
529          CASE ( 'surface_heatflux' )
530             READ ( 13 )  surface_heatflux
531          CASE ( 'surface_pressure' )
532             READ ( 13 )  surface_pressure
533          CASE ( 'surface_scalarflux' )
534             READ ( 13 )  surface_scalarflux             
535          CASE ( 'surface_waterflux' )
536             READ ( 13 )  surface_waterflux             
537          CASE ( 's_surface' )
538             READ ( 13 )  s_surface
539          CASE ( 's_surface_initial_change' )
540             READ ( 13 )  s_surface_initial_change
541          CASE ( 's_vertical_gradient' )
542             READ ( 13 )  s_vertical_gradient
543          CASE ( 's_vertical_gradient_level' )
544             READ ( 13 )  s_vertical_gradient_level
545          CASE ( 'time_coupling' )
546             READ ( 13 )  time_coupling
547          CASE ( 'time_disturb' )
548             READ ( 13 )  time_disturb
549          CASE ( 'time_dopr' )
550             READ ( 13 )  time_dopr
551          CASE ( 'time_domask' )
552             READ ( 13 )  time_domask
553          CASE ( 'time_dopr_av' )
554             READ ( 13 )  time_dopr_av
555          CASE ( 'time_dopr_listing' )
556             READ ( 13 )  time_dopr_listing
557          CASE ( 'time_dopts' )
558             READ ( 13 )  time_dopts
559          CASE ( 'time_dosp' )
560             READ ( 13 )  time_dosp
561          CASE ( 'time_dots' )
562             READ ( 13 )  time_dots
563          CASE ( 'time_do2d_xy' )
564             READ ( 13 )  time_do2d_xy
565          CASE ( 'time_do2d_xz' )
566             READ ( 13 )  time_do2d_xz
567          CASE ( 'time_do2d_yz' )
568             READ ( 13 )  time_do2d_yz
569          CASE ( 'time_do3d' )
570             READ ( 13 )  time_do3d
571          CASE ( 'time_do_av' )
572             READ ( 13 )  time_do_av
573          CASE ( 'time_do_sla' )
574             READ ( 13 )  time_do_sla
575          CASE ( 'time_dvrp' )
576             READ ( 13 )  time_dvrp
577          CASE ( 'time_restart' )
578             READ ( 13 )  time_restart
579          CASE ( 'time_run_control' )
580             READ ( 13 )  time_run_control
581          CASE ( 'time_since_reference_point' )
582             READ ( 13 )  time_since_reference_point
583          CASE ( 'time_sort_particles' )
584             READ ( 13 )  time_sort_particles
585          CASE ( 'timestep_scheme' )
586             READ ( 13 )  timestep_scheme
587          CASE ( 'topography' )
588             READ ( 13 )  topography
589          CASE ( 'topography_grid_convention' )
590             READ ( 13 )  topography_grid_convention
591          CASE ( 'top_heatflux' )
592             READ ( 13 )  top_heatflux
593          CASE ( 'top_momentumflux_u' )
594             READ ( 13 )  top_momentumflux_u
595          CASE ( 'top_momentumflux_v' )
596             READ ( 13 )  top_momentumflux_v
597          CASE ( 'top_salinityflux' )
598             READ ( 13 )  top_salinityflux
599          CASE ( 'tsc' )
600             READ ( 13 )  tsc
601          CASE ( 'turbulent_inflow' )
602             READ ( 13 )  turbulent_inflow
603          CASE ( 'u_bulk' )
604             READ ( 13 )  u_bulk
605          CASE ( 'u_init' )
606             READ ( 13 )  u_init
607          CASE ( 'u_max' )
608             READ ( 13 )  u_max
609          CASE ( 'u_max_ijk' )
610             READ ( 13 )  u_max_ijk
611          CASE ( 'ug' )
612             READ ( 13 )  ug
613          CASE ( 'ug_surface' )
614             READ ( 13 )  ug_surface
615          CASE ( 'ug_vertical_gradient' )
616             READ ( 13 )  ug_vertical_gradient
617          CASE ( 'ug_vertical_gradient_level' )
618             READ ( 13 )  ug_vertical_gradient_level
619          CASE ( 'ug_vertical_gradient_level_ind' )
620             READ ( 13 )  ug_vertical_gradient_level_ind
621          CASE ( 'use_surface_fluxes' )
622             READ ( 13 )  use_surface_fluxes
623          CASE ( 'use_top_fluxes' )
624             READ ( 13 )  use_top_fluxes
625          CASE ( 'use_ug_for_galilei_tr' )
626             READ ( 13 )  use_ug_for_galilei_tr
627          CASE ( 'use_upstream_for_tke' )
628             READ ( 13 )  use_upstream_for_tke
629          CASE ( 'v_bulk' )
630             READ ( 13 )  v_bulk
631          CASE ( 'v_init' )
632             READ ( 13 )  v_init
633          CASE ( 'v_max' )
634             READ ( 13 )  v_max
635          CASE ( 'v_max_ijk' )
636             READ ( 13 )  v_max_ijk
637          CASE ( 'vg' )
638             READ ( 13 )  vg
639          CASE ( 'vg_surface' )
640             READ ( 13 )  vg_surface
641          CASE ( 'vg_vertical_gradient' )
642             READ ( 13 )  vg_vertical_gradient
643          CASE ( 'vg_vertical_gradient_level' )
644             READ ( 13 )  vg_vertical_gradient_level
645          CASE ( 'vg_vertical_gradient_level_ind' )
646             READ ( 13 )  vg_vertical_gradient_level_ind
647          CASE ( 'volume_flow_area' )
648             READ ( 13 )  volume_flow_area
649          CASE ( 'volume_flow_initial' )
650             READ ( 13 )  volume_flow_initial
651          CASE ( 'wall_adjustment' )
652             READ ( 13 )  wall_adjustment
653          CASE ( 'subs_vertical_gradient' )
654             READ ( 13 )  subs_vertical_gradient
655          CASE ( 'subs_vertical_gradient_level' )
656             READ ( 13 )  subs_vertical_gradient_level
657          CASE ( 'subs_vertical_gradient_level_i' )
658             READ ( 13 )  subs_vertical_gradient_level_i
659          CASE ( 'w_max' )
660             READ ( 13 )  w_max
661          CASE ( 'w_max_ijk' )
662             READ ( 13 )  w_max_ijk
663          CASE ( 'z0h_factor' )
664             READ ( 13 )  z0h_factor
665
666          CASE DEFAULT
667             WRITE( message_string, * ) 'unknown variable named "',         &
668                                        TRIM( variable_chr ), '" found in', &
669                                        ' data from prior run on PE ', myid 
670             CALL message( 'read_var_list', 'PA0302', 1, 2, 0, 6, 0 )
671        END SELECT
672!
673!--    Read next string
674       READ ( 13 )  variable_chr
675
676    ENDDO
677
678
679 END SUBROUTINE read_var_list
680
681
682
683 SUBROUTINE read_parts_of_var_list
684
685!------------------------------------------------------------------------------!
686! Description:
687! ------------
688! Skipping the global control variables from restart-file (binary format)
689! except some informations needed when reading restart data from a previous
690! run which used a smaller total domain or/and a different domain decomposition.
691!------------------------------------------------------------------------------!
692
693    USE arrays_3d
694    USE control_parameters
695    USE indices
696    USE pegrid
697    USE statistics
698
699    IMPLICIT NONE
700
701    CHARACTER (LEN=10) ::  version_on_file
702    CHARACTER (LEN=30) ::  variable_chr
703    CHARACTER (LEN=1)  ::  cdum
704
705    INTEGER ::  idum, max_pr_user_on_file, nz_on_file, &
706                statistic_regions_on_file, tmp_mpru, tmp_sr
707
708    REAL, DIMENSION(:,:,:),   ALLOCATABLE ::  hom_sum_on_file
709    REAL, DIMENSION(:,:,:,:), ALLOCATABLE ::  hom_on_file
710
711
712    CALL check_open( 13 )
713
714    WRITE (9,*) 'rpovl: after check open 13'
715    CALL local_flush( 9 )
716    READ ( 13 )  version_on_file
717
718!
719!-- Read number of PEs and horizontal index bounds of all PEs used in previous
720!-- run
721    READ ( 13 )  variable_chr
722    IF ( TRIM( variable_chr ) /= 'numprocs' )  THEN
723       WRITE( message_string, * ) 'numprocs not found in data from prior ', &
724                                  'run on PE ', myid
725       CALL message( 'read_parts_of_var_list', 'PA0297', 1, 2, 0, 6, 0 )
726    ENDIF
727    READ ( 13 )  numprocs_previous_run
728
729    IF ( .NOT. ALLOCATED( hor_index_bounds_previous_run ) )  THEN
730       ALLOCATE( hor_index_bounds_previous_run(4,0:numprocs_previous_run-1) )
731    ENDIF
732
733    READ ( 13 )  variable_chr
734    IF ( TRIM( variable_chr ) /= 'hor_index_bounds' )  THEN
735       WRITE( message_string, * ) 'hor_index_bounds not found in data from ', &
736                                  'prior run on PE ', myid
737       CALL message( 'read_parts_of_var_list', 'PA0298', 1, 2, 0, 6, 0 )
738    ENDIF
739    READ ( 13 )  hor_index_bounds_previous_run
740
741!
742!-- Read vertical number of gridpoints and number of different areas used
743!-- for computing statistics. Allocate arrays depending on these values,
744!-- which are needed for the following read instructions.
745    READ ( 13 )  variable_chr
746    IF ( TRIM( variable_chr ) /= 'nz' )  THEN
747       message_string = 'nz not found in restart data file'
748       CALL message( 'read_parts_of_var_list', 'PA0303', 1, 2, 0, 6, 0 )
749    ENDIF
750    READ ( 13 )  nz_on_file
751    IF ( nz_on_file /= nz )  THEN
752       WRITE( message_string, * ) 'mismatch concerning number of ',      &
753                                  'gridpoints along z',                  &
754                                  '&nz on file    = "', nz_on_file, '"', &
755                                  '&nz from run   = "', nz, '"'
756       CALL message( 'read_parts_of_var_list', 'PA0304', 1, 2, 0, 6, 0 )
757    ENDIF
758
759    READ ( 13 )  variable_chr
760    IF ( TRIM( variable_chr ) /= 'max_pr_user' )  THEN
761       message_string = 'max_pr_user not found in restart data file'
762       CALL message( 'read_parts_of_var_list', 'PA0305', 1, 2, 0, 6, 0 )
763    ENDIF
764    READ ( 13 )  max_pr_user_on_file
765    IF ( max_pr_user_on_file /= max_pr_user )  THEN
766       WRITE( message_string, * ) 'number of user profiles on res',           &
767                                  'tart data file differs from the current ', &
768                                  'run&max_pr_user on file    = "',           &
769                                  max_pr_user_on_file, '"',                   &
770                                  '&max_pr_user from run   = "',              &
771                                  max_pr_user, '"'
772       CALL message( 'read_parts_of_var_list', 'PA0306', 0, 0, 0, 6, 0 )
773       tmp_mpru = MIN( max_pr_user_on_file, max_pr_user )
774    ELSE
775       tmp_mpru = max_pr_user
776    ENDIF
777
778    READ ( 13 )  variable_chr
779    IF ( TRIM( variable_chr ) /= 'statistic_regions' )  THEN
780       message_string = 'statistic_regions not found in restart data file'
781       CALL message( 'read_parts_of_var_list', 'PA0307', 1, 2, 0, 6, 0 )
782    ENDIF
783    READ ( 13 )  statistic_regions_on_file
784    IF ( statistic_regions_on_file /= statistic_regions )  THEN
785       WRITE( message_string, * ) 'statistic regions on restart data file ',& 
786                                  'differ from the current run',            &
787                                  '&statistic regions on file    = "',      &
788                                  statistic_regions_on_file, '"',           &
789                                  '&statistic regions from run   = "',      &
790                                   statistic_regions, '"',                  &
791                                  '&statistic data may be lost!'
792       CALL message( 'read_parts_of_var_list', 'PA0308', 0, 1, 0, 6, 0 )
793       tmp_sr = MIN( statistic_regions_on_file, statistic_regions )
794    ELSE
795       tmp_sr = statistic_regions
796    ENDIF
797
798
799!
800!-- Now read and check some control parameters and skip the rest
801    WRITE (9,*) 'wpovl: begin reading variables'
802    CALL local_flush( 9 )
803    READ ( 13 )  variable_chr
804
805    DO  WHILE ( TRIM( variable_chr ) /= '*** end ***' )
806
807       SELECT CASE ( TRIM( variable_chr ) )
808
809          CASE ( 'average_count_pr' )
810             READ ( 13 )  average_count_pr
811             IF ( average_count_pr /= 0 )  THEN
812                WRITE( message_string, * ) 'inflow profiles not temporally ',  &
813                               'averaged. &Averaging will be done now using ', &
814                               average_count_pr, ' samples.'
815                CALL message( 'read_parts_of_var_list', 'PA0309', &
816                                                                 0, 1, 0, 6, 0 )
817             ENDIF
818
819          CASE ( 'hom' )
820             ALLOCATE( hom_on_file(0:nz+1,2,pr_palm+max_pr_user_on_file, &
821                       0:statistic_regions_on_file) )
822             READ ( 13 )  hom_on_file
823             hom(:,:,1:pr_palm+tmp_mpru,0:tmp_sr) = &
824                          hom_on_file(:,:,1:pr_palm+tmp_mpru,0:tmp_sr)
825             DEALLOCATE( hom_on_file )
826
827          CASE ( 'hom_sum' )
828             ALLOCATE( hom_sum_on_file(0:nz+1,pr_palm+max_pr_user_on_file, &
829                       0:statistic_regions_on_file) )
830             READ ( 13 )  hom_sum_on_file
831             hom_sum(:,1:pr_palm+tmp_mpru,0:tmp_sr) = &
832                          hom_sum_on_file(:,1:pr_palm+tmp_mpru,0:tmp_sr)
833             DEALLOCATE( hom_sum_on_file )
834
835          CASE ( 'nx' )
836             READ ( 13 )  nx_on_file
837
838          CASE ( 'ny' )
839             READ ( 13 )  ny_on_file
840
841
842          CASE DEFAULT
843
844             READ ( 13 )  cdum
845
846       END SELECT
847
848       READ ( 13 )  variable_chr
849
850    ENDDO
851
852!
853!-- Calculate the temporal average of vertical profiles, if neccessary
854    IF ( average_count_pr /= 0 )  THEN
855       hom_sum = hom_sum / REAL( average_count_pr )
856    ENDIF
857
858
859 END SUBROUTINE read_parts_of_var_list
860
861
862
863 SUBROUTINE skip_var_list
864
865!------------------------------------------------------------------------------!
866! Description:
867! ------------
868! Skipping the global control variables from restart-file (binary format)
869!------------------------------------------------------------------------------!
870
871    IMPLICIT NONE
872
873    CHARACTER (LEN=10) ::  version_on_file
874    CHARACTER (LEN=30) ::  variable_chr
875
876    CHARACTER (LEN=1) ::  cdum
877
878
879    WRITE (9,*) 'skipvl #1'
880    CALL local_flush( 9 )
881    READ ( 13 )  version_on_file
882
883    WRITE (9,*) 'skipvl before variable_chr'
884    CALL local_flush( 9 )
885    READ ( 13 )  variable_chr
886    WRITE (9,*) 'skipvl after variable_chr'
887    CALL local_flush( 9 )
888
889    DO  WHILE ( TRIM( variable_chr ) /= '*** end ***' )
890
891    WRITE (9,*) 'skipvl chr = ', variable_chr
892    CALL local_flush( 9 )
893       READ ( 13 )  cdum
894       READ ( 13 )  variable_chr
895
896    ENDDO
897    WRITE (9,*) 'skipvl last'
898    CALL local_flush( 9 )
899
900
901 END SUBROUTINE skip_var_list
Note: See TracBrowser for help on using the repository browser.