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

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

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

revision 1.8 by jmc, Sat May 30 21:22:13 2009 UTC revision 1.9 by jmc, Sun Jun 28 01:00:23 2009 UTC
# Line 52  c     _RL     SXDIR_TX2CX(2), SYDIR_TX2C Line 52  c     _RL     SXDIR_TX2CX(2), SYDIR_TX2C
52        INTEGER targetIlo, targetIhi, targetJlo, targetJhi        INTEGER targetIlo, targetIhi, targetJlo, targetJhi
53        INTEGER sourceIlo, sourceIhi, sourceJlo, sourceJhi        INTEGER sourceIlo, sourceIhi, sourceJlo, sourceJhi
54        INTEGER targetTile, targetProc, sourceProc        INTEGER targetTile, targetProc, sourceProc
55        INTEGER bi, N        INTEGER bi, bj, N
56        INTEGER iStride, jStride        INTEGER iStride, jStride
57        INTEGER pi(2), pj(2), oi, oj, tN        INTEGER pi(2), pj(2), oi, oj, tN
58        INTEGER itb, jtb, isb, jsb        INTEGER itb, jtb, isb, jsb
# Line 63  c     _RL     SXDIR_TX2CX(2), SYDIR_TX2C Line 63  c     _RL     SXDIR_TX2CX(2), SYDIR_TX2C
63  CEOP  CEOP
64    
65  C     Send loop for cell centered  C     Send loop for cell centered
66        DO bi=1,nSx        DO bj=1,nSy
67         myTileId=W2_myTileList(bi)         DO bi=1,nSx
68         nN=exch2_nNeighbours(myTileId)          myTileId=W2_myTileList(bi,bj)
69         sourceProc=exch2_tProc(myTileId)          nN=exch2_nNeighbours(myTileId)
70         DO N=1,nN          sourceProc=exch2_tProc(myTileId)
71          targetTile=exch2_neighbourId(N,myTileId)          DO N=1,nN
72          targetProc=exch2_tProc(targetTile)           targetTile=exch2_neighbourId(N,myTileId)
73          tN = exch2_opposingSend(N,myTileId)           targetProc=exch2_tProc(targetTile)
74          pi(1)     =exch2_pij(1,N,myTileId)           tN = exch2_opposingSend(N,myTileId)
75          pi(2)     =exch2_pij(2,N,myTileId)           pi(1)     =exch2_pij(1,N,myTileId)
76          pj(1)     =exch2_pij(3,N,myTileId)           pi(2)     =exch2_pij(2,N,myTileId)
77          pj(2)     =exch2_pij(4,N,myTileId)           pj(1)     =exch2_pij(3,N,myTileId)
78          oi        =exch2_oi(N,myTileId)           pj(2)     =exch2_pij(4,N,myTileId)
79          oj        =exch2_oj(N,myTileId)           oi        =exch2_oi(N,myTileId)
80          CALL EXCH2_GET_SCAL_BOUNDS(           oj        =exch2_oj(N,myTileId)
81       I             'T ', OLx, .TRUE.,           CALL EXCH2_GET_SCAL_BOUNDS(
82       I             targetTile, tN,       I              'T ', OLx, .TRUE.,
83       O             targetIlo, targetIhi, targetJlo, targetJhi,       I              targetTile, tN,
84       O             iStride, jStride,       O              targetIlo, targetIhi, targetJlo, targetJhi,
85       I             myThid )       O              iStride, jStride,
86         I              myThid )
87    
88          itb = exch2_tBasex(targetTile)           itb = exch2_tBasex(targetTile)
89          jtb = exch2_tBasey(targetTile)           jtb = exch2_tBasey(targetTile)
90          isb = exch2_tBasex(myTileId)           isb = exch2_tBasex(myTileId)
91          jsb = exch2_tBasey(myTileId)           jsb = exch2_tBasey(myTileId)
92          sourceIlo=pi(1)*(targetIlo+itb)+pi(2)*(targetJlo+jtb)+oi-isb           sourceIlo=pi(1)*(targetIlo+itb)+pi(2)*(targetJlo+jtb)+oi-isb
93          sourceJlo=pj(1)*(targetIlo+itb)+pj(2)*(targetJlo+jtb)+oj-jsb           sourceJlo=pj(1)*(targetIlo+itb)+pj(2)*(targetJlo+jtb)+oj-jsb
94          sourceIhi=pi(1)*(targetIhi+itb)+pi(2)*(targetJhi+jtb)+oi-isb           sourceIhi=pi(1)*(targetIhi+itb)+pi(2)*(targetJhi+jtb)+oi-isb
95          sourceJhi=pj(1)*(targetIhi+itb)+pj(2)*(targetJhi+jtb)+oj-jsb           sourceJhi=pj(1)*(targetIhi+itb)+pj(2)*(targetJhi+jtb)+oj-jsb
96  C       Tile XX sends to points i=ilo:ihi,j=jlo:jhi in tile YY  C        Tile XX sends to points i=ilo:ihi,j=jlo:jhi in tile YY
97          WRITE(msgBuf,'(A,I6,A,I4,A,4(A,I4))')           WRITE(msgBuf,'(A,I6,A,I4,A,4(A,I4))')
98       &   'Tile', myTileId,' (pr=',sourceProc,')',       &    'Tile', myTileId,' (pr=',sourceProc,')',
99       &   ' sends pts i=',sourceIlo,':',sourceIhi,       &    ' sends pts i=',sourceIlo,':',sourceIhi,
100       &            ', j=',sourceJlo,':',sourceJhi       &             ', j=',sourceJlo,':',sourceJhi
101  #ifdef W2_PRINT_PREFIX  #ifdef W2_PRINT_PREFIX
102          CALL PRINT_MESSAGE( msgBuf, W2_oUnit, SQUEEZE_RIGHT, myThid )           CALL PRINT_MESSAGE( msgBuf, W2_oUnit, SQUEEZE_RIGHT, myThid )
103  #else  #else
104          iLen = ILNBLNK(msgBuf)           iLen = ILNBLNK(msgBuf)
105          WRITE(W2_oUnit,'(A)') msgBuf(1:iLen)           WRITE(W2_oUnit,'(A)') msgBuf(1:iLen)
106  #endif  #endif
107          WRITE(msgBuf,'(4(A,I4),A,I6,A,I4,A)')           WRITE(msgBuf,'(4(A,I4),A,I6,A,I4,A)')
108       &   '                        to pts i=',targetIlo,':',targetIhi,       &    '                        to pts i=',targetIlo,':',targetIhi,
109       &                                ', j=',targetJlo,':',targetJhi,       &                                 ', j=',targetJlo,':',targetJhi,
110       &                ' in tile ',targetTile,' (pr=',targetProc,')'       &                 ' in tile ',targetTile,' (pr=',targetProc,')'
111  #ifdef W2_PRINT_PREFIX  #ifdef W2_PRINT_PREFIX
112          CALL PRINT_MESSAGE( msgBuf, W2_oUnit, SQUEEZE_RIGHT, myThid )           CALL PRINT_MESSAGE( msgBuf, W2_oUnit, SQUEEZE_RIGHT, myThid )
113  #else  #else
114          iLen = ILNBLNK(msgBuf)           iLen = ILNBLNK(msgBuf)
115          WRITE(W2_oUnit,'(A)') msgBuf(1:iLen)           WRITE(W2_oUnit,'(A)') msgBuf(1:iLen)
116  #endif  #endif
117            ENDDO
118         ENDDO         ENDDO
119        ENDDO        ENDDO
120    
121  C     Recv loop for cell centered  C     Recv loop for cell centered
122        DO bi=1,nSx        DO bj=1,nSy
123         myTileId=W2_myTileList(bi)         DO bi=1,nSx
124         nN=exch2_nNeighbours(myTileId)          myTileId=W2_myTileList(bi,bj)
125         sourceProc=exch2_tProc(myTileId)          nN=exch2_nNeighbours(myTileId)
126         DO N=1,nN          sourceProc=exch2_tProc(myTileId)
127          targetTile=exch2_neighbourId(N,myTileId)          DO N=1,nN
128          targetProc=exch2_tProc(targetTile)           targetTile=exch2_neighbourId(N,myTileId)
129  C       Find entry for tile targetTile entry that sent to this edge.           targetProc=exch2_tProc(targetTile)
130          tN=exch2_opposingSend(N,myTileId)  C        Find entry for tile targetTile entry that sent to this edge.
131  C       Get the range of points associated with that entry           tN=exch2_opposingSend(N,myTileId)
132          CALL EXCH2_GET_SCAL_BOUNDS(  C        Get the range of points associated with that entry
133       I             'T ', OLx, .TRUE.,           CALL EXCH2_GET_SCAL_BOUNDS(
134       I             myTileId, N,       I              'T ', OLx, .TRUE.,
135       O             targetIlo, targetIhi, targetJlo, targetJhi,       I              myTileId, N,
136       O             iStride, jStride,       O              targetIlo, targetIhi, targetJlo, targetJhi,
137       I             myThid )       O              iStride, jStride,
138  C       Tile XX receives points i=ilo:ihi,j=jlo:jhi in tile YY       I              myThid )
139          WRITE(msgBuf,'(A,I6,A,I4,A,4(A,I4),A,I6,A,I4,A)')  C        Tile XX receives points i=ilo:ihi,j=jlo:jhi in tile YY
140       &   'Tile', myTileId,' (pr=',sourceProc,')',           WRITE(msgBuf,'(A,I6,A,I4,A,4(A,I4),A,I6,A,I4,A)')
141       &   ' recv pts i=',targetIlo,':',targetIhi,       &    'Tile', myTileId,' (pr=',sourceProc,')',
142       &           ', j=',targetJlo, ':',targetJhi,       &    ' recv pts i=',targetIlo,':',targetIhi,
143       &   ' from tile',targetTile,' (pr=',targetProc,')'       &            ', j=',targetJlo, ':',targetJhi,
144         &    ' from tile',targetTile,' (pr=',targetProc,')'
145  #ifdef W2_PRINT_PREFIX  #ifdef W2_PRINT_PREFIX
146          CALL PRINT_MESSAGE( msgBuf, W2_oUnit, SQUEEZE_RIGHT, myThid )           CALL PRINT_MESSAGE( msgBuf, W2_oUnit, SQUEEZE_RIGHT, myThid )
147  #else  #else
148          iLen = ILNBLNK(msgBuf)           iLen = ILNBLNK(msgBuf)
149          WRITE(W2_oUnit,'(A)') msgBuf(1:iLen)           WRITE(W2_oUnit,'(A)') msgBuf(1:iLen)
150  #endif  #endif
151            ENDDO
152         ENDDO         ENDDO
153        ENDDO        ENDDO
154    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.22