1 |
C $Header: /u/gcmpack/MITgcm/pkg/exch2/exch2_xy_rx.template,v 1.9 2010/05/06 23:28:46 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_EEOPTIONS.h" |
5 |
#include "W2_OPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
|
9 |
C !ROUTINE: EXCH_XY_RX |
10 |
|
11 |
C !INTERFACE: |
12 |
SUBROUTINE EXCH2_XY_RX( |
13 |
U phi, |
14 |
I myThid ) |
15 |
IMPLICIT NONE |
16 |
C !DESCRIPTION: |
17 |
C *==========================================================* |
18 |
C | SUBROUTINE EXCH_XY_RX |
19 |
C | o Handle exchanges for _RX two-dimensional scalar arrays. |
20 |
C *==========================================================* |
21 |
|
22 |
C !USES: |
23 |
C === Global data === |
24 |
#include "SIZE.h" |
25 |
#include "EEPARAMS.h" |
26 |
#include "W2_EXCH2_SIZE.h" |
27 |
#include "W2_EXCH2_TOPOLOGY.h" |
28 |
#ifdef W2_FILL_NULL_REGIONS |
29 |
#include "W2_EXCH2_PARAMS.h" |
30 |
#endif |
31 |
|
32 |
C !INPUT/OUTPUT PARAMETERS: |
33 |
C === Routine arguments === |
34 |
C phi :: Array with overlap regions are to be exchanged |
35 |
C myThid :: My thread id. |
36 |
_RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
37 |
INTEGER myThid |
38 |
|
39 |
C !LOCAL VARIABLES: |
40 |
C == Local variables == |
41 |
C OL[wens] :: Overlap extents in west, east, north, south. |
42 |
C exchWidth[XY] :: Extent of regions that will be exchanged. |
43 |
INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz |
44 |
#ifdef W2_FILL_NULL_REGIONS |
45 |
INTEGER bi, bj, myTile, i, j |
46 |
#endif |
47 |
CEOP |
48 |
|
49 |
|
50 |
OLw = OLx |
51 |
OLe = OLx |
52 |
OLn = OLy |
53 |
OLs = OLy |
54 |
exchWidthX = OLx |
55 |
exchWidthY = OLy |
56 |
myNz = 1 |
57 |
|
58 |
CALL EXCH2_RX1_CUBE( phi, .FALSE., 'T ', |
59 |
I OLw, OLe, OLs, OLn, myNz, |
60 |
I exchWidthX, exchWidthY, |
61 |
I EXCH_UPDATE_CORNERS, myThid ) |
62 |
|
63 |
CALL EXCH2_RX1_CUBE( phi, .FALSE., 'T ', |
64 |
I OLw, OLe, OLs, OLn, myNz, |
65 |
I exchWidthX, exchWidthY, |
66 |
I EXCH_UPDATE_CORNERS, myThid ) |
67 |
|
68 |
#ifdef W2_FILL_NULL_REGIONS |
69 |
IF (useCubedSphereExchange) THEN |
70 |
DO bj=myByLo(myThid),myByHi(myThid) |
71 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
72 |
myTile = W2_myTileList(bi,bj) |
73 |
C South-east corner |
74 |
IF ( exch2_isEedge(myTile) .EQ. 1 .AND. |
75 |
& exch2_isSedge(myTile) .EQ. 1 ) THEN |
76 |
DO j=1-OLy,0 |
77 |
DO i=sNx+1,sNx+OLx |
78 |
phi(i,j,bi,bj)=e2FillValue_RX |
79 |
ENDDO |
80 |
ENDDO |
81 |
ENDIF |
82 |
C North-east corner |
83 |
IF ( exch2_isEedge(myTile) .EQ. 1 .AND. |
84 |
& exch2_isNedge(myTile) .EQ. 1 ) THEN |
85 |
DO j=sNy+1,sNy+OLy |
86 |
DO i=sNx+1,sNx+OLx |
87 |
phi(i,j,bi,bj)=e2FillValue_RX |
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 |
phi(i,j,bi,bj)=e2FillValue_RX |
97 |
ENDDO |
98 |
ENDDO |
99 |
ENDIF |
100 |
C North-west corner |
101 |
IF ( exch2_isWedge(myTile) .EQ. 1 .AND. |
102 |
& exch2_isNedge(myTile) .EQ. 1 ) THEN |
103 |
DO j=sNy+1,sNy+OLy |
104 |
DO i=1-OLx,0 |
105 |
phi(i,j,bi,bj)=e2FillValue_RX |
106 |
ENDDO |
107 |
ENDDO |
108 |
ENDIF |
109 |
ENDDO |
110 |
ENDDO |
111 |
ENDIF |
112 |
#endif /* W2_FILL_NULL_REGIONS */ |
113 |
|
114 |
RETURN |
115 |
END |
116 |
|
117 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
118 |
|
119 |
CEH3 ;;; Local Variables: *** |
120 |
CEH3 ;;; mode:fortran *** |
121 |
CEH3 ;;; End: *** |