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

Last change on this file since 1054 was 1054, checked in by hoffmann, 11 years ago

last commit documented

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