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

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

keyword inserted to parin

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