source: palm/trunk/SOURCE/parin.f90 @ 72

Last change on this file since 72 was 72, checked in by raasch, 15 years ago

preliminary changes for precipitation output

  • Property svn:keywords set to Id
File size: 10.2 KB
Line 
1 SUBROUTINE parin
2
3!------------------------------------------------------------------------------!
4! Actual revisions:
5! -----------------
6! +dt_max, netcdf_64bit_3d, precipitation_amount_interval in d3par,
7! +loop_optimization, pt_reference in inipar, -data_output_ts
8!
9! Former revisions:
10! -----------------
11! $Id: parin.f90 72 2007-03-19 08:20:46Z raasch $
12!
13! 20 2007-02-26 00:12:32Z raasch
14! +top_heatflux, use_top_fluxes in inipar
15!
16! -netcdf_64bit_3d
17!
18! 3 2007-02-13 11:30:58Z raasch
19! +netcdf_64bit_3d in d3par,
20! RCS Log replace by Id keyword, revision history cleaned up
21!
22! Revision 1.57  2007/02/11 13:11:22  raasch
23! Values of environment variables are now read from file ENVPAR instead of
24! reading them with a system call, + NAMELIST envpar
25!
26! Revision 1.1  1997/07/24 11:22:50  raasch
27! Initial revision
28!
29!
30! Description:
31! ------------
32! This subroutine reads variables controling the run from the NAMELIST files
33!------------------------------------------------------------------------------!
34
35    USE arrays_3d
36    USE averaging
37    USE control_parameters
38    USE grid_variables
39    USE indices
40    USE model_1d
41    USE pegrid
42    USE profil_parameter
43    USE statistics
44
45    IMPLICIT NONE
46
47    INTEGER ::  idum
48
49
50    NAMELIST /inipar/  adjust_mixing_length, alpha_surface, bc_e_b, bc_lr, &
51                       bc_ns, bc_p_b, bc_p_t, bc_pt_b, bc_pt_t, bc_q_b, &
52                       bc_q_t,bc_s_b, bc_s_t, bc_uv_b, bc_uv_t, &
53                       building_height, building_length_x, building_length_y, &
54                       building_wall_left, building_wall_south, &
55                       cloud_droplets, cloud_physics, conserve_volume_flow, &
56                       cut_spline_overshoot, damp_level_1d, dissipation_1d, &
57                       dt, dt_pr_1d, dt_run_control_1d, dx, dy, dz, dz_max, &
58                       dz_stretch_factor, dz_stretch_level, e_min, &
59                       end_time_1d, fft_method, galilei_transformation, &
60                       grid_matching, inflow_disturbance_begin, &
61                       inflow_disturbance_end, initializing_actions, &
62                       km_constant, km_damp_max, long_filter_factor, &
63                       loop_optimization, mixing_length_1d, moisture, &
64                       momentum_advec, netcdf_precision, npex, npey, nsor_ini, &
65                       nx, ny, nz, omega, outflow_damping_width, &
66                       overshoot_limit_e, &
67                       overshoot_limit_pt, overshoot_limit_u, &
68                       overshoot_limit_v, overshoot_limit_w, passive_scalar, &
69                       phi, prandtl_layer, precipitation, pt_reference, &
70                       pt_surface, pt_surface_initial_change, &
71                       pt_vertical_gradient, pt_vertical_gradient_level, &
72                       q_surface, q_surface_initial_change, &
73                       q_vertical_gradient, q_vertical_gradient_level, &
74                       radiation, random_generator, random_heatflux, rif_max, &
75                       rif_min, roughness_length, scalar_advec, &
76                       statistic_regions, surface_heatflux, surface_pressure, &
77                       surface_scalarflux, surface_waterflux, s_surface, &
78                       s_surface_initial_change, s_vertical_gradient, &
79                       s_vertical_gradient_level, top_heatflux, &
80                       timestep_scheme, topography, ug_surface, &
81                       ug_vertical_gradient, ug_vertical_gradient_level, &
82                       ups_limit_e, ups_limit_pt, ups_limit_u, ups_limit_v, &
83                       ups_limit_w, use_surface_fluxes, use_top_fluxes, &
84                       use_ug_for_galilei_tr, use_upstream_for_tke, &
85                       vg_surface, vg_vertical_gradient, &
86                       vg_vertical_gradient_level, wall_adjustment, &
87                       wall_heatflux
88
89
90    NAMELIST /d3par/   averaging_interval,  averaging_interval_pr, &
91                       call_psolver_at_all_substeps, cfl_factor, &
92                       create_disturbances, cross_normalized_x, &
93                       cross_normalized_y, cross_profiles, cross_ts_uymax, &
94                       cross_ts_uymin, cross_xtext, cycle_mg, data_output, &
95                       data_output_format, data_output_pr, &
96                       data_output_2d_on_each_pe, disturbance_amplitude, &
97                       disturbance_energy_limit, disturbance_level_b, &
98                       disturbance_level_t, do2d_at_begin, do3d_at_begin, &
99                       do3d_compress, do3d_comp_prec, dt, dt_averaging_input, &
100                       dt_averaging_input_pr, dt_data_output, &
101                       dt_data_output_av, dt_disturb, dt_dopr, &
102                       dt_dopr_listing, dt_dots, dt_do2d_xy, dt_do2d_xz, &
103                       dt_do2d_yz, dt_do3d, dt_max, dt_restart, dt_run_control,&
104                       end_time, force_print_header, mg_cycles, &
105                       mg_switch_to_pe0_level, netcdf_64bit, netcdf_64bit_3d, &
106                       ngsrb, normalizing_region, nsor, nz_do3d, omega_sor, &
107                       prandtl_number, precipitation_amount_interval, &
108                       profile_columns, profile_rows, psolver, &
109                       rayleigh_damping_factor, rayleigh_damping_height, &
110                       residual_limit, restart_time, section_xy, section_xz, &
111                       section_yz, skip_time_data_output, &
112                       skip_time_data_output_av, skip_time_dopr, &
113                       skip_time_dosp, skip_time_do2d_xy, skip_time_do2d_xz, &
114                       skip_time_do2d_yz, skip_time_do3d, &
115                       termination_time_needed, use_prior_plot1d_parameters, &
116                       z_max_do1d, z_max_do1d_normalized, z_max_do2d
117
118
119    NAMELIST /envpar/  host, maximum_cpu_time_allowed, run_identifier, &
120                       tasks_per_node, write_binary
121
122
123#if defined( __parallel )
124!
125!-- Preliminary determination of processor-id which is needed here to open the
126!-- input files belonging to the corresponding processor and to produce
127!-- messages by PE0 only (myid and myid_char are later determined in
128!-- init_pegrid)
129    CALL MPI_COMM_RANK( comm_palm, myid, ierr )
130    WRITE (myid_char,'(''_'',I4.4)')  myid
131!
132!-- Since on IBM machines the process rank may be changed when the final
133!-- communicator is defined, save the preliminary processor-id for opening
134!-- the binary output file for restarts (unit 14), because otherwise
135!-- a mismatch occurs when reading this file in the next job
136    myid_char_14 = myid_char
137#endif
138
139!
140!-- Open the NAMELIST-file which is send with this job
141    CALL check_open( 11 )
142
143!
144!-- Read the control parameters for initialization.
145!-- The namelist "inipar" must be provided in the NAMELIST-file. If this is
146!-- not the case and the file contains - instead of "inipar" - any other
147!-- namelist, a read error is created on t3e and control is transferred
148!-- to the statement with label 10. Therefore, on t3e machines one can not
149!-- distinguish between errors produced by a wrong "inipar" namelist or
150!-- because this namelist is totally missing.
151    READ ( 11, inipar, ERR=10, END=11 )
152    GOTO 12
153 10 IF ( myid == 0 )  THEN
154       PRINT*, '+++ parin: errors in \$inipar'
155       PRINT*, '           or no \$inipar-namelist found (CRAY-machines only)' 
156    ENDIF
157    CALL local_stop
158 11 IF ( myid == 0 )  THEN
159       PRINT*, '+++ parin: no \$inipar-namelist found'
160    ENDIF
161    CALL local_stop
162
163!
164!-- If required, read control parameters from restart file (produced by
165!-- a prior run)
166 12 IF ( TRIM( initializing_actions ) == 'read_restart_data' )  THEN
167
168       CALL read_var_list
169!
170!--    Increment the run count
171       runnr = runnr + 1
172
173    ELSE
174!
175!--    This is not a restart job.
176!--    Check, if the grid point numbers are well defined.
177       IF ( nx <= 0 )  THEN
178          IF ( myid == 0 )  THEN
179             PRINT*, '+++ parin: no value or wrong value given for nx: nx=', nx
180          ENDIF
181          CALL local_stop
182       ENDIF
183       IF ( ny <= 0 )  THEN
184          IF ( myid == 0 )  THEN
185             PRINT*, '+++ parin: no value or wrong value given for ny: ny=', ny
186          ENDIF
187          CALL local_stop
188       ENDIF
189       IF ( nz <= 0 )  THEN
190          IF ( myid == 0 )  THEN
191             PRINT*, '+++ parin: no value or wrong value given for nz: nz=', nz
192          ENDIF
193          CALL local_stop
194       ENDIF
195
196!
197!--    Allocate arrays which will be already initialized in init_pegrid or
198!--    check_parameters. During restart jobs, these arrays will be allocated
199!--    in read_var_list. All other arrays are allocated in init_3d_model.
200       ALLOCATE( ug(0:nz+1), vg(0:nz+1), &
201                 pt_init(0:nz+1), q_init(0:nz+1), u_init(0:nz+1), &
202                 v_init(0:nz+1),                                  &
203                 hom(0:nz+1,2,var_hom,0:statistic_regions) )
204       hom = 0.0
205
206    ENDIF
207
208!
209!-- Definition of names of areas used for computing statistics. They must
210!-- be defined at this place, because they are allowed to be redefined by
211!-- the user in user_parin.
212    region = 'total domain'
213
214!
215!-- Read runtime parameters given by the user for this run (namelist "d3par").
216!-- The namelist "d3par" can be omitted. In that case, default values are
217!-- used for the parameters.
218    READ ( 11, d3par, END=20 )
219
220!
221!-- Read control parameters for optionally used model software packages
222 20 CALL package_parin
223
224!
225!-- Read user-defined variables
226    CALL user_parin
227
228!
229!-- NAMELIST-file is not needed anymore
230    CALL close_file( 11 )
231
232!
233!-- Read values of environment variables (this NAMELIST file is generated by
234!-- mrun)
235    OPEN ( 90, FILE='ENVPAR', STATUS='OLD', FORM='FORMATTED', ERR=30 )
236    READ ( 90, envpar, ERR=31, END=32 )
237    CLOSE ( 90 )
238    RETURN
239
240 30 IF ( myid == 0 )  THEN
241       PRINT*, '+++ parin: WARNING: local file ENVPAR not found'
242       PRINT*, '           some variables for steering may not be properly set'
243    ENDIF
244    RETURN
245
246 31 IF ( myid == 0 )  THEN
247       PRINT*, '+++ parin: WARNING: errors in local file ENVPAR'
248       PRINT*, '           some variables for steering may not be properly set'
249    ENDIF
250    RETURN
251
252 32 IF ( myid == 0 )  THEN
253       PRINT*, '+++ parin: WARNING: no envpar-NAMELIST found in local file ', &
254                           'ENVPAR'
255       PRINT*, '           some variables for steering may not be properly set'
256    ENDIF
257
258 END SUBROUTINE parin
Note: See TracBrowser for help on using the repository browser.