/[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.14 - (hide annotations) (download)
Mon Mar 8 21:20:02 2004 UTC (20 years, 3 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint52l_pre, hrcube5, checkpoint52l_post
Changes since 1.13: +4 -3 lines
Renamed "USE_W2" to "ALLOW_EXCH2" so that it is no longer necessary to edit
CPP_EEOPTION.h as well as packages.conf to turn on/off exch2.
 - you can control the use of exch2 through packages.conf or -enable/disable.
 + need to add a run-time flag for this

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

  ViewVC Help
Powered by ViewVC 1.1.22