35 |
|
|
36 |
#include "SIZE.h" |
#include "SIZE.h" |
37 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
38 |
#include "EESUPPORT.h" |
#include "W2_EXCH2_SIZE.h" |
39 |
#include "W2_EXCH2_TOPOLOGY.h" |
#include "W2_EXCH2_TOPOLOGY.h" |
40 |
|
#ifdef W2_FILL_NULL_REGIONS |
41 |
#include "W2_EXCH2_PARAMS.h" |
#include "W2_EXCH2_PARAMS.h" |
42 |
|
#endif |
43 |
|
|
44 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
45 |
C == Argument list variables == |
C == Argument list variables == |
58 |
C uPhiNW,uPhiSE :: temporary array to hold corner value (CS grid) |
C uPhiNW,uPhiSE :: temporary array to hold corner value (CS grid) |
59 |
C vPhiNW,vPhiSE :: temporary array to hold corner value (CS grid) |
C vPhiNW,vPhiSE :: temporary array to hold corner value (CS grid) |
60 |
C uLoc,vLoc :: local copy of the vector components with haloes filled. |
C uLoc,vLoc :: local copy of the vector components with haloes filled. |
61 |
C msgBuf :: Informational/error meesage buffer |
C msgBuf :: Informational/error message buffer |
62 |
|
|
63 |
INTEGER local_maxDim |
INTEGER local_maxDim |
64 |
PARAMETER( local_maxDim = 8*Nr ) |
PARAMETER( local_maxDim = 8*Nr ) |
107 |
ENDDO |
ENDDO |
108 |
ENDDO |
ENDDO |
109 |
ENDDO |
ENDDO |
110 |
|
C--- using or not using CubedSphereExchange: end |
111 |
|
ENDIF |
112 |
|
|
113 |
C-- First call the exchanges for the two components |
C-- First call the exchanges for the two components |
114 |
|
|
115 |
CALL EXCH2_RX1_CUBE( uPhi, 'T ', |
CALL EXCH2_RX1_CUBE( uPhi, .FALSE., 'T ', |
116 |
I OLw, OLe, OLs, OLn, myNz, |
I OLw, OLe, OLs, OLn, myNz, |
117 |
I exchWidthX, exchWidthY, |
I exchWidthX, exchWidthY, |
118 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
I EXCH_UPDATE_CORNERS, myThid ) |
119 |
CALL EXCH2_RX1_CUBE( uPhi, 'T ', |
CALL EXCH2_RX1_CUBE( uPhi, .FALSE., 'T ', |
120 |
I OLw, OLe, OLs, OLn, myNz, |
I OLw, OLe, OLs, OLn, myNz, |
121 |
I exchWidthX, exchWidthY, |
I exchWidthX, exchWidthY, |
122 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
I EXCH_UPDATE_CORNERS, myThid ) |
123 |
|
|
124 |
CALL EXCH2_RX1_CUBE( vPhi, 'T ', |
CALL EXCH2_RX1_CUBE( vPhi, .FALSE., 'T ', |
125 |
I OLw, OLe, OLs, OLn, myNz, |
I OLw, OLe, OLs, OLn, myNz, |
126 |
I exchWidthX, exchWidthY, |
I exchWidthX, exchWidthY, |
127 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
I EXCH_UPDATE_CORNERS, myThid ) |
128 |
CALL EXCH2_RX1_CUBE( vPhi, 'T ', |
CALL EXCH2_RX1_CUBE( vPhi, .FALSE., 'T ', |
129 |
I OLw, OLe, OLs, OLn, myNz, |
I OLw, OLe, OLs, OLn, myNz, |
130 |
I exchWidthX, exchWidthY, |
I exchWidthX, exchWidthY, |
131 |
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
I EXCH_UPDATE_CORNERS, myThid ) |
132 |
|
|
133 |
C- note: can substitute the low-level S/R calls above with: |
C- note: can substitute the low-level S/R calls above with: |
134 |
c CALL EXCH2_3D_RX( uPhi, myNz, myThid ) |
c CALL EXCH2_3D_RX( uPhi, myNz, myThid ) |
135 |
c CALL EXCH2_3D_RX( vPhi, myNz, myThid ) |
c CALL EXCH2_3D_RX( vPhi, myNz, myThid ) |
136 |
|
|
137 |
|
IF ( useCubedSphereExchange ) THEN |
138 |
|
|
139 |
C-- Then, depending on which tile we are, we may need |
C-- Then, depending on which tile we are, we may need |
140 |
C 1) to switch u and v components and also to switch the signs |
C 1) to switch u and v components and also to switch the signs |
141 |
C 2) to shift the index along the face edge. |
C 2) to shift the index along the face edge. |
149 |
DO bj = myByLo(myThid), myByHi(myThid) |
DO bj = myByLo(myThid), myByHi(myThid) |
150 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
DO bi = myBxLo(myThid), myBxHi(myThid) |
151 |
|
|
152 |
C- Now choose what to do at each edge of the halo based on which face |
C- Choose what to do at each edge of the halo based on which face we are |
153 |
C (we assume that bj is always=1) |
myTile = W2_myTileList(bi,bj) |
|
myTile = W2_myTileList(bi) |
|
154 |
myFace = exch2_myFace(myTile) |
myFace = exch2_myFace(myTile) |
155 |
|
|
156 |
C-- Loops on level index: |
C-- Loops on level index: |
327 |
& exch2_isNedge(myTile) .EQ. 1 ) THEN |
& exch2_isNedge(myTile) .EQ. 1 ) THEN |
328 |
IF ( MOD(myFace,2).EQ.1 ) THEN |
IF ( MOD(myFace,2).EQ.1 ) THEN |
329 |
DO k=1,myNz |
DO k=1,myNz |
330 |
|
uPhi(1,sNy+1,k,bi,bj) = uPhiNW(k,bi,bj) |
331 |
|
vPhi(1,sNy+1,k,bi,bj) = vPhiNW(k,bi,bj) |
332 |
DO i=2,OLx |
DO i=2,OLx |
333 |
uPhi(1,sNy+i,k,bi,bj) = vPhi(2-i,sNy+1,k,bi,bj) |
uPhi(1,sNy+i,k,bi,bj) = vPhi(2-i,sNy+1,k,bi,bj) |
334 |
vPhi(1,sNy+i,k,bi,bj) = uPhi(2-i,sNy+1,k,bi,bj)*negOne |
vPhi(1,sNy+i,k,bi,bj) = uPhi(2-i,sNy+1,k,bi,bj)*negOne |
409 |
ENDDO |
ENDDO |
410 |
ENDDO |
ENDDO |
411 |
|
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
|
|
|
|
|
ELSE |
|
|
C--- not using CubedSphereExchange: |
|
|
|
|
|
#ifndef AUTODIFF_EXCH2 |
|
|
CALL EXCH_RX( uPhi, |
|
|
I OLw, OLe, OLs, OLn, myNz, |
|
|
I exchWidthX, exchWidthY, |
|
|
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
|
|
CALL EXCH_RX( vPhi, |
|
|
I OLw, OLe, OLs, OLn, myNz, |
|
|
I exchWidthX, exchWidthY, |
|
|
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
|
|
#endif |
|
|
|
|
412 |
C--- using or not using CubedSphereExchange: end |
C--- using or not using CubedSphereExchange: end |
413 |
ENDIF |
ENDIF |
414 |
|
|