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

Last change on this file since 1067 was 1066, checked in by hoffmann, 11 years ago

last commit documented

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