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

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

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

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

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.22