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

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

last commit documented

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