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

Last change on this file since 171 was 171, checked in by raasch, 16 years ago

compilation bugfix in read_var_list

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