1 |
|
#ifndef USE_W2 |
2 |
C $Header$ |
C $Header$ |
3 |
|
#else /* USE_W2 */ |
4 |
|
C $Header$ |
5 |
|
#endif /* USE_W2 */ |
6 |
C $Name$ |
C $Name$ |
7 |
|
|
8 |
#include "MONITOR_OPTIONS.h" |
#include "MONITOR_OPTIONS.h" |
22 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
23 |
#include "MONITOR.h" |
#include "MONITOR.h" |
24 |
#include "GRID.h" |
#include "GRID.h" |
25 |
|
#ifdef USE_W2 |
26 |
|
#include "W2_EXCH2_TOPOLOGY.h" |
27 |
|
#include "W2_EXCH2_PARAMS.h" |
28 |
|
#endif /* USE_W2 */ |
29 |
|
|
30 |
C === Routine arguments === |
C === Routine arguments === |
31 |
INTEGER myIter, myThid |
INTEGER myIter, myThid |
42 |
_RL tmpFac |
_RL tmpFac |
43 |
_RL etaFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL etaFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
44 |
#endif |
#endif |
45 |
|
#ifdef USE_W2 |
46 |
|
LOGICAL northWestCorner, northEastCorner, |
47 |
|
& southWestCorner, southEastCorner, |
48 |
|
& northEdge, eastEdge |
49 |
|
INTEGER myTile |
50 |
|
|
51 |
|
#endif /* USE_W2 */ |
52 |
|
|
53 |
theMin = 1. _d 20 |
theMin = 1. _d 20 |
54 |
theMax =-1. _d 20 |
theMax =-1. _d 20 |
76 |
#endif |
#endif |
77 |
DO k=1,Nr |
DO k=1,Nr |
78 |
|
|
79 |
|
#ifndef USE_W2 |
80 |
iMax = sNx |
iMax = sNx |
81 |
jMax = sNy |
jMax = sNy |
82 |
DO j=1,sNy |
DO j=1,sNy |
83 |
DO i=1,sNx |
DO i=1,sNx |
84 |
|
#else /* USE_W2 */ |
85 |
|
iMax = sNx + 1 |
86 |
|
jMax = sNy + 1 |
87 |
|
DO j=1,jMax |
88 |
|
DO i=1,iMax |
89 |
|
#endif /* USE_W2 */ |
90 |
#ifdef MONITOR_TEST_HFACZ |
#ifdef MONITOR_TEST_HFACZ |
91 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
92 |
C- Test various definitions of hFacZ (for 1 layer, flat bottom ocean): |
C- Test various definitions of hFacZ (for 1 layer, flat bottom ocean): |
138 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
139 |
C Special stuff for Cubed Sphere: |
C Special stuff for Cubed Sphere: |
140 |
IF (useCubedSphereExchange) THEN |
IF (useCubedSphereExchange) THEN |
141 |
|
#ifndef USE_W2 |
142 |
c AZcorner = 0.75 _d 0 |
c AZcorner = 0.75 _d 0 |
143 |
iMax = sNx+1 |
iMax = sNx+1 |
144 |
jMax = sNy+1 |
jMax = sNy+1 |
145 |
|
#else /* USE_W2 */ |
146 |
|
southWestCorner = .FALSE. |
147 |
|
southEastCorner = .FALSE. |
148 |
|
northWestCorner = .FALSE. |
149 |
|
northEastCorner = .FALSE. |
150 |
|
eastEdge = .FALSE. |
151 |
|
northEdge = .FALSE. |
152 |
|
myTile = W2_myTileList(bi) |
153 |
|
IF ( exch2_isWedge(myTile) .EQ. 1 .AND. |
154 |
|
& exch2_isSedge(myTile) .EQ. 1 ) THEN |
155 |
|
southWestCorner = .TRUE. |
156 |
|
ENDIF |
157 |
|
IF ( exch2_isEedge(myTile) .EQ. 1 .AND. |
158 |
|
& exch2_isSedge(myTile) .EQ. 1 ) THEN |
159 |
|
southEastCorner = .TRUE. |
160 |
|
ENDIF |
161 |
|
IF ( exch2_isEedge(myTile) .EQ. 1 .AND. |
162 |
|
& exch2_isNedge(myTile) .EQ. 1 ) THEN |
163 |
|
northEastCorner = .TRUE. |
164 |
|
ENDIF |
165 |
|
IF ( exch2_isWedge(myTile) .EQ. 1 .AND. |
166 |
|
& exch2_isNedge(myTile) .EQ. 1 ) THEN |
167 |
|
northWestCorner = .TRUE. |
168 |
|
ENDIF |
169 |
|
IF ( exch2_isEedge(myTile) .EQ. 1 ) THEN |
170 |
|
eastEdge = .TRUE. |
171 |
|
ENDIF |
172 |
|
IF ( exch2_isNedge(myTile) .EQ. 1 ) THEN |
173 |
|
northEdge = .TRUE. |
174 |
|
ENDIF |
175 |
|
|
176 |
|
c AZcorner = 0.75 _d 0 |
177 |
|
IF ( northEdge ) THEN |
178 |
|
#endif /* USE_W2 */ |
179 |
DO i=1,iMax |
DO i=1,iMax |
180 |
hFacZ(i,jMax)=0. |
hFacZ(i,jMax)=0. |
181 |
vort3(i,jMax)=0. |
vort3(i,jMax)=0. |
182 |
ENDDO |
ENDDO |
183 |
|
#ifdef USE_W2 |
184 |
|
ENDIF |
185 |
|
IF ( eastEdge ) THEN |
186 |
|
#endif /* USE_W2 */ |
187 |
DO j=1,jMax |
DO j=1,jMax |
188 |
hFacZ(iMax,j)=0. |
hFacZ(iMax,j)=0. |
189 |
vort3(iMax,j)=0. |
vort3(iMax,j)=0. |
190 |
ENDDO |
ENDDO |
191 |
|
#ifndef USE_W2 |
192 |
C-- S.W. corner: |
C-- S.W. corner: |
193 |
|
#else /* USE_W2 */ |
194 |
|
ENDIF |
195 |
|
C-- S.W. corner: |
196 |
|
IF ( southWestCorner ) THEN |
197 |
|
#endif /* USE_W2 */ |
198 |
i=1 |
i=1 |
199 |
j=1 |
j=1 |
200 |
vort3(i,j)= |
vort3(i,j)= |
207 |
& + _hFacW(i, j ,k,bi,bj) |
& + _hFacW(i, j ,k,bi,bj) |
208 |
& + _hFacS( i ,j,k,bi,bj) |
& + _hFacS( i ,j,k,bi,bj) |
209 |
& )/3. _d 0 |
& )/3. _d 0 |
210 |
|
#ifdef USE_W2 |
211 |
|
ENDIF |
212 |
|
IF ( southEastCorner ) THEN |
213 |
|
#endif /* USE_W2 */ |
214 |
C-- S.E. corner: |
C-- S.E. corner: |
215 |
i=iMax |
i=iMax |
216 |
j=1 |
j=1 |
224 |
& + _hFacW(i, j ,k,bi,bj) |
& + _hFacW(i, j ,k,bi,bj) |
225 |
& + _hFacS(i-1,j,k,bi,bj) |
& + _hFacS(i-1,j,k,bi,bj) |
226 |
& )/3. _d 0 |
& )/3. _d 0 |
227 |
|
#ifdef USE_W2 |
228 |
|
ENDIF |
229 |
|
IF ( northWestCorner ) THEN |
230 |
|
#endif /* USE_W2 */ |
231 |
C-- N.W. corner: |
C-- N.W. corner: |
232 |
i=1 |
i=1 |
233 |
j=jMax |
j=jMax |
241 |
& + _hFacW(i, j ,k,bi,bj) |
& + _hFacW(i, j ,k,bi,bj) |
242 |
& + _hFacS( i ,j,k,bi,bj) |
& + _hFacS( i ,j,k,bi,bj) |
243 |
& )/3. _d 0 |
& )/3. _d 0 |
244 |
|
#ifdef USE_W2 |
245 |
|
ENDIF |
246 |
|
IF ( northEastCorner ) THEN |
247 |
|
#endif /* USE_W2 */ |
248 |
C-- N.E. corner: |
C-- N.E. corner: |
249 |
i=iMax |
i=iMax |
250 |
j=jMax |
j=jMax |
258 |
& + _hFacW(i, j ,k,bi,bj) |
& + _hFacW(i, j ,k,bi,bj) |
259 |
& + _hFacS(i-1,j,k,bi,bj) |
& + _hFacS(i-1,j,k,bi,bj) |
260 |
& )/3. _d 0 |
& )/3. _d 0 |
261 |
|
#ifdef USE_W2 |
262 |
|
ENDIF |
263 |
|
#endif /* USE_W2 */ |
264 |
ENDIF |
ENDIF |
265 |
|
|
266 |
C- Special stuff for North & South Poles, LatLon grid |
C- Special stuff for North & South Poles, LatLon grid |
267 |
IF ( usingSphericalPolarGrid ) THEN |
IF ( usingSphericalPolarGrid ) THEN |
268 |
IF (yG(1,sNy+1,bi,bj).EQ.90.) THEN |
IF (yG(1,sNy+1,bi,bj).EQ.90.) THEN |
269 |
|
#ifndef USE_W2 |
270 |
jMax = sNy+1 |
jMax = sNy+1 |
271 |
|
#endif /* not USE_W2 */ |
272 |
j = jMax |
j = jMax |
273 |
DO i=1,sNx |
DO i=1,sNx |
274 |
vort3(i,j) = 0. |
vort3(i,j) = 0. |