/[MITgcm]/MITgcm/eesupp/src/eeboot.F
ViewVC logotype

Annotation of /MITgcm/eesupp/src/eeboot.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.12 - (hide annotations) (download)
Mon Dec 15 02:02:38 2003 UTC (20 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint52e_pre, checkpoint52e_post, checkpoint52f_pre, checkpoint52d_post
Changes since 1.11: +11 -1 lines
allow multi-components set-up with a coupler interface and using MPI.

1 jmc 1.12 C $Header: /u/gcmpack/MITgcm/eesupp/src/eeboot.F,v 1.11 2002/03/24 02:07:14 heimbach Exp $
2 cnh 1.10 C $Name: $
3 cnh 1.1
4     #include "CPP_EEOPTIONS.h"
5    
6 cnh 1.10 CBOP
7     C !ROUTINE: EEBOOT
8    
9     C !INTERFACE:
10 cnh 1.1 SUBROUTINE EEBOOT
11 adcroft 1.5 IMPLICIT NONE
12 cnh 1.1
13 cnh 1.10 C !DESCRIPTION:
14     C *==========================================================*
15     C | SUBROUTINE EEBOOT
16     C | o Set up execution "environment", particularly perform
17     C | steps to initialise parallel processing.
18     C *==========================================================*
19     C | Note: This routine can also be compiled with CPP
20     C | directives set so that no multi-processing is initialised
21     C | This is OK and works fine.
22     C *==========================================================*
23    
24     C !CALLING SEQUENCE:
25     C eeboot()
26     C |
27     C |-- eeboot_minimal() :: Minimal startup. Just enough to
28     C | allow basic I/O.
29     C |
30     C |-- eeintro_msg() :: Write startup greeting.
31     C |
32     C |-- eeset_parms() :: Set WRAPPER parameters
33     C |
34     C |-- eewrite_eeenv() :: Print WRAPPER parameter settings
35     C |
36     C |-- ini_procs() :: Associate processes with grid regions.
37     C |
38     C |-- ini_threading_environment() :: Associate threads with grid regions.
39     C |
40     C |-- dfile_init() :: Initialise simple multi-process I/O pacakge.
41    
42     C !USES:
43 cnh 1.1 C == Global variables ==
44     #include "SIZE.h"
45     #include "EEPARAMS.h"
46     #include "EESUPPORT.h"
47    
48 cnh 1.10 C !LOCAL VARIABLES:
49 cnh 1.1 C == Local variables ==
50 cnh 1.10 C I :: Loop counter
51 cnh 1.1 INTEGER I
52 cnh 1.10 CEOP
53 cnh 1.1
54     C-- Set error reporting flags and I/O streams
55     C fatalError is a flag used to indicate that the program
56     C ended abnormally.
57     C errorMessageUnit is the Fortran unit number used for
58     C writing error messages.
59     C standardMessageUnit is the Fortran unit number used for
60     C writing textual, informational output.
61     C eeBootError is a flag used to indicate an error in the
62     C "execution environment" startup pahse as opposed
63     C to the simulation pahse of the execution.
64     C eeEndError is used to indicate an "execution environment" shutdown
65     C error.
66     C thError flag used to allow a thread to report an error.
67     C This is only really used during the startup process,
68     C although it could be used elsewhere.
69     C allMyEdgesAreSharedMemory flag which says for a particular
70     C set of blocks the only form of communication
71     C it does is using shared memory.
72     C threadIsRunning used during startup to enable check that all
73     C the threads are running.
74     fatalError = .FALSE.
75     eeBootError = .FALSE.
76     eeEndError = .FALSE.
77     DO I=1, MAX_NO_THREADS
78     thError(I) = .FALSE.
79     allMyEdgesAreSharedMemory(I) = .TRUE.
80     threadIsRunning(I) = .FALSE.
81     threadIsComplete(I) = .FALSE.
82 cnh 1.4 ioErrorCount(I) = 0
83 cnh 1.1 ENDDO
84 heimbach 1.11 standardMessageUnit = 6
85     scrUnit1 = 11
86     scrUnit2 = 12
87     eeDataUnit = 13
88     modelDataUnit = 14
89     errorMessageUnit = 15
90     cph errorMessageUnit = 0 is not allowed on some platforms, e.g. SP3
91     C
92 cnh 1.1 C Annoyingly there is no universal way to have the usingMPI
93     C parameter work as one might expect. This is because, on some
94     C systems I/O does not work until MPI_Init has been called. The
95     C solution for now is that the parameter below may need to be changed
96     C manually!
97     #ifdef ALLOW_USE_MPI
98     usingMPI = .TRUE.
99     #endif
100    
101     C-- Start minimal environment so that we can do I/O
102     C-- to report errors.
103     C Notes
104     C =====
105     C o Here we start MPI and setup the I/O environment
106     C thatis needed for error reporting.
107     C o Under MPI I/O support is very variable until
108     C MPI is started. This makes is hard to trap the case
109     C where mpirun is used to start a non-MPI run or
110     C we try to start MPI when mpirun was not used.
111     C after it is started.
112 jmc 1.12 C jmc: test:
113     C If necessary ( COMPONENT_MODULE defined ) add a 1rst preliminary
114     C call to eeset_params (in EEBOOT_MINIMAL) to set useCoupler (needed
115     C very early, and the stardard call eeset_params below comes too late)
116     C jmc: This needs to be sorted-out in a cleaner way.
117 cnh 1.1 CALL EEBOOT_MINIMAL
118     IF ( eeBootError ) GOTO 999
119    
120     C-- Now we can write a startup message
121     CALL EEINTRO_MSG
122    
123     C-- Initialise parameters associated with execution environment.
124     CALL EESET_PARMS
125     IF ( eeBootError ) GOTO 999
126    
127     C-- Write summary of execution environment configuration for this run
128     CALL EEWRITE_EEENV
129    
130     C-- Now do the rest of the multi-process startup.
131     C o Here we map processes to the model grid.
132     C o Print tables of process-grid mappings.
133     C o Do other miscellaneous multi-processing set up steps. For
134     C example under MPI we create datatypes for communication
135     C of array edges.
136     CALL INI_PROCS
137 adcroft 1.6 #ifdef LETS_MAKE_JAM
138     CALL INI_JAM
139     #endif
140 cnh 1.1 IF ( eeBootError ) GOTO 999
141    
142     C-- Initialise variables to support "nThreads" of computation.
143     C o Note the program is still running with a single thread of
144     C execution at this stage.
145     CALL INI_THREADING_ENVIRONMENT
146     IF ( eeBootError ) GOTO 999
147 jmc 1.12
148     C-- Pass attributes to the coupler
149     #ifdef COMPONENT_MODULE
150     IF ( useCoupler ) CALL CPL_REGISTER
151     #endif
152 cnh 1.4
153 adcroft 1.7 #ifdef USE_DFILE
154 cnh 1.4 C-- Initiialise the multi-process IO package
155     CALL DFILE_INIT
156 adcroft 1.7 #endif
157 cnh 1.1
158     999 CONTINUE
159     RETURN
160     END

  ViewVC Help
Powered by ViewVC 1.1.22