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

Last change on this file since 1496 was 1496, checked in by maronga, 9 years ago

added beta version of a land surface model and a simple radiation model for clear sky conditions

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