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

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

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

revision 1.11 by jmc, Thu Jan 27 16:36:24 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 numPnts        INTEGER numPnts
37        LOGICAL noPnts        LOGICAL noPnts
38        _RL tmpVal,rNumPnts        _RL tmpVal,rNumPnts
39        _RL theVar,theVarTile        _RL theVar
40        _RL tmpVol        _RL tmpVol
41        _RL theMeanTile, theSDTile, theDel2Tile, theVolTile        _RL tileMean(nSx,nSy)
42          _RL tileVar (nSx,nSy)
43          _RL tileSD  (nSx,nSy)
44          _RL tileDel2(nSx,nSy)
45          _RL tileVol (nSx,nSy)
46    
47        theMin=0.        theMin=0.
48        theMax=0.        theMax=0.
# Line 52  C     !LOCAL VARIABLES: Line 56  C     !LOCAL VARIABLES:
56    
57        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
58         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
59          theDel2Tile = 0.          tileDel2(bi,bj) = 0.
60          theVolTile = 0.          tileVol (bi,bj) = 0.
61          theMeanTile = 0.          tileMean(bi,bj) = 0.
62          theVarTile = 0.          tileVar (bi,bj) = 0.
63          DO K=1,myNr          DO K=1,myNr
64           DO J=1,sNy           DO J=1,sNy
65            DO I=1,sNx            DO I=1,sNx
# Line 68  C     !LOCAL VARIABLES: Line 72  C     !LOCAL VARIABLES:
72             IF (arrMask(I,J,K,bi,bj).NE.0.) THEN             IF (arrMask(I,J,K,bi,bj).NE.0.) THEN
73              theMin=min(theMin,tmpVal)              theMin=min(theMin,tmpVal)
74              theMax=max(theMax,tmpVal)              theMax=max(theMax,tmpVal)
75              theDel2Tile = theDel2Tile+0.25*ABS(              tileDel2(bi,bj) = tileDel2(bi,bj)
76         &      + 0.25*ABS(
77       &         (arr(I+1,J,K,bi,bj)-tmpVal)*arrMask(I+1,J,K,bi,bj)       &         (arr(I+1,J,K,bi,bj)-tmpVal)*arrMask(I+1,J,K,bi,bj)
78       &        +(arr(I-1,J,K,bi,bj)-tmpVal)*arrMask(I-1,J,K,bi,bj)       &        +(arr(I-1,J,K,bi,bj)-tmpVal)*arrMask(I-1,J,K,bi,bj)
79       &        +(arr(I,J+1,K,bi,bj)-tmpVal)*arrMask(I,J+1,K,bi,bj)       &        +(arr(I,J+1,K,bi,bj)-tmpVal)*arrMask(I,J+1,K,bi,bj)
80       &        +(arr(I,J-1,K,bi,bj)-tmpVal)*arrMask(I,J-1,K,bi,bj)       &        +(arr(I,J-1,K,bi,bj)-tmpVal)*arrMask(I,J-1,K,bi,bj)
81       &                               )       &                )
82              numPnts=numPnts+1              numPnts=numPnts+1
83              tmpVol = arrArea(I,J,bi,bj)*arrhFac(I,J,K,bi,bj)*arrDr(K)              tmpVol = arrArea(I,J,bi,bj)*arrhFac(I,J,K,bi,bj)*arrDr(K)
84       &                                 *arrMask(I,J,K,bi,bj)       &                                 *arrMask(I,J,K,bi,bj)
85              theVolTile = theVolTile   + tmpVol              tileVol (bi,bj) = tileVol (bi,bj) + tmpVol
86              theMeanTile = theMeanTile + tmpVol*tmpVal              tileMean(bi,bj) = tileMean(bi,bj) + tmpVol*tmpVal
87              theVarTile = theVarTile   + tmpVol*tmpVal*tmpVal              tileVar (bi,bj) = tileVar (bi,bj) + tmpVol*tmpVal*tmpVal
88             ENDIF             ENDIF
89            ENDDO            ENDDO
90           ENDDO           ENDDO
91          ENDDO          ENDDO
92          theDel2 = theDel2 + theDel2Tile  c       theDel2 = theDel2 + tileDel2(bi,bj)
93          theVol = theVol + theVolTile  c       theVol  = theVol  + tileVol(bi,bj)
94          theMean = theMean + theMeanTile  c       theMean = theMean + tileMean(bi,bj)
95          theVar = theVar + theVarTile  c       theVar  = theVar  + tileVar (bi,bj)
96         ENDDO         ENDDO
97        ENDDO        ENDDO
98    
99        _GLOBAL_SUM_R8(theDel2,myThid)  c     _GLOBAL_SUM_R8(theDel2,myThid)
100        _GLOBAL_SUM_R8(theVol,myThid)  c     _GLOBAL_SUM_R8(theVol,myThid)
101        _GLOBAL_SUM_R8(theMean,myThid)  c     _GLOBAL_SUM_R8(theMean,myThid)
102        _GLOBAL_SUM_R8(theVar,myThid)  c     _GLOBAL_SUM_R8(theVar,myThid)
103          CALL GLOBAL_SUM_TILE_RL( tileDel2, theDel2, myThid )
104          CALL GLOBAL_SUM_TILE_RL( tileVol , theVol , myThid )
105          CALL GLOBAL_SUM_TILE_RL( tileMean, theMean, myThid )
106          CALL GLOBAL_SUM_TILE_RL( tileVar , theVar , myThid )
107        tmpVal=FLOAT(numPnts)        tmpVal=FLOAT(numPnts)
108        _GLOBAL_SUM_R8(tmpVal,myThid)        _GLOBAL_SUM_R8(tmpVal,myThid)
109        numPnts=NINT(tmpVal)        numPnts=NINT(tmpVal)
# Line 116  C     !LOCAL VARIABLES: Line 125  C     !LOCAL VARIABLES:
125    
126         DO bj=myByLo(myThid),myByHi(myThid)         DO bj=myByLo(myThid),myByHi(myThid)
127          DO bi=myBxLo(myThid),myBxHi(myThid)          DO bi=myBxLo(myThid),myBxHi(myThid)
128           theSDtile=0.           tileSD(bi,bj)=0.
129           DO K=1,myNr           DO K=1,myNr
130            DO J=1,sNy            DO J=1,sNy
131             DO I=1,sNx             DO I=1,sNx
132              tmpVal=arr(I,J,K,bi,bj)              tmpVal=arr(I,J,K,bi,bj)
 c           IF (tmpVal.NE.0.) THEN  
133              IF (arrMask(I,J,K,bi,bj).NE.0.) THEN              IF (arrMask(I,J,K,bi,bj).NE.0.) THEN
134               tmpVol=arrArea(I,J,bi,bj)*arrhFac(I,J,K,bi,bj)*arrDr(K)               tmpVol=arrArea(I,J,bi,bj)*arrhFac(I,J,K,bi,bj)*arrDr(K)
135       &                                *arrMask(I,J,K,bi,bj)       &                                *arrMask(I,J,K,bi,bj)
136               theSDtile = theSDtile + tmpVol*(tmpVal-theMean)**2               tileSD(bi,bj) = tileSD(bi,bj)
137         &                     + tmpVol*(tmpVal-theMean)*(tmpVal-theMean)
138              ENDIF              ENDIF
139             ENDDO             ENDDO
140            ENDDO            ENDDO
141           ENDDO           ENDDO
142           theSD = theSD + theSDtile  c        theSD = theSD + tileSD(bi,bj)
143          ENDDO          ENDDO
144         ENDDO         ENDDO
145    
146         _GLOBAL_SUM_R8(theSD,myThid)  c      _GLOBAL_SUM_R8(theSD,myThid)
147           CALL GLOBAL_SUM_TILE_RL( tileSD, theSD, myThid )
148    
149         theSD=sqrt(theSD/theVol)         theSD = SQRT(theSD/theVol)
150  c      theSD=sqrt(theVar-theMean**2)  c      theSD = SQRT(theVar-theMean*theMean)
151        ENDIF        ENDIF
152    
153        RETURN        RETURN

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

  ViewVC Help
Powered by ViewVC 1.1.22