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

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

last commit documented

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