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

Last change on this file since 1036 was 1036, checked in by raasch, 11 years ago

code has been put under the GNU General Public License (v3)

  • Property svn:keywords set to Id
File size: 33.2 KB
Line 
1 SUBROUTINE read_var_list
2
3!--------------------------------------------------------------------------------!
4! This file is part of PALM.
5!
6! PALM is free software: you can redistribute it and/or modify it under the terms
7! of the GNU General Public License as published by the Free Software Foundation,
8! either version 3 of the License, or (at your option) any later version.
9!
10! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
11! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13!
14! You should have received a copy of the GNU General Public License along with
15! PALM. If not, see <http://www.gnu.org/licenses/>.
16!
17! Copyright 1997-2012  Leibniz University Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! ------------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: read_var_list.f90 1036 2012-10-22 13:43:42Z raasch $
27!
28! 1015 2012-09-27 09:23:24Z raasch
29! -adjust_mixing_length
30!
31! 1003 2012-09-14 14:35:53Z raasch
32! -grid_matching
33!
34! 1001 2012-09-13 14:08:46Z raasch
35! -cut_spline_overshoot, dt_fixed, last_dt_change, long_filter_factor,
36! overshoot_limit_*, ups_limit_*
37!
38! 978 2012-08-09 08:28:32Z fricke
39! -km_damp_max, outflow_damping_width
40! +pt_damping_factor, pt_damping_width
41! +z0h_factor
42!
43! 940 2012-07-09 14:31:00Z raasch
44! +neutral
45!
46! 927 2012-06-06 19:15:04Z raasch
47! +masking_method
48!
49! 849 2012-03-15 10:35:09Z raasch
50! first_call_advec_particles renamed first_call_lpm
51!
52! 824 2012-02-17 09:09:57Z raasch
53! +curvature_solution_effects
54!
55! 626 2010-12-10 13:04:12Z suehring
56! idum replaced by cdum in read_parts_of_var_list
57!
58! 622 2010-12-10 08:08:13Z raasch
59! +collective_wait
60!
61! 600 2010-11-24 16:10:51Z raasch
62! +call_psolver_at_all_substeps, cfl_factor, cycle_mg, mg_cycles,
63! mg_switch_to_pe0_level, ngsrb, nsor, omega_sor, psolver,
64! rayleigh_damping_factor, rayleigh_damping_height, residual_limit
65! in routine skip_var_list (end of this file), variable ldum is replaced
66! by cdum(LEN=1), because otherwise read errors (too few data on file)
67! appear due to one of the additional parameters (cycle_mg) which are now
68! stored on the restart file
69!
70! 591 2010-10-28 06:35:52Z helmke
71! remove print command
72!
73! 587 2010-10-27 08:36:51Z helmke
74! +time_domask
75!
76! 580 2010-10-05 13:59:11Z heinze
77! Renaming of ws_vertical_gradient to subs_vertical_gradient,
78! ws_vertical_gradient_level to subs_vertical_gradient_level and
79! ws_vertical_gradient_level_ind to subs_vertical_gradient_level_i
80!
81! 411 2009-12-11 14:15:58Z heinze
82! +large_scale_subsidence, ws_vertical_gradient, ws_vertical_gradient_level,
83! ws_vertical_gradient_level_ind
84!
85! 345 2009-07-01 14:37:56Z heinze
86! +output_for_t0
87! dt_fixed is read into a dummy variable.
88! Output of messages replaced by message handling routine.
89! +canyon_height, canyon_width_x, canyon_width_y, canyon_wall_left,
90! canyon_wall_south, conserve_volume_flow_mode, coupling_start_time,
91! dp_external, dp_level_b, dp_smooth, dpdxy, run_coupled,
92! time_since_reference_point, topography_grid_convention, u_bulk, v_bulk
93!
94! 216 2008-11-25 07:12:43Z raasch
95! limitations for nx_on_file, ny_on_file removed (read_parts_of_var_list)
96!
97! 173 2008-05-23 20:39:38Z raasch
98! +cthf, leaf_surface_concentration, scalar_exchange_coefficient
99! +numprocs_previous_run, hor_index_bounds_previous_run, inflow_damping_factor,
100! inflow_damping_height, inflow_damping_width, mean_inflow_profiles,
101! recycling_width, turbulent_inflow,
102! -cross_ts_*, npex, npey,
103! hom_sum, volume_flow_area, volume_flow_initial moved from
104! read_3d_binary to here,
105! routines read_parts_of_var_list and skip_var_list added at the end
106!
107! 138 2007-11-28 10:03:58Z letzel
108! +canopy_mode, drag_coefficient, lad, lad_surface, lad_vertical_gradient,
109! lad_vertical_gradient_level, lad_vertical_gradient_level_ind, pch_index,
110! plant_canopy, time_sort_particles
111!
112! 102 2007-07-27 09:09:17Z raasch
113! +time_coupling, top_momentumflux_u|v
114!
115! 95 2007-06-02 16:48:38Z raasch
116! +bc_sa_t, ocean, sa_init, sa_surface, sa_vertical_gradient,
117! sa_vertical_gradient_level, bottom/top_salinity_flux
118!
119! 87 2007-05-22 15:46:47Z raasch
120! +max_pr_user (version 3.1), var_hom renamed pr_palm
121!
122! 75 2007-03-22 09:54:05Z raasch
123! +loop_optimization, pt_reference, moisture renamed humidity
124!
125! 20 2007-02-26 00:12:32Z raasch
126! +top_heatflux, use_top_fluxes
127!
128! RCS Log replace by Id keyword, revision history cleaned up
129!
130! Revision 1.34  2006/08/22 14:14:27  raasch
131! +dz_max
132!
133! Revision 1.1  1998/03/18 20:18:48  raasch
134! Initial revision
135!
136!
137! Description:
138! ------------
139! Reading values of global control variables from restart-file (binary format)
140!------------------------------------------------------------------------------!
141
142    USE arrays_3d
143    USE averaging
144    USE cloud_parameters
145    USE control_parameters
146    USE grid_variables
147    USE indices
148    USE model_1d
149    USE netcdf_control
150    USE particle_attributes
151    USE pegrid
152    USE profil_parameter
153    USE statistics
154
155    IMPLICIT NONE
156
157    CHARACTER (LEN=10) ::  binary_version, version_on_file
158    CHARACTER (LEN=30) ::  variable_chr
159
160    LOGICAL ::  ldum
161
162
163    CALL check_open( 13 )
164
165!
166!-- Make version number check first
167    READ ( 13 )  version_on_file
168    binary_version = '3.5'
169    IF ( TRIM( version_on_file ) /= TRIM( binary_version ) )  THEN
170       WRITE( message_string, * ) 'version mismatch concerning control ', &
171                                  'variables',                            &
172                                  '&version on file    = "',              &
173                                  TRIM( version_on_file ), '"',           &
174                                  '&version on program = "',              &
175                                  TRIM( binary_version ), '"'
176       CALL message( 'read_var_list', 'PA0296', 1, 2, 0, 6, 0 )
177    ENDIF
178
179!
180!-- Read number of PEs and horizontal index bounds of all PEs used in previous
181!-- run
182    READ ( 13 )  variable_chr
183    IF ( TRIM( variable_chr ) /= 'numprocs' )  THEN
184       WRITE( message_string, * ) 'numprocs not found in data from prior ', &
185                                  'run on PE ', myid
186       CALL message( 'read_var_list', 'PA0297', 1, 2, 0, 6, 0 )
187    ENDIF
188    READ ( 13 )  numprocs_previous_run
189
190    IF ( .NOT. ALLOCATED( hor_index_bounds_previous_run ) )  THEN
191       ALLOCATE( hor_index_bounds_previous_run(4,0:numprocs_previous_run-1) )
192    ENDIF
193
194    READ ( 13 )  variable_chr
195    IF ( TRIM( variable_chr ) /= 'hor_index_bounds' )  THEN
196       WRITE( message_string, * ) 'hor_index_bounds not found in data from ', &
197                                  'prior run on PE ', myid
198       CALL message( 'read_var_list', 'PA0298', 1, 2, 0, 6, 0 )
199    ENDIF
200    READ ( 13 )  hor_index_bounds_previous_run
201
202!
203!-- Read vertical number of gridpoints and number of different areas used
204!-- for computing statistics. Allocate arrays depending on these values,
205!-- which are needed for the following read instructions.
206    READ ( 13 )  variable_chr
207    IF ( TRIM( variable_chr ) /= 'nz' )  THEN
208       WRITE( message_string, * ) 'nz not found in data from prior run on PE ',&
209                                  myid
210       CALL message( 'read_var_list', 'PA0299', 1, 2, 0, 6, 0 )
211    ENDIF
212    READ ( 13 )  nz
213
214    READ ( 13 )  variable_chr
215    IF ( TRIM( variable_chr ) /= 'max_pr_user' )  THEN
216       WRITE( message_string, * ) 'max_pr_user not found in data from ', &
217                    'prior run on PE ', myid
218       CALL message( 'read_var_list', 'PA0300', 1, 2, 0, 6, 0 )
219    ENDIF
220    READ ( 13 )  max_pr_user    ! This value is checked against the number of
221                                ! user profiles given for the current run
222                                ! in routine user_parin (it has to match)
223
224    READ ( 13 )  variable_chr
225    IF ( TRIM( variable_chr ) /= 'statistic_regions' )  THEN
226       WRITE( message_string, * ) 'statistic_regions not found in data from ', &
227                    'prior run on PE ', myid
228       CALL message( 'read_var_list', 'PA0301', 1, 2, 0, 6, 0 )
229    ENDIF
230    READ ( 13 )  statistic_regions
231    IF ( .NOT. ALLOCATED( ug ) )  THEN
232       ALLOCATE( lad(0:nz+1), ug(0:nz+1), u_init(0:nz+1), vg(0:nz+1),    &
233                 v_init(0:nz+1), pt_init(0:nz+1), q_init(0:nz+1),        &
234                 sa_init(0:nz+1),                                        &
235                 hom(0:nz+1,2,pr_palm+max_pr_user,0:statistic_regions),  &
236                 hom_sum(0:nz+1,pr_palm+max_pr_user,0:statistic_regions) )
237    ENDIF
238
239!
240!-- Now read all control parameters:
241!-- Caution: When the following read instructions have been changed, the
242!-- -------  version number stored in the variable binary_version has to be
243!--          increased. The same changes must also be done in write_var_list.
244    READ ( 13 )  variable_chr
245    DO  WHILE ( TRIM( variable_chr ) /= '*** end ***' )
246
247       SELECT CASE ( TRIM( variable_chr ) )
248
249          CASE ( 'advected_distance_x' )
250             READ ( 13 )  advected_distance_x
251          CASE ( 'advected_distance_y' )
252             READ ( 13 )  advected_distance_y
253          CASE ( 'alpha_surface' )
254             READ ( 13 )  alpha_surface
255          CASE ( 'average_count_pr' )
256             READ ( 13 )  average_count_pr
257          CASE ( 'average_count_sp' )
258             READ ( 13 )  average_count_sp
259          CASE ( 'average_count_3d' )
260             READ ( 13 )  average_count_3d
261          CASE ( 'bc_e_b' )
262             READ ( 13 )  bc_e_b
263          CASE ( 'bc_lr' )
264             READ ( 13 )  bc_lr
265          CASE ( 'bc_ns' )
266             READ ( 13 )  bc_ns
267          CASE ( 'bc_p_b' )
268             READ ( 13 )  bc_p_b
269          CASE ( 'bc_p_t' )
270             READ ( 13 )  bc_p_t
271          CASE ( 'bc_pt_b' )
272             READ ( 13 )  bc_pt_b
273          CASE ( 'bc_pt_t' )
274             READ ( 13 )  bc_pt_t
275          CASE ( 'bc_pt_t_val' )
276             READ ( 13 )  bc_pt_t_val
277          CASE ( 'bc_q_b' )
278             READ ( 13 )  bc_q_b
279          CASE ( 'bc_q_t' )
280             READ ( 13 )  bc_q_t
281          CASE ( 'bc_q_t_val' )
282             READ ( 13 )  bc_q_t_val
283          CASE ( 'bc_s_b' )
284             READ ( 13 )  bc_s_b
285          CASE ( 'bc_s_t' )
286             READ ( 13 )  bc_s_t
287          CASE ( 'bc_sa_t' )
288             READ ( 13 )  bc_sa_t
289          CASE ( 'bc_uv_b' )
290             READ ( 13 )  bc_uv_b
291          CASE ( 'bc_uv_t' )
292             READ ( 13 )  bc_uv_t
293          CASE ( 'bottom_salinityflux' )
294             READ ( 13 )  bottom_salinityflux
295          CASE ( 'building_height' )
296             READ ( 13 )  building_height
297          CASE ( 'building_length_x' )
298             READ ( 13 )  building_length_x
299          CASE ( 'building_length_y' )
300             READ ( 13 )  building_length_y
301          CASE ( 'building_wall_left' )
302             READ ( 13 )  building_wall_left
303          CASE ( 'building_wall_south' )
304             READ ( 13 )  building_wall_south
305          CASE ( 'call_psolver_at_all_substeps' )
306             READ ( 13 )  call_psolver_at_all_substeps
307          CASE ( 'canopy_mode' )
308             READ ( 13 )  canopy_mode
309          CASE ( 'canyon_height' )
310             READ ( 13 )  canyon_height
311          CASE ( 'canyon_width_x' )
312             READ ( 13 )  canyon_width_x
313          CASE ( 'canyon_width_y' )
314             READ ( 13 )  canyon_width_y
315          CASE ( 'canyon_wall_left' )
316             READ ( 13 )  canyon_wall_left
317          CASE ( 'canyon_wall_south' )
318             READ ( 13 )  canyon_wall_south
319          CASE ( 'cfl_factor' )
320             READ ( 13 )  cfl_factor
321          CASE ( 'cloud_droplets' )
322             READ ( 13 )  cloud_droplets
323          CASE ( 'cloud_physics' )
324             READ ( 13 )  cloud_physics
325          CASE ( 'collective_wait' )
326             READ ( 13 )  collective_wait
327          CASE ( 'conserve_volume_flow' )
328             READ ( 13 )  conserve_volume_flow
329          CASE ( 'conserve_volume_flow_mode' )
330             READ ( 13 )  conserve_volume_flow_mode
331          CASE ( 'coupling_start_time' )
332             READ ( 13 )  coupling_start_time
333          CASE ( 'cthf' )
334             READ ( 13 )  cthf
335          CASE ( 'current_timestep_number' )
336             READ ( 13 )  current_timestep_number
337          CASE ( 'curvature_solution_effects' )
338             READ ( 13 )  curvature_solution_effects
339          CASE ( 'cycle_mg' )
340             READ ( 13 )  cycle_mg
341          CASE ( 'damp_level_1d' )
342             READ ( 13 )  damp_level_1d
343          CASE ( 'dissipation_1d' )
344             READ ( 13 )  dissipation_1d
345          CASE ( 'dp_external' )
346             READ ( 13 )  dp_external
347          CASE ( 'dp_level_b' )
348             READ ( 13 )  dp_level_b
349          CASE ( 'dp_smooth' )
350             READ ( 13 )  dp_smooth
351          CASE ( 'dpdxy' )
352             READ ( 13 )  dpdxy
353          CASE ( 'drag_coefficient' )
354             READ ( 13 )  drag_coefficient
355          CASE ( 'dt_pr_1d' )
356             READ ( 13 )  dt_pr_1d
357          CASE ( 'dt_run_control_1d' )
358             READ ( 13 )  dt_run_control_1d
359          CASE ( 'dt_3d' )
360             READ ( 13 )  dt_3d
361          CASE ( 'dvrp_filecount' )
362             READ ( 13 )  dvrp_filecount
363          CASE ( 'dx' )
364             READ ( 13 )  dx
365          CASE ( 'dy' )
366             READ ( 13 )  dy
367          CASE ( 'dz' )
368             READ ( 13 )  dz
369          CASE ( 'dz_max' )
370             READ ( 13 )  dz_max
371          CASE ( 'dz_stretch_factor' )
372             READ ( 13 )  dz_stretch_factor
373          CASE ( 'dz_stretch_level' )
374             READ ( 13 )  dz_stretch_level
375          CASE ( 'e_min' )
376             READ ( 13 )  e_min
377          CASE ( 'end_time_1d' )
378             READ ( 13 )  end_time_1d
379          CASE ( 'fft_method' )
380             READ ( 13 )  fft_method
381          CASE ( 'first_call_lpm' )
382             READ ( 13 )  first_call_lpm
383          CASE ( 'galilei_transformation' )
384             READ ( 13 )  galilei_transformation
385          CASE ( 'hom' )
386             READ ( 13 )  hom
387          CASE ( 'hom_sum' )
388             READ ( 13 )  hom_sum
389          CASE ( 'humidity' )
390             READ ( 13 )  humidity
391          CASE ( 'inflow_damping_factor' )
392             IF ( .NOT. ALLOCATED( inflow_damping_factor ) )  THEN
393                ALLOCATE( inflow_damping_factor(0:nz+1) )
394             ENDIF
395             READ ( 13 )  inflow_damping_factor
396          CASE ( 'inflow_damping_height' )
397             READ ( 13 )  inflow_damping_height
398          CASE ( 'inflow_damping_width' )
399             READ ( 13 )  inflow_damping_width
400          CASE ( 'inflow_disturbance_begin' )
401             READ ( 13 )  inflow_disturbance_begin
402          CASE ( 'inflow_disturbance_end' )
403             READ ( 13 )  inflow_disturbance_end
404          CASE ( 'km_constant' )
405             READ ( 13 )  km_constant
406          CASE ( 'lad' )
407             READ ( 13 )  lad
408          CASE ( 'lad_surface' )
409             READ ( 13 )  lad_surface
410          CASE ( 'lad_vertical_gradient' )
411             READ ( 13 )  lad_vertical_gradient
412          CASE ( 'lad_vertical_gradient_level' )
413             READ ( 13 )  lad_vertical_gradient_level
414          CASE ( 'lad_vertical_gradient_level_in' )
415             READ ( 13 )  lad_vertical_gradient_level_ind
416           CASE ( 'large_scale_subsidence' )
417             READ ( 13 )  large_scale_subsidence
418          CASE ( 'leaf_surface_concentration' )
419             READ ( 13 )  leaf_surface_concentration
420          CASE ( 'loop_optimization' )
421             READ ( 13 )  loop_optimization
422          CASE ( 'masking_method' )
423             READ ( 13 )  masking_method
424          CASE ( 'mean_inflow_profiles' )
425             IF ( .NOT. ALLOCATED( mean_inflow_profiles ) )  THEN
426                ALLOCATE( mean_inflow_profiles(0:nz+1,5) )
427             ENDIF
428             READ ( 13 )  mean_inflow_profiles
429          CASE ( 'mg_cycles' )
430             READ ( 13 )  mg_cycles
431          CASE ( 'mg_switch_to_pe0_level' )
432             READ ( 13 )  mg_switch_to_pe0_level
433          CASE ( 'mixing_length_1d' )
434             READ ( 13 )  mixing_length_1d
435          CASE ( 'momentum_advec' )
436             READ ( 13 )  momentum_advec
437          CASE ( 'netcdf_precision' )
438             READ ( 13 )  netcdf_precision
439          CASE ( 'neutral' )
440             READ ( 13 )  neutral
441          CASE ( 'ngsrb' )
442             READ ( 13 )  ngsrb
443          CASE ( 'nsor' )
444             READ ( 13 )  nsor
445          CASE ( 'nsor_ini' )
446             READ ( 13 )  nsor_ini
447          CASE ( 'nx' )
448             READ ( 13 )  nx
449             nx_on_file = nx
450          CASE ( 'ny' )
451             READ ( 13 )  ny
452             ny_on_file = ny
453          CASE ( 'ocean' )
454             READ ( 13 )  ocean
455          CASE ( 'old_dt' )
456             READ ( 13 )  old_dt
457          CASE ( 'omega' )
458             READ ( 13 )  omega
459          CASE ( 'omega_sor' )
460             READ ( 13 )  omega_sor
461          CASE ( 'output_for_t0' )
462             READ (13)    output_for_t0
463          CASE ( 'passive_scalar' )
464             READ ( 13 )  passive_scalar
465          CASE ( 'pch_index' )
466             READ ( 13 )  pch_index
467          CASE ( 'phi' )
468             READ ( 13 )  phi
469          CASE ( 'plant_canopy' )
470             READ ( 13 )  plant_canopy
471          CASE ( 'prandtl_layer' )
472             READ ( 13 )  prandtl_layer
473          CASE ( 'prandtl_number' )
474             READ ( 13 )  prandtl_number
475          CASE ( 'precipitation' )
476             READ ( 13 ) precipitation
477          CASE ( 'psolver' )
478             READ ( 13 )  psolver
479          CASE ( 'pt_damping_factor' )
480             READ ( 13 )  pt_damping_factor
481          CASE ( 'pt_damping_width' )
482             READ ( 13 )  pt_damping_width
483          CASE ( 'pt_init' )
484             READ ( 13 )  pt_init
485          CASE ( 'pt_reference' )
486             READ ( 13 )  pt_reference
487          CASE ( 'pt_surface' )
488             READ ( 13 )  pt_surface
489          CASE ( 'pt_surface_initial_change' )
490             READ ( 13 )  pt_surface_initial_change
491          CASE ( 'pt_vertical_gradient' )
492             READ ( 13 )  pt_vertical_gradient
493          CASE ( 'pt_vertical_gradient_level' )
494             READ ( 13 )  pt_vertical_gradient_level
495          CASE ( 'pt_vertical_gradient_level_ind' )
496             READ ( 13 )  pt_vertical_gradient_level_ind
497          CASE ( 'q_init' )
498             READ ( 13 )  q_init
499          CASE ( 'q_surface' )
500             READ ( 13 )  q_surface
501          CASE ( 'q_surface_initial_change' )
502             READ ( 13 )  q_surface_initial_change
503          CASE ( 'q_vertical_gradient' )
504             READ ( 13 )  q_vertical_gradient
505          CASE ( 'q_vertical_gradient_level' )
506             READ ( 13 )  q_vertical_gradient_level
507          CASE ( 'q_vertical_gradient_level_ind' )
508             READ ( 13 )  q_vertical_gradient_level_ind
509          CASE ( 'radiation' )
510             READ ( 13 )  radiation
511          CASE ( 'random_generator' )
512             READ ( 13 )  random_generator
513          CASE ( 'random_heatflux' )
514             READ ( 13 )  random_heatflux
515          CASE ( 'rayleigh_damping_factor' )
516             READ ( 13 )  rayleigh_damping_factor
517          CASE ( 'rayleigh_damping_height' )
518             READ ( 13 )  rayleigh_damping_height
519          CASE ( 'recycling_width' )
520             READ ( 13 )  recycling_width
521          CASE ( 'residual_limit' )
522             READ ( 13 )  residual_limit
523          CASE ( 'rif_max' )
524             READ ( 13 )  rif_max
525          CASE ( 'rif_min' )
526             READ ( 13 )  rif_min
527          CASE ( 'roughness_length' )
528             READ ( 13 )  roughness_length
529          CASE ( 'runnr' )
530             READ ( 13 )  runnr
531          CASE ( 'run_coupled' )
532             READ ( 13 )  run_coupled
533          CASE ( 'sa_init' )
534             READ ( 13 )  sa_init
535          CASE ( 'sa_surface' )
536             READ ( 13 )  sa_surface
537          CASE ( 'sa_vertical_gradient' )
538             READ ( 13 )  sa_vertical_gradient
539          CASE ( 'sa_vertical_gradient_level' )
540             READ ( 13 )  sa_vertical_gradient_level
541          CASE ( 'scalar_advec' )
542             READ ( 13 )  scalar_advec
543          CASE ( 'scalar_exchange_coefficient' )
544             READ ( 13 )  scalar_exchange_coefficient
545          CASE ( 'simulated_time' )
546             READ ( 13 )  simulated_time
547          CASE ( 'surface_heatflux' )
548             READ ( 13 )  surface_heatflux
549          CASE ( 'surface_pressure' )
550             READ ( 13 )  surface_pressure
551          CASE ( 'surface_scalarflux' )
552             READ ( 13 )  surface_scalarflux             
553          CASE ( 'surface_waterflux' )
554             READ ( 13 )  surface_waterflux             
555          CASE ( 's_surface' )
556             READ ( 13 )  s_surface
557          CASE ( 's_surface_initial_change' )
558             READ ( 13 )  s_surface_initial_change
559          CASE ( 's_vertical_gradient' )
560             READ ( 13 )  s_vertical_gradient
561          CASE ( 's_vertical_gradient_level' )
562             READ ( 13 )  s_vertical_gradient_level
563          CASE ( 'time_coupling' )
564             READ ( 13 )  time_coupling
565          CASE ( 'time_disturb' )
566             READ ( 13 )  time_disturb
567          CASE ( 'time_dopr' )
568             READ ( 13 )  time_dopr
569          CASE ( 'time_domask' )
570             READ ( 13 )  time_domask
571          CASE ( 'time_dopr_av' )
572             READ ( 13 )  time_dopr_av
573          CASE ( 'time_dopr_listing' )
574             READ ( 13 )  time_dopr_listing
575          CASE ( 'time_dopts' )
576             READ ( 13 )  time_dopts
577          CASE ( 'time_dosp' )
578             READ ( 13 )  time_dosp
579          CASE ( 'time_dots' )
580             READ ( 13 )  time_dots
581          CASE ( 'time_do2d_xy' )
582             READ ( 13 )  time_do2d_xy
583          CASE ( 'time_do2d_xz' )
584             READ ( 13 )  time_do2d_xz
585          CASE ( 'time_do2d_yz' )
586             READ ( 13 )  time_do2d_yz
587          CASE ( 'time_do3d' )
588             READ ( 13 )  time_do3d
589          CASE ( 'time_do_av' )
590             READ ( 13 )  time_do_av
591          CASE ( 'time_do_sla' )
592             READ ( 13 )  time_do_sla
593          CASE ( 'time_dvrp' )
594             READ ( 13 )  time_dvrp
595          CASE ( 'time_restart' )
596             READ ( 13 )  time_restart
597          CASE ( 'time_run_control' )
598             READ ( 13 )  time_run_control
599          CASE ( 'time_since_reference_point' )
600             READ ( 13 )  time_since_reference_point
601          CASE ( 'time_sort_particles' )
602             READ ( 13 )  time_sort_particles
603          CASE ( 'timestep_scheme' )
604             READ ( 13 )  timestep_scheme
605          CASE ( 'topography' )
606             READ ( 13 )  topography
607          CASE ( 'topography_grid_convention' )
608             READ ( 13 )  topography_grid_convention
609          CASE ( 'top_heatflux' )
610             READ ( 13 )  top_heatflux
611          CASE ( 'top_momentumflux_u' )
612             READ ( 13 )  top_momentumflux_u
613          CASE ( 'top_momentumflux_v' )
614             READ ( 13 )  top_momentumflux_v
615          CASE ( 'top_salinityflux' )
616             READ ( 13 )  top_salinityflux
617          CASE ( 'tsc' )
618             READ ( 13 )  tsc
619          CASE ( 'turbulent_inflow' )
620             READ ( 13 )  turbulent_inflow
621          CASE ( 'u_bulk' )
622             READ ( 13 )  u_bulk
623          CASE ( 'u_init' )
624             READ ( 13 )  u_init
625          CASE ( 'u_max' )
626             READ ( 13 )  u_max
627          CASE ( 'u_max_ijk' )
628             READ ( 13 )  u_max_ijk
629          CASE ( 'ug' )
630             READ ( 13 )  ug
631          CASE ( 'ug_surface' )
632             READ ( 13 )  ug_surface
633          CASE ( 'ug_vertical_gradient' )
634             READ ( 13 )  ug_vertical_gradient
635          CASE ( 'ug_vertical_gradient_level' )
636             READ ( 13 )  ug_vertical_gradient_level
637          CASE ( 'ug_vertical_gradient_level_ind' )
638             READ ( 13 )  ug_vertical_gradient_level_ind
639          CASE ( 'use_surface_fluxes' )
640             READ ( 13 )  use_surface_fluxes
641          CASE ( 'use_top_fluxes' )
642             READ ( 13 )  use_top_fluxes
643          CASE ( 'use_ug_for_galilei_tr' )
644             READ ( 13 )  use_ug_for_galilei_tr
645          CASE ( 'use_upstream_for_tke' )
646             READ ( 13 )  use_upstream_for_tke
647          CASE ( 'v_bulk' )
648             READ ( 13 )  v_bulk
649          CASE ( 'v_init' )
650             READ ( 13 )  v_init
651          CASE ( 'v_max' )
652             READ ( 13 )  v_max
653          CASE ( 'v_max_ijk' )
654             READ ( 13 )  v_max_ijk
655          CASE ( 'vg' )
656             READ ( 13 )  vg
657          CASE ( 'vg_surface' )
658             READ ( 13 )  vg_surface
659          CASE ( 'vg_vertical_gradient' )
660             READ ( 13 )  vg_vertical_gradient
661          CASE ( 'vg_vertical_gradient_level' )
662             READ ( 13 )  vg_vertical_gradient_level
663          CASE ( 'vg_vertical_gradient_level_ind' )
664             READ ( 13 )  vg_vertical_gradient_level_ind
665          CASE ( 'volume_flow_area' )
666             READ ( 13 )  volume_flow_area
667          CASE ( 'volume_flow_initial' )
668             READ ( 13 )  volume_flow_initial
669          CASE ( 'wall_adjustment' )
670             READ ( 13 )  wall_adjustment
671          CASE ( 'subs_vertical_gradient' )
672             READ ( 13 )  subs_vertical_gradient
673          CASE ( 'subs_vertical_gradient_level' )
674             READ ( 13 )  subs_vertical_gradient_level
675          CASE ( 'subs_vertical_gradient_level_i' )
676             READ ( 13 )  subs_vertical_gradient_level_i
677          CASE ( 'w_max' )
678             READ ( 13 )  w_max
679          CASE ( 'w_max_ijk' )
680             READ ( 13 )  w_max_ijk
681          CASE ( 'z0h_factor' )
682             READ ( 13 )  z0h_factor
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.