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

Last change on this file since 1242 was 1242, checked in by heinze, 10 years ago

Last commmit documented

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