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

Last change on this file since 1322 was 1322, checked in by raasch, 10 years ago

REAL functions and a lot of REAL constants provided with KIND-attribute,
some small bugfixes

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