/[MITgcm]/MITgcm/pkg/monitor/mon_vort3.F
ViewVC logotype

Diff of /MITgcm/pkg/monitor/mon_vort3.F

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

revision 1.11 by jmc, Sat Nov 5 01:01:51 2005 UTC revision 1.12 by jmc, Mon Oct 15 00:18:40 2007 UTC
# Line 36  C     !LOCAL VARIABLES: Line 36  C     !LOCAL VARIABLES:
36        INTEGER iMax,jMax        INTEGER iMax,jMax
37        _RL theVol, theArea, tmpVal, tmpAre, tmpVol        _RL theVol, theArea, tmpVal, tmpAre, tmpVol
38        _RL theMin, theMax, theMean, theVar, volMean, volVar, theSD        _RL theMin, theMax, theMean, theVar, volMean, volVar, theSD
39        _RL areaTile, volTile, sumTile, sqsTile, vSumTile, vSqsTile  c     _RL areaTile, volTile, sumTile, sqsTile, vSumTile, vSqsTile
40          _RL tileArea(nSx,nSy)
41          _RL tileVol (nSx,nSy)
42          _RL tileSum (nSx,nSy)
43          _RL tileVar (nSx,nSy)
44          _RL tileVSum(nSx,nSy)
45          _RL tileVSq (nSx,nSy)
46        _RL vort3(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL vort3(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47        _RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
48        _RL AZcorner        _RL AZcorner
# Line 44  C     !LOCAL VARIABLES: Line 50  C     !LOCAL VARIABLES:
50        _RL tmpFac        _RL tmpFac
51        _RL etaFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL etaFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
52  #endif  #endif
53        LOGICAL northWestCorner, northEastCorner        LOGICAL northWestCorner, northEastCorner
54        LOGICAL southWestCorner, southEastCorner        LOGICAL southWestCorner, southEastCorner
55        INTEGER iG        INTEGER iG
56  #ifdef ALLOW_EXCH2  #ifdef ALLOW_EXCH2
57        INTEGER myTile        INTEGER myTile
# Line 64  C     !LOCAL VARIABLES: Line 70  C     !LOCAL VARIABLES:
70    
71        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
72         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
73           areaTile= 0. _d 0           tileArea(bi,bj)= 0. _d 0
74           volTile = 0. _d 0           tileVol(bi,bj) = 0. _d 0
75           sumTile = 0. _d 0           tileSum(bi,bj) = 0. _d 0
76           sqsTile = 0. _d 0           tileVar(bi,bj) = 0. _d 0
77           vSumTile= 0. _d 0           tileVSum(bi,bj)= 0. _d 0
78           vSqsTile= 0. _d 0           tileVSq(bi,bj) = 0. _d 0
79  #ifdef MONITOR_TEST_HFACZ  #ifdef MONITOR_TEST_HFACZ
80           tmpFac = 0.           tmpFac = 0.
81           IF( implicDiv2Dflow.GT.0 .AND. abEps.GT.-0.5 )           IF( implicDiv2Dflow.GT.0 .AND. abEps.GT.-0.5 )
82       &    tmpFac = (0.5+abEps) / implicDiv2Dflow       &    tmpFac = (0.5+abEps) / implicDiv2Dflow
83           DO j=1-Oly,sNy+Oly           DO j=1-Oly,sNy+Oly
84            DO i=1-Olx,sNx+Olx            DO i=1-Olx,sNx+Olx
# Line 91  C     !LOCAL VARIABLES: Line 97  C     !LOCAL VARIABLES:
97  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
98  C-    Test various definitions of hFacZ (for 1 layer, flat bottom ocean):  C-    Test various definitions of hFacZ (for 1 layer, flat bottom ocean):
99  c          hFacZ(i,j) = 1. +  c          hFacZ(i,j) = 1. +
100  c    &           0.25 _d 0*( etaFld(i-1,j-1)  c    &           0.25 _d 0*( etaFld(i-1,j-1)
101  c    &                     + etaFld( i ,j-1)  c    &                     + etaFld( i ,j-1)
102  c    &                     + etaFld(i-1, j )  c    &                     + etaFld(i-1, j )
103  c    &                     + etaFld( i , j )  c    &                     + etaFld( i , j )
104  c    &                     )*recip_drF(k)  c    &                     )*recip_drF(k)
105  c          hFacZ(i,j) = 1. +  c          hFacZ(i,j) = 1. +
106  c    &           0.25 _d 0*( etaFld(i-1,j-1)*rA(i-1,j-1,bi,bj)  c    &           0.25 _d 0*( etaFld(i-1,j-1)*rA(i-1,j-1,bi,bj)
107  c    &                     + etaFld( i ,j-1)*rA( i ,j-1,bi,bj)  c    &                     + etaFld( i ,j-1)*rA( i ,j-1,bi,bj)
108  c    &                     + etaFld(i-1, j )*rA(i-1, j ,bi,bj)  c    &                     + etaFld(i-1, j )*rA(i-1, j ,bi,bj)
109  c    &                     + etaFld( i , j )*rA( i , j ,bi,bj)  c    &                     + etaFld( i , j )*rA( i , j ,bi,bj)
110  c    &                     )*recip_drF(k)*recip_rAz(i,j,bi,bj)  c    &                     )*recip_drF(k)*recip_rAz(i,j,bi,bj)
111             hFacZ(i,j) = 1. + 0.125 _d 0*             hFacZ(i,j) = 1. + 0.125 _d 0*
112       &                   ( ( etaFld(i-1,j-1)*rA(i-1,j-1,bi,bj)       &                   ( ( etaFld(i-1,j-1)*rA(i-1,j-1,bi,bj)
113       &                      +etaFld( i ,j-1)*rA( i ,j-1,bi,bj)       &                      +etaFld( i ,j-1)*rA( i ,j-1,bi,bj)
114       &                     )*recip_rAw(i,j-1,bi,bj)         &                     )*recip_rAw(i,j-1,bi,bj)
115       &                   + ( etaFld(i-1, j )*rA(i-1, j ,bi,bj)       &                   + ( etaFld(i-1, j )*rA(i-1, j ,bi,bj)
116       &                      +etaFld( i , j )*rA( i , j ,bi,bj)       &                      +etaFld( i , j )*rA( i , j ,bi,bj)
117       &                     )*recip_rAw(i, j ,bi,bj)       &                     )*recip_rAw(i, j ,bi,bj)
118       &                   + ( etaFld(i-1,j-1)*rA(i-1,j-1,bi,bj)       &                   + ( etaFld(i-1,j-1)*rA(i-1,j-1,bi,bj)
119       &                      +etaFld(i-1, j )*rA(i-1, j ,bi,bj)       &                      +etaFld(i-1, j )*rA(i-1, j ,bi,bj)
120       &                     )*recip_rAs(i-1,j,bi,bj)         &                     )*recip_rAs(i-1,j,bi,bj)
121       &                   + ( etaFld( i ,j-1)*rA( i ,j-1,bi,bj)       &                   + ( etaFld( i ,j-1)*rA( i ,j-1,bi,bj)
122       &                     + etaFld( i , j )*rA( i , j ,bi,bj)       &                     + etaFld( i , j )*rA( i , j ,bi,bj)
123       &                     )*recip_rAs( i ,j,bi,bj)       &                     )*recip_rAs( i ,j,bi,bj)
124       &                   )*recip_drF(k)       &                   )*recip_drF(k)
125  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
126  #else  #else
127  C-    Standard definition of hFac at vorticity point:  C-    Standard definition of hFac at vorticity point:
128             hFacZ(i,j) =             hFacZ(i,j) =
129       &           0.25 _d 0*( _hFacW(i,j-1,k,bi,bj)       &           0.25 _d 0*( _hFacW(i,j-1,k,bi,bj)
130       &                     + _hFacW(i, j ,k,bi,bj)       &                     + _hFacW(i, j ,k,bi,bj)
131       &                     + _hFacS(i-1,j,k,bi,bj)       &                     + _hFacS(i-1,j,k,bi,bj)
132       &                     + _hFacS( i ,j,k,bi,bj)       &                     + _hFacS( i ,j,k,bi,bj)
133       &                     )       &                     )
134  #endif /* MONITOR_TEST_HFACZ */  #endif /* MONITOR_TEST_HFACZ */
135             vort3(i,j) = recip_rAz(i,j,bi,bj)*(             vort3(i,j) = recip_rAz(i,j,bi,bj)*(
136       &       vVel( i ,j,k,bi,bj)*dyC( i ,j,bi,bj)       &       vVel( i ,j,k,bi,bj)*dyC( i ,j,bi,bj)
137       &      -vVel(i-1,j,k,bi,bj)*dyC(i-1,j,bi,bj)       &      -vVel(i-1,j,k,bi,bj)*dyC(i-1,j,bi,bj)
138       &      -uVel(i, j ,k,bi,bj)*dxC(i, j ,bi,bj)       &      -uVel(i, j ,k,bi,bj)*dxC(i, j ,bi,bj)
139       &      +uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)       &      +uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)
140       &                                       )       &                                       )
141            ENDDO            ENDDO
142           ENDDO           ENDDO
143    
# Line 158  c          AZcorner = 0.75 _d 0 Line 164  c          AZcorner = 0.75 _d 0
164  #ifdef ALLOW_EXCH2  #ifdef ALLOW_EXCH2
165             myTile = W2_myTileList(bi)             myTile = W2_myTileList(bi)
166             iG = exch2_myFace(myTile)             iG = exch2_myFace(myTile)
167             southWestCorner = exch2_isWedge(myTile).EQ.1             southWestCorner = exch2_isWedge(myTile).EQ.1
168       &                 .AND. exch2_isSedge(myTile).EQ.1       &                 .AND. exch2_isSedge(myTile).EQ.1
169             southEastCorner = exch2_isEedge(myTile).EQ.1             southEastCorner = exch2_isEedge(myTile).EQ.1
170       &                 .AND. exch2_isSedge(myTile).EQ.1       &                 .AND. exch2_isSedge(myTile).EQ.1
# Line 183  C--       S.W. corner: Line 189  C--       S.W. corner:
189       &       -uVel(i,j,k,bi,bj)*dxC(i,j,bi,bj)       &       -uVel(i,j,k,bi,bj)*dxC(i,j,bi,bj)
190       &       +uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)       &       +uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)
191       &       )       &       )
192             hFacZ(i,j) = ( _hFacW(i,j-1,k,bi,bj)             hFacZ(i,j) = ( _hFacW(i,j-1,k,bi,bj)
193       &                  + _hFacW(i, j ,k,bi,bj)       &                  + _hFacW(i, j ,k,bi,bj)
194       &                  + _hFacS( i ,j,k,bi,bj)       &                  + _hFacS( i ,j,k,bi,bj)
195       &                  )/3. _d 0       &                  )/3. _d 0
196            ENDIF            ENDIF
# Line 192  C--       S.W. corner: Line 198  C--       S.W. corner:
198  C--        S.E. corner:  C--        S.E. corner:
199             i=iMax             i=iMax
200             j=1             j=1
201             vort3(I,J)=             vort3(i,j)=
202       &       +recip_rAz(I,J,bi,bj)/AZcorner*(       &       +recip_rAz(i,j,bi,bj)/AZcorner*(
203       &       -vVel(i-1,j,k,bi,bj)*dyC(i-1,j,bi,bj)       &       -vVel(i-1,j,k,bi,bj)*dyC(i-1,j,bi,bj)
204       &       -uVel(i,j,k,bi,bj)*dxC(i,j,bi,bj)       &       -uVel(i,j,k,bi,bj)*dxC(i,j,bi,bj)
205       &       +uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)       &       +uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)
206       &       )       &       )
207             hFacZ(i,j) = ( _hFacW(i,j-1,k,bi,bj)             hFacZ(i,j) = ( _hFacW(i,j-1,k,bi,bj)
208       &                  + _hFacW(i, j ,k,bi,bj)       &                  + _hFacW(i, j ,k,bi,bj)
209       &                  + _hFacS(i-1,j,k,bi,bj)       &                  + _hFacS(i-1,j,k,bi,bj)
210       &                  )/3. _d 0       &                  )/3. _d 0
211            ENDIF            ENDIF
212            IF ( northWestCorner ) THEN            IF ( northWestCorner ) THEN
# Line 213  C--        N.W. corner: Line 219  C--        N.W. corner:
219       &       -uVel(i,j,k,bi,bj)*dxC(i,j,bi,bj)       &       -uVel(i,j,k,bi,bj)*dxC(i,j,bi,bj)
220       &       +uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)       &       +uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)
221       &       )       &       )
222             hFacZ(i,j) = ( _hFacW(i,j-1,k,bi,bj)             hFacZ(i,j) = ( _hFacW(i,j-1,k,bi,bj)
223       &                  + _hFacW(i, j ,k,bi,bj)       &                  + _hFacW(i, j ,k,bi,bj)
224       &                  + _hFacS( i ,j,k,bi,bj)       &                  + _hFacS( i ,j,k,bi,bj)
225       &                  )/3. _d 0       &                  )/3. _d 0
226            ENDIF            ENDIF
# Line 228  C--        N.E. corner: Line 234  C--        N.E. corner:
234       &       -uVel(i,j,k,bi,bj)*dxC(i,j,bi,bj)       &       -uVel(i,j,k,bi,bj)*dxC(i,j,bi,bj)
235       &       +uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)       &       +uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)
236       &       )       &       )
237             hFacZ(i,j) = ( _hFacW(i,j-1,k,bi,bj)             hFacZ(i,j) = ( _hFacW(i,j-1,k,bi,bj)
238       &                  + _hFacW(i, j ,k,bi,bj)       &                  + _hFacW(i, j ,k,bi,bj)
239       &                  + _hFacS(i-1,j,k,bi,bj)       &                  + _hFacS(i-1,j,k,bi,bj)
240       &                  )/3. _d 0       &                  )/3. _d 0
241            ENDIF            ENDIF
242           ENDIF           ENDIF
# Line 246  C-    Special stuff for North & South Po Line 252  C-    Special stuff for North & South Po
252       &                 + uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)       &                 + uVel(i,j-1,k,bi,bj)*dxC(i,j-1,bi,bj)
253              hFacZ(i,j) = 0.              hFacZ(i,j) = 0.
254  #ifndef MONITOR_TEST_HFACZ  #ifndef MONITOR_TEST_HFACZ
255              hFacZ(1,j) = hFacZ(1,j) + _hFacW(i,j-1,k,bi,bj)              hFacZ(1,j) = hFacZ(1,j) + _hFacW(i,j-1,k,bi,bj)
256             ENDDO             ENDDO
257  #else  #else
258              hFacZ(1,j) = hFacZ(1,j) + etaFld(i,j-1)              hFacZ(1,j) = hFacZ(1,j) + etaFld(i,j-1)
259             ENDDO             ENDDO
260              hFacZ(1,j) = sNx + hFacZ(1,j)*recip_drF(k)              hFacZ(1,j) = sNx + hFacZ(1,j)*recip_drF(k)
261  #endif  #endif
# Line 264  C-    Special stuff for North & South Po Line 270  C-    Special stuff for North & South Po
270       &                 - uVel(i,j,k,bi,bj)*dxC(i,j,bi,bj)       &                 - uVel(i,j,k,bi,bj)*dxC(i,j,bi,bj)
271              hFacZ(i,j) = 0.              hFacZ(i,j) = 0.
272  #ifndef MONITOR_TEST_HFACZ  #ifndef MONITOR_TEST_HFACZ
273              hFacZ(1,j) = hFacZ(1,j) + _hFacW(i,j,k,bi,bj)              hFacZ(1,j) = hFacZ(1,j) + _hFacW(i,j,k,bi,bj)
274             ENDDO             ENDDO
275  #else  #else
276              hFacZ(1,j) = hFacZ(1,j) + etaFld(i,j)              hFacZ(1,j) = hFacZ(1,j) + etaFld(i,j)
277             ENDDO             ENDDO
278              hFacZ(1,j) = sNx + hFacZ(1,j)*recip_drF(k)              hFacZ(1,j) = sNx + hFacZ(1,j)*recip_drF(k)
279  #endif  #endif
# Line 278  C-    Special stuff for North & South Po Line 284  C-    Special stuff for North & South Po
284    
285  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
286    
287           DO J=1,jMax           DO j=1,jMax
288            DO I=1,iMax            DO i=1,iMax
289             IF (hFacZ(i,j).GT.0. _d 0) THEN             IF (hFacZ(i,j).GT.0. _d 0) THEN
290              tmpVal = vort3(i,j)              tmpVal = vort3(i,j)
291              tmpAre = rAz(i,j,bi,bj)*drF(k)              tmpAre = rAz(i,j,bi,bj)*drF(k)
292              tmpVol = rAz(i,j,bi,bj)*drF(k)*hFacZ(i,j)              tmpVol = rAz(i,j,bi,bj)*drF(k)*hFacZ(i,j)
293              areaTile = areaTile + tmpAre              tileArea(bi,bj)  = tileArea(bi,bj)  + tmpAre
294  C-       min,max of relative vorticity ("r")  C-       min,max of relative vorticity ("r")
295              theMin = MIN(theMin,tmpVal)              theMin = MIN(theMin,tmpVal)
296              theMax = MAX(theMax,tmpVal)              theMax = MAX(theMax,tmpVal)
297  C-       average & std.dev of absolute vorticity ("a")  C-       average & std.dev of absolute vorticity ("a")
298              tmpVal = tmpVal + fCoriG(i,j,bi,bj)              tmpVal = tmpVal + fCoriG(i,j,bi,bj)
299              sumTile = sumTile + tmpAre*tmpVal              tileSum(bi,bj) = tileSum(bi,bj) + tmpAre*tmpVal
300              sqsTile = sqsTile + tmpAre*tmpVal*tmpVal              tileVar(bi,bj) = tileVar(bi,bj) + tmpAre*tmpVal*tmpVal
301  C-       average & std.dev of potential vorticity ("p")  C-       average & std.dev of potential vorticity ("p")
302              tmpVal = tmpVal / hFacZ(i,j)              tmpVal = tmpVal / hFacZ(i,j)
303              volTile  = volTile  + tmpVol              tileVol(bi,bj) = tileVol(bi,bj) + tmpVol
304              vSumTile = vSumTile + tmpVol*tmpVal              tileVSum(bi,bj)= tileVSum(bi,bj)+ tmpVol*tmpVal
305              vSqsTile = vSqsTile + tmpVol*tmpVal*tmpVal              tileVSq(bi,bj) = tileVSq(bi,bj) + tmpVol*tmpVal*tmpVal
306             ENDIF             ENDIF
307            ENDDO            ENDDO
308           ENDDO           ENDDO
309    
310          ENDDO          ENDDO
311          theArea= theArea + areaTile  c       theArea= theArea + tileArea(bi,bj)
312          theVol = theVol  + volTile  c       theVol = theVol  + tileVol (bi,bj)
313          theMean= theMean + sumTile  c       theMean= theMean + tileSum(bi,bj)
314          theVar = theVar  + sqsTile  c       theVar = theVar  + tileVar(bi,bj)
315          volMean= volMean + vSumTile  c       volMean= volMean + tileVSum(bi,bj)
316          volVar = volVar  + vSqsTile  c       volVar = volVar  + tileVSq(bi,bj)
317         ENDDO         ENDDO
318        ENDDO        ENDDO
319    
320        theMin = -theMin        theMin = -theMin
321        _GLOBAL_MAX_R8(theMin, myThid)        _GLOBAL_MAX_R8(theMin, myThid)
322        _GLOBAL_MAX_R8(theMax, myThid)        _GLOBAL_MAX_R8(theMax, myThid)
       _GLOBAL_SUM_R8(theArea,myThid)  
       _GLOBAL_SUM_R8(theVol, myThid)  
       _GLOBAL_SUM_R8(theMean,myThid)  
       _GLOBAL_SUM_R8(theVar, myThid)  
       _GLOBAL_SUM_R8(volMean,myThid)  
       _GLOBAL_SUM_R8(volVar ,myThid)  
323        theMin = -theMin        theMin = -theMin
324        IF (theArea.GT.0.) THEN  c     _GLOBAL_SUM_R8(theArea,myThid)
325    c     _GLOBAL_SUM_R8(theVol, myThid)
326    c     _GLOBAL_SUM_R8(theMean,myThid)
327    c     _GLOBAL_SUM_R8(theVar, myThid)
328    c     _GLOBAL_SUM_R8(volMean,myThid)
329    c     _GLOBAL_SUM_R8(volVar ,myThid)
330          CALL GLOBAL_SUM_TILE_RL( tileArea, theArea, myThid )
331          CALL GLOBAL_SUM_TILE_RL( tileVol,  theVol,  myThid )
332          CALL GLOBAL_SUM_TILE_RL( tileSum,  theMean, myThid )
333          CALL GLOBAL_SUM_TILE_RL( tileVar,  theVar,  myThid )
334          CALL GLOBAL_SUM_TILE_RL( tileVSum, volMean, myThid )
335          CALL GLOBAL_SUM_TILE_RL( tileVSq,  volVar,  myThid )
336          IF (theArea.GT.0.) THEN
337          theMean= theMean/theArea          theMean= theMean/theArea
338          theVar = theVar /theArea          theVar = theVar /theArea
339          theVar = theVar - theMean*theMean          theVar = theVar - theMean*theMean

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.22