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

Last change on this file since 1502 was 1502, checked in by kanani, 9 years ago

canopy parameters removed

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