/[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.1 - (hide annotations) (download)
Wed Apr 22 19:15:30 1998 UTC (26 years, 1 month ago) by cnh
Branch: MAIN
Branch point for: cnh
Initial revision

1 cnh 1.1 C $Id$
2    
3     #include "CPP_EEOPTIONS.h"
4    
5     CStartOfInterface
6     SUBROUTINE EEBOOT
7     C /==========================================================\
8     C | SUBROUTINE EEBOOT |
9     C | o Set up execution "environment", particularly perform |
10     C | steps to initialise parallel processing. |
11     C |==========================================================|
12     C | Note: This routine can also be compiled with CPP |
13     C | directives set so that no multi-processing is initialised|
14     C | This is OK and should work fine. |
15     C \==========================================================/
16    
17     C == Global variables ==
18     #include "SIZE.h"
19     #include "EEPARAMS.h"
20     #include "EESUPPORT.h"
21     CEndOfInterface
22    
23     C == Local variables ==
24     C msgBuf - Variable for building informational messages
25     C I - Loop counter
26     INTEGER I
27     CHARACTER*(MAX_LEN_MBUF) msgBuf
28    
29     C-- Set error reporting flags and I/O streams
30     C fatalError is a flag used to indicate that the program
31     C ended abnormally.
32     C errorMessageUnit is the Fortran unit number used for
33     C writing error messages.
34     C standardMessageUnit is the Fortran unit number used for
35     C writing textual, informational output.
36     C eeBootError is a flag used to indicate an error in the
37     C "execution environment" startup pahse as opposed
38     C to the simulation pahse of the execution.
39     C eeEndError is used to indicate an "execution environment" shutdown
40     C error.
41     C thError flag used to allow a thread to report an error.
42     C This is only really used during the startup process,
43     C although it could be used elsewhere.
44     C allMyEdgesAreSharedMemory flag which says for a particular
45     C set of blocks the only form of communication
46     C it does is using shared memory.
47     C threadIsRunning used during startup to enable check that all
48     C the threads are running.
49     fatalError = .FALSE.
50     errorMessageUnit = 0
51     standardMessageUnit = 6
52     eeBootError = .FALSE.
53     eeEndError = .FALSE.
54     DO I=1, MAX_NO_THREADS
55     thError(I) = .FALSE.
56     allMyEdgesAreSharedMemory(I) = .TRUE.
57     threadIsRunning(I) = .FALSE.
58     threadIsComplete(I) = .FALSE.
59     ENDDO
60     scrUnit1 = 11
61     scrUnit2 = 12
62     eeDataUnit = 13
63     modelDataUnit = 14
64     C Annoyingly there is no universal way to have the usingMPI
65     C parameter work as one might expect. This is because, on some
66     C systems I/O does not work until MPI_Init has been called. The
67     C solution for now is that the parameter below may need to be changed
68     C manually!
69     #ifdef ALLOW_USE_MPI
70     usingMPI = .TRUE.
71     #endif
72    
73     C-- Start minimal environment so that we can do I/O
74     C-- to report errors.
75     C Notes
76     C =====
77     C o Here we start MPI and setup the I/O environment
78     C thatis needed for error reporting.
79     C o Under MPI I/O support is very variable until
80     C MPI is started. This makes is hard to trap the case
81     C where mpirun is used to start a non-MPI run or
82     C we try to start MPI when mpirun was not used.
83     C after it is started.
84     CALL EEBOOT_MINIMAL
85     IF ( eeBootError ) GOTO 999
86    
87     C-- Now we can write a startup message
88     CALL EEINTRO_MSG
89    
90     C-- Initialise parameters associated with execution environment.
91     CALL EESET_PARMS
92     IF ( eeBootError ) GOTO 999
93    
94     C-- Write summary of execution environment configuration for this run
95     CALL EEWRITE_EEENV
96    
97     C-- Now do the rest of the multi-process startup.
98     C o Here we map processes to the model grid.
99     C o Print tables of process-grid mappings.
100     C o Do other miscellaneous multi-processing set up steps. For
101     C example under MPI we create datatypes for communication
102     C of array edges.
103     CALL INI_PROCS
104     IF ( eeBootError ) GOTO 999
105    
106     C-- Initialise variables to support "nThreads" of computation.
107     C o Note the program is still running with a single thread of
108     C execution at this stage.
109     CALL INI_THREADING_ENVIRONMENT
110     IF ( eeBootError ) GOTO 999
111    
112     999 CONTINUE
113     RETURN
114     END
115     C $Id: $

  ViewVC Help
Powered by ViewVC 1.1.22