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

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

leapfrog timestep scheme and upstream-spline advection scheme completely removed from the code,
reading of dt_fixed from restart file removed

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