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

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

temperature equation can be switched off; bugfix of tridia_1dd for current Intel (12.1) compilers

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