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

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

cloud physics: rain sedimentation and turbulence effects

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