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

Last change on this file since 1320 was 1320, checked in by raasch, 10 years ago

ONLY-attribute added to USE-statements,
kind-parameters added to all INTEGER and REAL declaration statements,
kinds are defined in new module kinds,
old module precision_kind is removed,
revision history before 2012 removed,
comment fields (!:) to be used for variable explanations added to all variable declaration statements

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