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

Last change on this file since 1179 was 1179, checked in by raasch, 11 years ago

New:
---
Initial profiles can be used as reference state in the buoyancy term. New parameter
reference_state introduced. Calculation and handling of reference state in buoyancy term revised.
binary version for restart files changed from 3.9 to 3.9a (no downward compatibility!),
initial profile for rho added to hom (id=77)

Errors:


small bugfix for background communication (time_integration)

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