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

Last change on this file since 1239 was 1239, checked in by heinze, 10 years ago

routines for nudging and large scale forcing from external file added

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