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

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

preliminary checkin of new curvature/solution effects on droplet growth

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