/[MITgcm]/MITgcm/pkg/exch2/exch2_uv_dgrid_3d_rx.template
ViewVC logotype

Annotation of /MITgcm/pkg/exch2/exch2_uv_dgrid_3d_rx.template

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


Revision 1.4 - (hide annotations) (download)
Thu May 6 23:28:46 2010 UTC (14 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62g, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, HEAD
Changes since 1.3: +6 -11 lines
- S/R EXCH2_RX1,2_CUBE: remove argument "simulationMode" ;
- add argument "signOption" to EXCH2_RX1_CUBE (will be needed for SM exch)

1 jmc 1.4 C $Header: /u/gcmpack/MITgcm/pkg/exch2/exch2_uv_dgrid_3d_rx.template,v 1.3 2009/06/28 00:57:51 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_UV_DGRID_3D_RX
9    
10     C !INTERFACE:
11     SUBROUTINE EXCH2_UV_DGRID_3D_RX(
12     U uPhi, vPhi,
13     I withSigns, myNz, myThid )
14    
15     C !DESCRIPTION:
16     C*=====================================================================*
17     C Purpose: SUBROUTINE EXCH2_UV_DGRID_3D_RX
18     C handle exchanges for a 3D vector field on an D-grid.
19     C
20     C Input:
21     C uPhi(lon,lat,levs,bi,bj) :: first component of vector
22     C vPhi(lon,lat,levs,bi,bj) :: second component of vector
23     C withSigns (logical) :: true to use sign of components
24     C myNz :: 3rd dimension of input arrays uPhi,vPhi
25     C myThid :: my Thread Id number
26     C
27     C Output: uPhi and vPhi are updated (halo regions filled)
28     C
29     C Calls: EXCH_RX (EXCH2_RX2_CUBE) ignoring sign
30     C then put back the right signs
31     C
32     C*=====================================================================*
33    
34     C !USES:
35     IMPLICIT NONE
36    
37     #include "SIZE.h"
38     #include "EEPARAMS.h"
39 jmc 1.2 #include "W2_EXCH2_SIZE.h"
40 jmc 1.1 #include "W2_EXCH2_TOPOLOGY.h"
41    
42     C !INPUT/OUTPUT PARAMETERS:
43     C == Argument list variables ==
44     INTEGER myNz
45     _RX uPhi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy)
46     _RX vPhi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy)
47     LOGICAL withSigns
48     INTEGER myThid
49    
50     C !LOCAL VARIABLES:
51     C == Local variables ==
52     C i,j,k,bi,bj :: loop indices.
53     C OL[wens] :: Overlap extents in west, east, north, south.
54     C exchWidth[XY] :: Extent of regions that will be exchanged.
55    
56     INTEGER i,j,k,bi,bj
57     INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
58     _RX negOne
59     INTEGER myTile, myFace
60     CEOP
61    
62     OLw = OLx
63     OLe = OLx
64     OLn = OLy
65     OLs = OLy
66     exchWidthX = OLx
67     exchWidthY = OLy
68     negOne = 1.
69     IF (withSigns) negOne = -1.
70    
71     C-- First call the exchanges for the two components, ignoring the Sign
72     C note the order: vPhi,uPhi on D-grid are co-located with (u,v)_Cgrid
73    
74 jmc 1.4 c CALL EXCH2_RX2_CUBE( vPhi, uPhi, .FALSE., 'Cg',
75 jmc 1.1 c I OLw, OLe, OLs, OLn, myNz,
76     c I exchWidthX, exchWidthY,
77 jmc 1.4 c I EXCH_UPDATE_CORNERS, myThid )
78     c CALL EXCH2_RX2_CUBE( vPhi, uPhi, .FALSE., 'Cg',
79 jmc 1.1 c I OLw, OLe, OLs, OLn, myNz,
80     c I exchWidthX, exchWidthY,
81 jmc 1.4 c I EXCH_UPDATE_CORNERS, myThid )
82 jmc 1.1
83     C- note: can substitute the low-level S/R calls above with:
84     #ifdef W2_USE_R1_ONLY
85     CALL EXCH2_UV_CGRID_3D_RX(
86     U vPhi, uPhi,
87     I .FALSE., myNz, myThid )
88     #else
89     CALL EXCH2_UV_3D_RX(
90     U vPhi, uPhi,
91     I .FALSE., myNz, myThid )
92     #endif
93    
94 jmc 1.3 IF ( useCubedSphereExchange ) THEN
95     C--- using CubedSphereExchange:
96    
97 jmc 1.1 C-- Then we may need to switch the signs depending on which cube face
98     C we are located.
99    
100     C-- Loops on tile indices:
101     DO bj = myByLo(myThid), myByHi(myThid)
102     DO bi = myBxLo(myThid), myBxHi(myThid)
103    
104 jmc 1.4 C- Choose what to do at each edge of the halo based on which face we are
105 jmc 1.3 myTile = W2_myTileList(bi,bj)
106 jmc 1.1 myFace = exch2_myFace(myTile)
107    
108     C-- Loops on level index:
109     DO k = 1,myNz
110    
111     C- odd faces share disposition of all sections of the halo
112     IF ( MOD(myFace,2).EQ.1 ) THEN
113     C- North:
114     IF (exch2_isNedge(myTile).EQ.1) THEN
115     DO j = 1,exchWidthY
116     DO i = 1-OLx,sNx+OLx
117     uPhi(i,sNy+j,k,bi,bj) = uPhi(i,sNy+j,k,bi,bj)*negOne
118     c vPhi(i,sNy+j,k,bi,bj) = vPhi(i,sNy+j,k,bi,bj)
119     ENDDO
120     ENDDO
121     ENDIF
122     C- South: (nothing to change)
123     c IF (exch2_isSedge(myTile).EQ.1) THEN
124     c DO j = 1,exchWidthY
125     c DO i = 1-OLx,sNx+OLx
126     c uPhi(i,1-j,k,bi,bj) = uPhi(i,1-j,k,bi,bj)
127     c vPhi(i,1-j,k,bi,bj) = vPhi(i,1-j,k,bi,bj)
128     c ENDDO
129     c ENDDO
130     c ENDIF
131     C- East: (nothing to change)
132     c IF (exch2_isEedge(myTile).EQ.1) THEN
133     c DO j = 1-OLy,sNy+OLy
134     c DO i = 1,exchWidthX
135     c uPhi(sNx+i,j,k,bi,bj) = uPhi(sNx+i,j,k,bi,bj)
136     c vPhi(sNx+i,j,k,bi,bj) = vPhi(sNx+i,j,k,bi,bj)
137     c ENDDO
138     c ENDDO
139     c ENDIF
140     C- West:
141     IF (exch2_isWedge(myTile).EQ.1) THEN
142     DO j = 1-OLy,sNy+OLy
143     DO i = 1,exchWidthX
144     c uPhi(1-i,j,k,bi,bj) = uPhi(1-i,j,k,bi,bj)
145     vPhi(1-i,j,k,bi,bj) = vPhi(1-i,j,k,bi,bj)*negOne
146     ENDDO
147     ENDDO
148     ENDIF
149    
150     ELSE
151     C- Now the even faces (share disposition of all sections of the halo)
152    
153     C- East:
154     IF (exch2_isEedge(myTile).EQ.1) THEN
155     DO j = 1-OLy,sNy+OLy
156     DO i = 1,exchWidthX
157     c uPhi(sNx+i,j,k,bi,bj) = uPhi(sNx+i,j,k,bi,bj)
158     vPhi(sNx+i,j,k,bi,bj) = vPhi(sNx+i,j,k,bi,bj)*negOne
159     ENDDO
160     ENDDO
161     ENDIF
162     C- West: (nothing to change)
163     c IF (exch2_isWedge(myTile).EQ.1) THEN
164     c DO j = 1-OLy,sNy+OLy
165     c DO i = 1,exchWidthX
166     c uPhi(1-i,j,k,bi,bj) = uPhi(1-i,j,k,bi,bj)
167     c vPhi(1-i,j,k,bi,bj) = vPhi(1-i,j,k,bi,bj)
168     c ENDDO
169     c ENDDO
170     c ENDIF
171     C- North: (nothing to change)
172     c IF (exch2_isNedge(myTile).EQ.1) THEN
173     c DO j = 1,exchWidthY
174     c DO i = 1-OLx,sNx+OLx
175     c uPhi(i,sNy+j,k,bi,bj) = uPhi(i,sNy+j,k,bi,bj)
176     c vPhi(i,sNy+j,k,bi,bj) = vPhi(i,sNy+j,k,bi,bj)
177     c ENDDO
178     c ENDDO
179     c ENDIF
180     C- South:
181     IF (exch2_isSedge(myTile).EQ.1) THEN
182     DO j = 1,exchWidthY
183     DO i = 1-OLx,sNx+OLx
184     uPhi(i,1-j,k,bi,bj) = uPhi(i,1-j,k,bi,bj)*negOne
185     c vPhi(i,1-j,k,bi,bj) = vPhi(i,1-j,k,bi,bj)
186     ENDDO
187     ENDDO
188     ENDIF
189    
190     C end odd / even faces
191     ENDIF
192    
193     C-- end of Loops on tile and level indices (k,bi,bj).
194     ENDDO
195     ENDDO
196     ENDDO
197    
198     C--- using or not using CubedSphereExchange: end
199     ENDIF
200    
201     RETURN
202     END
203    
204     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
205    
206     CEH3 ;;; Local Variables: ***
207     CEH3 ;;; mode:fortran ***
208     CEH3 ;;; End: ***

  ViewVC Help
Powered by ViewVC 1.1.22