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

Last change on this file since 600 was 600, checked in by raasch, 13 years ago

New:
---

Changed:


Parameters moved from d3par to inipar: call_psolver_at_all_substeps,
cfl_factor, cycle_mg, mg_cycles,mg_switch_to_pe0_level, ngsrb, nsor,
omega_sor, prandtl_number, psolver, rayleigh_damping_factor,
rayleigh_damping_height, residual_limit (parin, read_var_list, write_var_list)

Due to this change, in routine skip_var_list (end of file read_var_list.f90),
variable ldum is replaced by cdum(LEN=1), because otherwise read errors (too
few data on file) would appear due to one of the additional parameters
(cycle_mg, which is a string of one single character) which are now stored
on the restart file.

Weblink to error message database changed to new trac server (message)

Errors:


Bugfix concerning check of cross-section levels on netcdf-files to be
extended (xz,yz) (netcdf)

Bugfix in opening of cross section netcdf-files (parallel opening with
netcdf4 only works for netcdf_data_format > 2) (check_open)

Default values of surface_scalarflux and surface_waterflux changed from 0.0
to 9999999.9. Giving the parameter the default values means, that the
respective surface fluxes are calculated by the MO-relations, so the old default
value did not allow to set the surface fluxes to zero explicitly.

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