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

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

two-moment cloud physics implemented

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