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

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

New:
---

Optional barriers included in order to speed up collective operations
MPI_ALLTOALL and MPI_ALLREDUCE. This feature is controlled with new initial
parameter collective_wait. Default is .FALSE, but .TRUE. on SGI-type
systems. (advec_particles, advec_s_bc, buoyancy, check_for_restart,
cpu_statistics, data_output_2d, data_output_ptseries, flow_statistics,
global_min_max, inflow_turbulence, init_3d_model, init_particles, init_pegrid,
init_slope, parin, pres, poismg, set_particle_attributes, timestep,
read_var_list, user_statistics, write_compressed, write_var_list)

Adjustments for Kyushu Univ. (lcrte, ibmku). Concerning hybrid
(MPI/openMP) runs, the number of openMP threads per MPI tasks can now
be given as an argument to mrun-option -O. (mbuild, mrun, subjob)

Changed:


Initialization of the module command changed for SGI-ICE/lcsgi (mbuild, subjob)

Errors:


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