1 |
jmc |
1.5 |
C $Header: /u/gcmpack/MITgcm/pkg/exch2/exch2_3d_rx.template,v 1.4 2009/05/12 19:44:58 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "CPP_EEOPTIONS.h" |
5 |
|
|
#include "W2_OPTIONS.h" |
6 |
|
|
|
7 |
|
|
CBOP |
8 |
|
|
C !ROUTINE: EXCH2_3D_RX |
9 |
|
|
|
10 |
|
|
C !INTERFACE: |
11 |
|
|
SUBROUTINE EXCH2_3D_RX( |
12 |
|
|
U phi, |
13 |
|
|
I myNz, myThid ) |
14 |
|
|
|
15 |
|
|
C !DESCRIPTION: |
16 |
|
|
C *==========================================================* |
17 |
|
|
C | SUBROUTINE EXCH2_3D_RX |
18 |
|
|
C | o Handle exchanges for _RX, three-dim scalar arrays. |
19 |
|
|
C *==========================================================* |
20 |
|
|
|
21 |
|
|
C !USES: |
22 |
|
|
IMPLICIT NONE |
23 |
|
|
C === Global data === |
24 |
|
|
#include "SIZE.h" |
25 |
|
|
#include "EEPARAMS.h" |
26 |
jmc |
1.4 |
#include "W2_EXCH2_SIZE.h" |
27 |
jmc |
1.1 |
#include "W2_EXCH2_TOPOLOGY.h" |
28 |
jmc |
1.4 |
#ifdef W2_FILL_NULL_REGIONS |
29 |
jmc |
1.1 |
#include "W2_EXCH2_PARAMS.h" |
30 |
jmc |
1.4 |
#endif |
31 |
jmc |
1.1 |
|
32 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
33 |
|
|
C === Routine arguments === |
34 |
|
|
C phi :: Array with overlap regions are to be exchanged |
35 |
|
|
C myNz :: 3rd dimension of array to exchange |
36 |
|
|
C myThid :: My thread id. |
37 |
|
|
INTEGER myNz |
38 |
|
|
_RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy) |
39 |
|
|
INTEGER myThid |
40 |
|
|
|
41 |
|
|
C !LOCAL VARIABLES: |
42 |
|
|
C == Local variables == |
43 |
|
|
C OL[wens] :: Overlap extents in west, east, north, south. |
44 |
|
|
C exchWidth[XY] :: Extent of regions that will be exchanged. |
45 |
|
|
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY |
46 |
|
|
#ifdef W2_FILL_NULL_REGIONS |
47 |
|
|
INTEGER bi, bj, myTile, i, j, k |
48 |
|
|
#endif |
49 |
|
|
|
50 |
|
|
CEOP |
51 |
|
|
|
52 |
|
|
OLw = OLx |
53 |
|
|
OLe = OLx |
54 |
|
|
OLn = OLy |
55 |
|
|
OLs = OLy |
56 |
|
|
exchWidthX = OLx |
57 |
|
|
exchWidthY = OLy |
58 |
|
|
|
59 |
jmc |
1.5 |
CALL EXCH2_RX1_CUBE( phi, 'T ', |
60 |
jmc |
1.1 |
I OLw, OLe, OLs, OLn, myNz, |
61 |
|
|
I exchWidthX, exchWidthY, |
62 |
|
|
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
63 |
|
|
|
64 |
|
|
#ifdef W2_FILL_NULL_REGIONS |
65 |
jmc |
1.5 |
IF (useCubedSphereExchange) THEN |
66 |
jmc |
1.1 |
DO bj=myByLo(myThid),myByHi(myThid) |
67 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
68 |
jmc |
1.5 |
myTile = W2_myTileList(bi,bj) |
69 |
jmc |
1.1 |
C South-east corner |
70 |
|
|
IF ( exch2_isEedge(myTile) .EQ. 1 .AND. |
71 |
|
|
& exch2_isSedge(myTile) .EQ. 1 ) THEN |
72 |
|
|
DO j=1-OLy,0 |
73 |
|
|
DO i=sNx+1,sNx+OLx |
74 |
|
|
DO k=1,myNz |
75 |
|
|
phi(i,j,k,bi,bj)=e2FillValue_RX |
76 |
|
|
ENDDO |
77 |
|
|
ENDDO |
78 |
|
|
ENDDO |
79 |
|
|
ENDIF |
80 |
|
|
C North-east corner |
81 |
|
|
IF ( exch2_isEedge(myTile) .EQ. 1 .AND. |
82 |
|
|
& exch2_isNedge(myTile) .EQ. 1 ) THEN |
83 |
|
|
DO j=sNy+1,sNy+OLy |
84 |
|
|
DO i=sNx+1,sNx+OLx |
85 |
|
|
DO k=1,myNz |
86 |
|
|
phi(i,j,k,bi,bj)=e2FillValue_RX |
87 |
|
|
ENDDO |
88 |
|
|
ENDDO |
89 |
|
|
ENDDO |
90 |
|
|
ENDIF |
91 |
|
|
C South-west corner |
92 |
|
|
IF ( exch2_isWedge(myTile) .EQ. 1 .AND. |
93 |
|
|
& exch2_isSedge(myTile) .EQ. 1 ) THEN |
94 |
|
|
DO j=1-OLy,0 |
95 |
|
|
DO i=1-OLx,0 |
96 |
|
|
DO k=1,myNz |
97 |
|
|
phi(i,j,k,bi,bj)=e2FillValue_RX |
98 |
|
|
ENDDO |
99 |
|
|
ENDDO |
100 |
|
|
ENDDO |
101 |
|
|
ENDIF |
102 |
|
|
C North-west corner |
103 |
|
|
IF ( exch2_isWedge(myTile) .EQ. 1 .AND. |
104 |
|
|
& exch2_isNedge(myTile) .EQ. 1 ) THEN |
105 |
|
|
DO j=sNy+1,sNy+OLy |
106 |
|
|
DO i=1-OLx,0 |
107 |
|
|
DO k=1,myNz |
108 |
|
|
phi(i,j,k,bi,bj)=e2FillValue_RX |
109 |
|
|
ENDDO |
110 |
|
|
ENDDO |
111 |
|
|
ENDDO |
112 |
|
|
ENDIF |
113 |
|
|
ENDDO |
114 |
|
|
ENDDO |
115 |
jmc |
1.5 |
ENDIF |
116 |
jmc |
1.1 |
#endif /* W2_FILL_NULL_REGIONS */ |
117 |
|
|
|
118 |
jmc |
1.5 |
CALL EXCH2_RX1_CUBE( phi, 'T ', |
119 |
jmc |
1.1 |
I OLw, OLe, OLs, OLn, myNz, |
120 |
|
|
I exchWidthX, exchWidthY, |
121 |
|
|
I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) |
122 |
|
|
|
123 |
|
|
#ifdef W2_FILL_NULL_REGIONS |
124 |
jmc |
1.5 |
IF (useCubedSphereExchange) THEN |
125 |
jmc |
1.1 |
DO bj=myByLo(myThid),myByHi(myThid) |
126 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
127 |
jmc |
1.5 |
myTile = W2_myTileList(bi,bj) |
128 |
jmc |
1.1 |
C South-east corner |
129 |
|
|
IF ( exch2_isEedge(myTile) .EQ. 1 .AND. |
130 |
|
|
& exch2_isSedge(myTile) .EQ. 1 ) THEN |
131 |
|
|
DO j=1-OLy,0 |
132 |
|
|
DO i=sNx+1,sNx+OLx |
133 |
|
|
DO k=1,myNz |
134 |
|
|
phi(i,j,k,bi,bj)=e2FillValue_RX |
135 |
|
|
ENDDO |
136 |
|
|
ENDDO |
137 |
|
|
ENDDO |
138 |
|
|
ENDIF |
139 |
|
|
C North-east corner |
140 |
|
|
IF ( exch2_isEedge(myTile) .EQ. 1 .AND. |
141 |
|
|
& exch2_isNedge(myTile) .EQ. 1 ) THEN |
142 |
|
|
DO j=sNy+1,sNy+OLy |
143 |
|
|
DO i=sNx+1,sNx+OLx |
144 |
|
|
DO k=1,myNz |
145 |
|
|
phi(i,j,k,bi,bj)=e2FillValue_RX |
146 |
|
|
ENDDO |
147 |
|
|
ENDDO |
148 |
|
|
ENDDO |
149 |
|
|
ENDIF |
150 |
|
|
C South-west corner |
151 |
|
|
IF ( exch2_isWedge(myTile) .EQ. 1 .AND. |
152 |
|
|
& exch2_isSedge(myTile) .EQ. 1 ) THEN |
153 |
|
|
DO j=1-OLy,0 |
154 |
|
|
DO i=1-OLx,0 |
155 |
|
|
DO k=1,myNz |
156 |
|
|
phi(i,j,k,bi,bj)=e2FillValue_RX |
157 |
|
|
ENDDO |
158 |
|
|
ENDDO |
159 |
|
|
ENDDO |
160 |
|
|
ENDIF |
161 |
|
|
C North-west corner |
162 |
|
|
IF ( exch2_isWedge(myTile) .EQ. 1 .AND. |
163 |
|
|
& exch2_isNedge(myTile) .EQ. 1 ) THEN |
164 |
|
|
DO j=sNy+1,sNy+OLy |
165 |
|
|
DO i=1-OLx,0 |
166 |
|
|
DO k=1,myNz |
167 |
|
|
phi(i,j,k,bi,bj)=e2FillValue_RX |
168 |
|
|
ENDDO |
169 |
|
|
ENDDO |
170 |
|
|
ENDDO |
171 |
|
|
ENDIF |
172 |
|
|
ENDDO |
173 |
|
|
ENDDO |
174 |
jmc |
1.5 |
ENDIF |
175 |
jmc |
1.1 |
#endif /* W2_FILL_NULL_REGIONS */ |
176 |
|
|
|
177 |
|
|
RETURN |
178 |
|
|
END |
179 |
|
|
|
180 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
181 |
|
|
|
182 |
|
|
CEH3 ;;; Local Variables: *** |
183 |
|
|
CEH3 ;;; mode:fortran *** |
184 |
|
|
CEH3 ;;; End: *** |