/[MITgcm]/MITgcm/pkg/exch2/exch2_get_uv_bounds.F
ViewVC logotype

Diff of /MITgcm/pkg/exch2/exch2_get_uv_bounds.F

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

revision 1.2 by jmc, Sat May 30 21:22:13 2009 UTC revision 1.3 by jmc, Mon Mar 26 19:13:15 2012 UTC
# Line 6  C     !ROUTINE: EXCH2_GET_UV_BOUNDS Line 6  C     !ROUTINE: EXCH2_GET_UV_BOUNDS
6    
7  C     !INTERFACE:  C     !INTERFACE:
8        SUBROUTINE EXCH2_GET_UV_BOUNDS(        SUBROUTINE EXCH2_GET_UV_BOUNDS(
9       I                 fCode, eWdth,       I                 fCode, eWdth, updateCorners,
10       I                 tgTile, tgNb,       I                 tgTile, tgNb,
11       O                 tIlo1, tIhi1, tJlo1, tJhi1,       O                 tIlo1, tIhi1, tJlo1, tJhi1,
12       O                 tIlo2, tIhi2, tJlo2, tJhi2,       O                 tIlo2, tIhi2, tJlo2, tJhi2,
# Line 47  C     myThid        :: my Thread Id. num Line 47  C     myThid        :: my Thread Id. num
47    
48        CHARACTER*2 fCode        CHARACTER*2 fCode
49        INTEGER     eWdth        INTEGER     eWdth
50  c     LOGICAL     updateCorners        LOGICAL     updateCorners
51        INTEGER     tgTile, tgNb        INTEGER     tgTile, tgNb
52        INTEGER     tIlo1, tIhi1, tJlo1, tJhi1        INTEGER     tIlo1, tIhi1, tJlo1, tJhi1
53        INTEGER     tIlo2, tIhi2, tJlo2, tJhi2        INTEGER     tIlo2, tIhi2, tJlo2, tJhi2
# Line 92  C      Filling a west edge overlap Line 92  C      Filling a west edge overlap
92         ELSE         ELSE
93          tjStride=-1          tjStride=-1
94         ENDIF         ENDIF
95           IF ( updateCorners ) THEN
96          tJlo1 = tJlo-tjStride*(eWdth-1)          tJlo1 = tJlo-tjStride*(eWdth-1)
97          tJhi1 = tJhi+tjStride*(eWdth-1)          tJhi1 = tJhi+tjStride*(eWdth-1)
98           ELSE
99            tJlo1 = tJlo+tjStride
100            tJhi1 = tJhi-tjStride
101           ENDIF
102        ENDIF        ENDIF
103        IF ( tIlo.EQ.tIhi .AND. tIlo.GT.1 ) THEN        IF ( tIlo.EQ.tIhi .AND. tIlo.GT.1 ) THEN
104  C      Filling an east edge overlap  C      Filling an east edge overlap
# Line 105  C      Filling an east edge overlap Line 110  C      Filling an east edge overlap
110         ELSE         ELSE
111          tjStride =-1          tjStride =-1
112         ENDIF         ENDIF
113           IF ( updateCorners ) THEN
114          tJlo1 = tJlo-tjStride*(eWdth-1)          tJlo1 = tJlo-tjStride*(eWdth-1)
115          tJhi1 = tJhi+tjStride*(eWdth-1)          tJhi1 = tJhi+tjStride*(eWdth-1)
116           ELSE
117            tJlo1 = tJlo+tjStride
118            tJhi1 = tJhi-tjStride
119           ENDIF
120        ENDIF        ENDIF
121        IF ( tJlo.EQ.tJhi .AND. tJlo.EQ.0 ) THEN        IF ( tJlo.EQ.tJhi .AND. tJlo.EQ.0 ) THEN
122  C      Filling a south edge overlap  C      Filling a south edge overlap
# Line 118  C      Filling a south edge overlap Line 128  C      Filling a south edge overlap
128         ELSE         ELSE
129          tiStride =-1          tiStride =-1
130         ENDIF         ENDIF
131           IF ( updateCorners ) THEN
132          tIlo1 = tIlo-tiStride*(eWdth-1)          tIlo1 = tIlo-tiStride*(eWdth-1)
133          tIhi1 = tIhi+tiStride*(eWdth-1)          tIhi1 = tIhi+tiStride*(eWdth-1)
134           ELSE
135            tIlo1 = tIlo+tiStride
136            tIhi1 = tIhi-tiStride
137           ENDIF
138        ENDIF        ENDIF
139        IF ( tJlo.EQ.tJhi .AND. tJlo.GT.1 ) THEN        IF ( tJlo.EQ.tJhi .AND. tJlo.GT.1 ) THEN
140  C      Filling a north edge overlap  C      Filling a north edge overlap
# Line 131  C      Filling a north edge overlap Line 146  C      Filling a north edge overlap
146         ELSE         ELSE
147          tiStride =-1          tiStride =-1
148         ENDIF         ENDIF
149           IF ( updateCorners ) THEN
150          tIlo1 = tIlo-tiStride*(eWdth-1)          tIlo1 = tIlo-tiStride*(eWdth-1)
151          tIhi1 = tIhi+tiStride*(eWdth-1)          tIhi1 = tIhi+tiStride*(eWdth-1)
152           ELSE
153            tIlo1 = tIlo+tiStride
154            tIhi1 = tIhi-tiStride
155           ENDIF
156        ENDIF        ENDIF
157    
158  C---  copy to 2nd set of indices  C---  copy to 2nd set of indices
# Line 164  C     if pij(4) is -1 then +j in source Line 184  C     if pij(4) is -1 then +j in source
184          IF ( e2_pij(4) .EQ. -1 ) THEN          IF ( e2_pij(4) .EQ. -1 ) THEN
185           e2_oj2 = e2_oj2 + 1           e2_oj2 = e2_oj2 + 1
186          ENDIF          ENDIF
187    
188    C---  adjust index lower and upper bounds (fct of updateCorners):
189           IF ( updateCorners ) THEN
190    
191  C--   as a consequence, need also to increase the index lower bound  C--   as a consequence, need also to increase the index lower bound
192  C     (avoid "out-of bounds" problems ; formerly itlreduce,jtlreduce)  C     (avoid "out-of bounds" problems ; formerly itlreduce,jtlreduce)
193          IF ( e2_pij(1).EQ.-1 .OR. e2_pij(3).EQ.-1 ) tIlo1 = tIlo1+1          IF ( e2_pij(1).EQ.-1 .OR. e2_pij(3).EQ.-1 ) tIlo1 = tIlo1+1
# Line 219  C-      North Edge is touching the face Line 243  C-      North Edge is touching the face
243            ENDIF            ENDIF
244          ENDIF          ENDIF
245    
246           ELSE
247    C---  adjust index lower and upper bounds (updateCorners = F case):
248            IF ( e2_pij(1).EQ.-1 .OR. e2_pij(3).EQ.-1 ) THEN
249              tIlo1 = tIlo1+1
250              tIhi1 = tIhi1+1
251            ENDIF
252            IF ( e2_pij(2).EQ.-1 .OR. e2_pij(4).EQ.-1 ) THEN
253              tJlo2 = tJlo2+1
254              tJhi2 = tJhi2+1
255            ENDIF
256           ENDIF
257    
258  C---  UV C-Grid specific code: end  C---  UV C-Grid specific code: end
259    
260        ELSEIF ( fCode.NE.'Ag' ) THEN        ELSEIF ( fCode.NE.'Ag' ) THEN

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22