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

Last change on this file since 1484 was 1484, checked in by kanani, 10 years ago

New:
---
Subroutine init_plant_canopy added to module plant_canopy_model_mod. (plant_canopy_model)
Alternative method for lad-profile construction added, also, new parameters added.
(header, package_parin, plant_canopy_model, read_var_list, write_var_list)
plant_canopy_model-dependency added to several subroutines. (Makefile)
New package/namelist canopy_par for canopy-related parameters added. (package_parin)

Changed:
---
Code structure of the plant canopy model changed, all canopy-model related code
combined to module plant_canopy_model_mod. (check_parameters, init_3d_model,
modules, timestep)
Module plant_canopy_model_mod added in USE-lists of some subroutines. (check_parameters,
header, init_3d_model, package_parin, read_var_list, user_init_plant_canopy, write_var_list)
Canopy initialization moved to new subroutine init_plant_canopy. (check_parameters,
init_3d_model, plant_canopy_model)
Calculation of canopy timestep-criterion removed, instead, the canopy
drag is now directly limited in the calculation of the canopy tendency terms.
(plant_canopy_model, timestep)
Some parameters renamed. (check_parameters, header, init_plant_canopy,
plant_canopy_model, read_var_list, write_var_list)
Unnecessary 3d-arrays removed. (init_plant_canopy, plant_canopy_model, user_init_plant_canopy)
Parameter checks regarding canopy initialization added. (check_parameters)
All canopy steering parameters moved from namelist inipar to canopy_par. (package_parin, parin)
Some redundant MPI communication removed. (init_plant_canopy)

Bugfix:
---
Missing KIND-attribute for REAL constant added. (check_parameters)
DO-WHILE-loop for lad-profile output restricted. (header)
Removed double-listing of use_upstream_for_tke in ONLY-list of module
control_parameters. (prognostic_equations)

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