101 |
C-- Post sends into buffer (buffer level 1): |
C-- Post sends into buffer (buffer level 1): |
102 |
DO bj=myByLo(myThid), myByHi(myThid) |
DO bj=myByLo(myThid), myByHi(myThid) |
103 |
DO bi=myBxLo(myThid), myBxHi(myThid) |
DO bi=myBxLo(myThid), myBxHi(myThid) |
104 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
105 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
106 |
DO N=1,nN |
DO N=1,nN |
107 |
farTile=exch2_neighbourId(N,thisTile) |
farTile=exch2_neighbourId(N,thisTile) |
124 |
I tKlo, tKhi, tkStride, |
I tKlo, tKhi, tkStride, |
125 |
I thisTile, N, |
I thisTile, N, |
126 |
I e2BufrRecSize, |
I e2BufrRecSize, |
127 |
O iBuf1Filled(N,bi), |
O iBuf1Filled(N,bi,bj), |
128 |
O e2Bufr1_RX(1,N,bi,1), |
O e2Bufr1_RX(1,N,bi,bj,1), |
129 |
I array(1-myOLw,1-myOLs,1,bi,bj), |
I array(1-myOLw,1-myOLs,1,bi,bj), |
130 |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
131 |
O e2_msgHandles(1,N,bi,bj), |
O e2_msgHandles(1,N,bi,bj), |
132 |
I W2_myCommFlag(N,bi), myThid ) |
I W2_myCommFlag(N,bi,bj), myThid ) |
133 |
ENDDO |
ENDDO |
134 |
ENDDO |
ENDDO |
135 |
ENDDO |
ENDDO |
144 |
C-- Send my data (in buffer, level 1) to target Process |
C-- Send my data (in buffer, level 1) to target Process |
145 |
DO bj=1,nSy |
DO bj=1,nSy |
146 |
DO bi=1,nSx |
DO bi=1,nSx |
147 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
148 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
149 |
DO N=1,nN |
DO N=1,nN |
150 |
C- Skip the call if this is an internal exchange |
C- Skip the call if this is an internal exchange |
151 |
IF ( W2_myCommFlag(N,bi) .EQ. 'M' ) THEN |
IF ( W2_myCommFlag(N,bi,bj) .EQ. 'M' ) THEN |
152 |
CALL EXCH2_SEND_RX1( |
CALL EXCH2_SEND_RX1( |
153 |
I thisTile, N, |
I thisTile, N, |
154 |
I e2BufrRecSize, |
I e2BufrRecSize, |
155 |
I iBuf1Filled(N,bi), |
I iBuf1Filled(N,bi,bj), |
156 |
I e2Bufr1_RX(1,N,bi,1), |
I e2Bufr1_RX(1,N,bi,bj,1), |
157 |
O e2_msgHandles(1,N,bi,bj), |
O e2_msgHandles(1,N,bi,bj), |
158 |
I W2_myCommFlag(N,bi), myThid ) |
I W2_myCommFlag(N,bi,bj), myThid ) |
159 |
ENDIF |
ENDIF |
160 |
ENDDO |
ENDDO |
161 |
ENDDO |
ENDDO |
164 |
C-- Receive data (in buffer, level 2) from source Process |
C-- Receive data (in buffer, level 2) from source Process |
165 |
DO bj=1,nSy |
DO bj=1,nSy |
166 |
DO bi=1,nSx |
DO bi=1,nSx |
167 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
168 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
169 |
DO N=1,nN |
DO N=1,nN |
170 |
C- Skip the call if this is an internal exchange |
C- Skip the call if this is an internal exchange |
171 |
IF ( W2_myCommFlag(N,bi) .EQ. 'M' ) THEN |
IF ( W2_myCommFlag(N,bi,bj) .EQ. 'M' ) THEN |
172 |
CALL EXCH2_GET_SCAL_BOUNDS( |
CALL EXCH2_GET_SCAL_BOUNDS( |
173 |
I fieldCode, exchWidthX, updateCorners, |
I fieldCode, exchWidthX, updateCorners, |
174 |
I thisTile, N, |
I thisTile, N, |
183 |
I thisTile, N, |
I thisTile, N, |
184 |
I e2BufrRecSize, |
I e2BufrRecSize, |
185 |
I iBufr, |
I iBufr, |
186 |
O e2Bufr1_RX(1,N,bi,2), |
O e2Bufr1_RX(1,N,bi,bj,2), |
187 |
I W2_myCommFlag(N,bi), myThid ) |
I W2_myCommFlag(N,bi,bj), myThid ) |
188 |
ENDIF |
ENDIF |
189 |
ENDDO |
ENDDO |
190 |
ENDDO |
ENDDO |
193 |
C-- Clear message handles/locks |
C-- Clear message handles/locks |
194 |
DO bj=1,nSy |
DO bj=1,nSy |
195 |
DO bi=1,nSx |
DO bi=1,nSx |
196 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
197 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
198 |
DO N=1,nN |
DO N=1,nN |
199 |
C Note: In a between process tile-tile data transport using |
C Note: In a between process tile-tile data transport using |
203 |
C addressable memory blocks the receiver needs to assert |
C addressable memory blocks the receiver needs to assert |
204 |
C that he has consumed the buffer the sender filled here. |
C that he has consumed the buffer the sender filled here. |
205 |
farTile=exch2_neighbourId(N,thisTile) |
farTile=exch2_neighbourId(N,thisTile) |
206 |
IF ( W2_myCommFlag(N,bi) .EQ. 'M' ) THEN |
IF ( W2_myCommFlag(N,bi,bj) .EQ. 'M' ) THEN |
207 |
wHandle = e2_msgHandles(1,N,bi,bj) |
wHandle = e2_msgHandles(1,N,bi,bj) |
208 |
CALL MPI_Wait( wHandle, mpiStatus, mpiRc ) |
CALL MPI_Wait( wHandle, mpiStatus, mpiRc ) |
209 |
ELSEIF ( W2_myCommFlag(N,bi) .EQ. 'P' ) THEN |
ELSEIF ( W2_myCommFlag(N,bi,bj) .EQ. 'P' ) THEN |
210 |
ELSE |
ELSE |
211 |
ENDIF |
ENDIF |
212 |
ENDDO |
ENDDO |
224 |
C or level 2 if coming from an other Proc) |
C or level 2 if coming from an other Proc) |
225 |
DO bj=myByLo(myThid), myByHi(myThid) |
DO bj=myByLo(myThid), myByHi(myThid) |
226 |
DO bi=myBxLo(myThid), myBxHi(myThid) |
DO bi=myBxLo(myThid), myBxHi(myThid) |
227 |
thisTile=W2_myTileList(bi) |
thisTile=W2_myTileList(bi,bj) |
228 |
nN=exch2_nNeighbours(thisTile) |
nN=exch2_nNeighbours(thisTile) |
229 |
DO N=1,nN |
DO N=1,nN |
230 |
CALL EXCH2_GET_SCAL_BOUNDS( |
CALL EXCH2_GET_SCAL_BOUNDS( |
252 |
U array(1-myOLw,1-myOLs,1,bi,bj), |
U array(1-myOLw,1-myOLs,1,bi,bj), |
253 |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
I i1Lo, i1Hi, j1Lo, j1Hi, k1Lo, k1Hi, |
254 |
U e2_msgHandles, |
U e2_msgHandles, |
255 |
I W2_myCommFlag(N,bi), myThid ) |
I W2_myCommFlag(N,bi,bj), myThid ) |
256 |
ENDDO |
ENDDO |
257 |
ENDDO |
ENDDO |
258 |
ENDDO |
ENDDO |