source: palm/trunk/SOURCE/palm.f90 @ 75

Last change on this file since 75 was 75, checked in by raasch, 14 years ago

preliminary update for changes concerning non-cyclic boundary conditions

  • Property svn:keywords set to Id
File size: 4.8 KB
Line 
1 PROGRAM palm
2
3!------------------------------------------------------------------------------!
4! Actual revisions:
5! -----------------
6! __vtk directives removed, write_particles is called only in case of particle
7! advection switched on, open unit 9 for debug output,
8! setting of palm version moved from modules to here
9!
10! Former revisions:
11! -----------------
12! $Id: palm.f90 75 2007-03-22 09:54:05Z raasch $
13! RCS Log replace by Id keyword, revision history cleaned up
14!
15! Revision 1.10  2006/08/04 14:53:12  raasch
16! Distibution of run description header removed, call of header moved behind
17! init_3d_model
18!
19! Revision 1.2  2001/01/25 07:15:06  raasch
20! Program name changed to PALM, module test_variables removed.
21! Initialization of dvrp logging as well as exit of dvrp moved to new
22! subroutines init_dvrp_logging and close_dvrp (file init_dvrp.f90)
23!
24! Revision 1.1  1997/07/24 11:23:35  raasch
25! Initial revision
26!
27!
28! Description:
29! ------------
30! Large-Eddy Simulation (LES) model for the convective boundary layer,
31! optimized for use on parallel machines (implementation realized using the
32! Message Passing Interface (MPI)). The model can also be run on vector machines
33! (less well optimized) and workstations. Versions for the different types of
34! machines are controlled via cpp-directives.
35! Model runs are only feasible using the ksh-script mrun.
36!------------------------------------------------------------------------------!
37
38
39    USE arrays_3d
40    USE constants
41    USE cpulog
42    USE dvrp_variables
43    USE grid_variables
44    USE indices
45    USE interfaces
46    USE model_1d
47    USE particle_attributes
48    USE pegrid
49    USE spectrum
50    USE statistics
51    USE control_parameters
52
53    IMPLICIT NONE
54
55!
56!-- Local variables
57    CHARACTER (LEN=9) ::  time_to_string
58    CHARACTER (LEN=1) ::  cdum
59    INTEGER           ::  i, run_description_header_i(80)
60
61    version = 'PALM 3.2'
62
63#if defined( __parallel )
64!
65!-- MPI initialisation. comm2d is preliminary set, because
66!-- it will be defined in init_pegrid but is used before in cpu_log.
67    CALL MPI_INIT( ierr )
68    CALL MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr )
69    comm_palm = MPI_COMM_WORLD
70    comm2d    = MPI_COMM_WORLD
71#endif
72
73!
74!-- Initialize measuring of the CPU-time remaining to the run
75    CALL local_tremain_ini
76
77!
78!-- Start of total CPU time measuring.
79    CALL cpu_log( log_point(1), 'total', 'start' )
80    CALL cpu_log( log_point(2), 'initialisation', 'start' )
81
82!
83!-- Initialize dvrp logging. Also, one PE maybe split from the global
84!-- communicator for doing the dvrp output. In that case, the number of
85!-- PEs available for PALM is reduced by one and communicator comm_palm
86!-- is changed respectively.
87#if defined( __parallel )
88    CALL MPI_COMM_RANK( comm_palm, myid, ierr )
89#endif
90    CALL init_dvrp_logging
91
92!
93!-- Read control parameters from NAMELIST files and read environment-variables
94    CALL parin
95
96!
97!-- Determine processor topology and local array indices
98    CALL init_pegrid
99
100!
101!-- Open a file for debug output
102    OPEN( 9, FILE='DEBUG'//myid_char, FORM='FORMATTED' )
103
104!
105!-- Generate grid parameters
106    CALL init_grid
107
108!
109!-- Check control parameters and deduce further quantities
110    CALL check_parameters
111
112!
113!-- Initialize all necessary variables
114    CALL init_3d_model
115
116!
117!-- Output of program header
118    IF ( myid == 0 )  CALL header
119
120    CALL cpu_log( log_point(2), 'initialisation', 'stop' )
121
122!
123!-- Set start time in format hh:mm:ss
124    simulated_time_chr = time_to_string( simulated_time )
125
126!
127!-- If required, output of initial arrays
128    IF ( do2d_at_begin )  THEN
129       CALL data_output_2d( 'xy', 0 )
130       CALL data_output_2d( 'xz', 0 )
131       CALL data_output_2d( 'yz', 0 )
132    ENDIF
133    IF ( do3d_at_begin )  THEN
134       CALL data_output_3d( 0 )
135    ENDIF
136
137!
138!-- Integration of the model equations using the leap-frog scheme
139    CALL time_integration
140
141!
142!-- If required, write binary data for model continuation runs
143    IF ( write_binary(1:4) == 'true' )  CALL write_3d_binary
144
145!
146!-- If required, write binary particle data
147    IF ( particle_advection )  CALL write_particles
148
149!
150!-- If required, repeat output of header including the required CPU-time
151    IF ( myid == 0 )  CALL header
152
153!
154!-- If required, final user-defined actions, and
155!-- last actions on the open files and close files. Unit 14 was opened
156!-- in write_3d_binary but it is closed here, to allow writing on this
157!-- unit in routine user_last_actions.
158    CALL cpu_log( log_point(4), 'last actions', 'start' )
159    CALL user_last_actions
160    IF ( write_binary(1:4) == 'true' )  CALL close_file( 14 )
161    CALL close_file( 0 )
162    CALL close_dvrp
163    CALL cpu_log( log_point(4), 'last actions', 'stop' )
164
165!
166!-- Take final CPU-time for CPU-time analysis
167    CALL cpu_log( log_point(1), 'total', 'stop' )
168    CALL cpu_statistics
169
170#if defined( __parallel )
171    CALL MPI_FINALIZE( ierr )
172#endif
173
174 END PROGRAM palm
175
Note: See TracBrowser for help on using the repository browser.