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

Last change on this file since 1250 was 1242, checked in by heinze, 11 years ago

Last commmit documented

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