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

Last change on this file since 978 was 978, checked in by fricke, 12 years ago

merge fricke branch back into trunk

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