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

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