/[MITgcm]/MITgcm/pkg/exch2/w2_eeboot.F
ViewVC logotype

Diff of /MITgcm/pkg/exch2/w2_eeboot.F

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

revision 1.10 by jmc, Wed May 6 01:03:41 2009 UTC revision 1.11 by jmc, Tue May 12 19:40:32 2009 UTC
# Line 24  C     !USES: Line 24  C     !USES:
24  #include "SIZE.h"  #include "SIZE.h"
25  #include "EEPARAMS.h"  #include "EEPARAMS.h"
26  #include "EESUPPORT.h"  #include "EESUPPORT.h"
27    #include "W2_EXCH2_SIZE.h"
28  #include "W2_EXCH2_TOPOLOGY.h"  #include "W2_EXCH2_TOPOLOGY.h"
29  #include "W2_EXCH2_PARAMS.h"  #include "W2_EXCH2_PARAMS.h"
30    #include "W2_EXCH2_BUFFER.h"
31  CEOP  CEOP
32    
33  C     !FUNCTIONS:  C     !FUNCTIONS:
# Line 36  C     == Local variables == Line 38  C     == Local variables ==
38        INTEGER nt_perProc, thisProc        INTEGER nt_perProc, thisProc
39        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
40        CHARACTER*(MAX_LEN_FNAM) fName        CHARACTER*(MAX_LEN_FNAM) fName
41        INTEGER W2_oUnit  c     INTEGER W2_oUnit
42        INTEGER stdUnit, iLen        INTEGER stdUnit, iLen
43        CHARACTER commFlag        CHARACTER commFlag
44        INTEGER myTileId        INTEGER myTileId
# Line 47  C     Set dummy myThid value (we are not Line 49  C     Set dummy myThid value (we are not
49        myThid = 1        myThid = 1
50    
51  C     Initialise to zero EXCH2_TOPOLOGY common blocks  C     Initialise to zero EXCH2_TOPOLOGY common blocks
52        DO I = 1,NTILES        DO I = 1,W2_maxNbTiles
53          exch2_tNx(I)    = 0          exch2_tNx(I)    = 0
54          exch2_tNy(I)    = 0          exch2_tNy(I)    = 0
55          exch2_tBasex(I) = 0          exch2_tBasex(I) = 0
# Line 63  C     Initialise to zero EXCH2_TOPOLOGY Line 65  C     Initialise to zero EXCH2_TOPOLOGY
65          exch2_mydNx(I)   = 0          exch2_mydNx(I)   = 0
66          exch2_mydNy(I)   = 0          exch2_mydNy(I)   = 0
67          exch2_nNeighbours(I) = 0          exch2_nNeighbours(I) = 0
68          DO J = 1,MAX_NEIGHBOURS          DO J = 1,W2_maxNeighbours
69            exch2_neighbourId(J,I)  = 0            exch2_neighbourId(J,I)  = 0
70            exch2_opposingSend(J,I) = 0            exch2_opposingSend(J,I) = 0
71            DO II = 1,4            DO II = 1,4
# Line 80  C     Initialise to zero EXCH2_TOPOLOGY Line 82  C     Initialise to zero EXCH2_TOPOLOGY
82        W2_oUnit = standardMessageUnit        W2_oUnit = standardMessageUnit
83    
84  C     Set W2-EXCH2 parameters  C     Set W2-EXCH2 parameters
85  c     CALL W2_EXCH2_READPARMS        CALL W2_READPARMS( myThid )
 c     W2_oUnit = -1  
86    
87        stdUnit = standardMessageUnit        stdUnit = standardMessageUnit
88        WRITE(msgBuf,'(A)') '===== Start setting W2 TOPOLOGY:'        WRITE(msgBuf,'(A)') '===== Start setting W2 TOPOLOGY:'
89        CALL PRINT_MESSAGE( msgBuf, stdUnit, SQUEEZE_RIGHT, myThid )        CALL PRINT_MESSAGE( msgBuf, stdUnit, SQUEEZE_RIGHT, myThid )
90    
91  C     Open message output-file (if needed)  C     Open message output-file (if needed)
92        IF ( W2_oUnit.NE.standardMessageUnit ) THEN        IF ( W2_printMsg .LT. 0 ) THEN
93          WRITE(fName,'(A,I4.4,A)')          WRITE(fName,'(A,I4.4,A)')
94       &     'w2_tile_topology.',myProcId,'.log'       &     'w2_tile_topology.',myProcId,'.log'
95          iLen = ILNBLNK(fName)          iLen = ILNBLNK(fName)
# Line 100  C     Open message output-file (if neede Line 101  C     Open message output-file (if neede
101        ENDIF        ENDIF
102    
103  C     Define topology for every tile  C     Define topology for every tile
104        CALL W2_E2SETUP        CALL W2_E2SETUP( myThid )
105    
106  C     Decide which tiles this process handles - do this inline for now, but  C     Decide which tiles this process handles - do this inline for now, but
107  C     should go in subroutine.  C     should go in subroutine.
108  C     Set which rank processes "own" which tiles. This should probably  C     Set which rank processes "own" which tiles. This should probably
109  C     be queried as part of some hand-shaking but for now we use the  C     be queried as part of some hand-shaking but for now we use the
110  C     functional relationship that was used above.  C     functional relationship that was used above.
111  C     Fill also W2_mpi_myTileList for Single-CPU-IO.  C     Fill also W2_procTileList for Single-CPU-IO.
112    
113  C     Number of tiles I handle is nSx*nSy  C     Number of tiles I handle is nSx*nSy
114        nt_perProc = nSx*nSy        nt_perProc = nSx*nSy
# Line 116  C     Number of tiles I handle is nSx*nS Line 117  C     Number of tiles I handle is nSx*nS
117        thisProc = 1+myPid        thisProc = 1+myPid
118  #endif  #endif
119        J = 0        J = 0
120        DO I=1,NTILES        DO I=1,nTiles
121         IF ( exch2_myFace(I) .NE. 0 ) THEN         IF ( exch2_myFace(I) .NE. 0 ) THEN
122          np = 1 + J/nt_perProc          np = 1 + J/nt_perProc
123          jp = 1 + MOD(J,nt_perProc)          jp = 1 + MOD(J,nt_perProc)
124          exch2_tProc(I) = np          exch2_tProc(I) = np
125          W2_mpi_myTileList(np,jp) = I          W2_procTileList(jp,np) = I
126          IF ( np.EQ.thisProc ) W2_myTileList(jp) = I          IF ( np.EQ.thisProc ) W2_myTileList(jp) = I
127          J = J + 1          J = J + 1
128         ENDIF         ENDIF
# Line 203  c     e2FillValue_R4 = 1.e+20 Line 204  c     e2FillValue_R4 = 1.e+20
204  c     e2FillValue_R8 = 1.d+20  c     e2FillValue_R8 = 1.d+20
205    
206  C     Print out the topology communication schedule  C     Print out the topology communication schedule
207        CALL W2_PRINT_COMM_SEQUENCE( W2_oUnit )        IF ( W2_printMsg .NE. 0 ) THEN
208            CALL W2_PRINT_COMM_SEQUENCE( myThid )
209          ENDIF
210    
211  C     Close message output-file (if needed)  C     Close message output-file (if needed)
212        IF ( W2_oUnit.NE.standardMessageUnit ) THEN        IF ( W2_oUnit.NE.standardMessageUnit ) THEN

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.22