/[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.6 by jmc, Mon Nov 10 23:03:29 2003 UTC revision 1.7 by adcroft, Fri Feb 6 19:59:36 2004 UTC
# Line 27  C     === Routine arguments === Line 27  C     === Routine arguments ===
27        _RS arrDr(myNr)        _RS arrDr(myNr)
28        _RL theMin        _RL theMin
29        _RL theMax        _RL theMax
30        _RL theMean        _RL theMean,theMeanTile
31        _RL theSD        _RL theSD,theSDTile
32        _RL theDel2        _RL theDel2,theDel2Tile
33        _RL theVol        _RL theVol,theVolTile
34        INTEGER myThid        INTEGER myThid
35    
36  C     === Local variables ====  C     === Local variables ====
# Line 38  C     === Local variables ==== Line 38  C     === Local variables ====
38        INTEGER numPnts        INTEGER numPnts
39        LOGICAL noPnts        LOGICAL noPnts
40        _RL tmpVal,rNumPnts        _RL tmpVal,rNumPnts
41        _RL theVar        _RL theVar,theVarTile
42        _RL tmpVol        _RL tmpVol
43    
44        theMin=0.        theMin=0.
# Line 53  C     === Local variables ==== Line 53  C     === Local variables ====
53    
54        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
55         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
56            theDel2 = 0.
57            theVol = 0.
58            theMean = 0.
59            theVar = 0.
60          DO K=1,myNr          DO K=1,myNr
61           DO J=1,sNy           DO J=1,sNy
62            DO I=1,sNx            DO I=1,sNx
# Line 67  c          IF (tmpVal.NE.0.) THEN Line 71  c          IF (tmpVal.NE.0.) THEN
71             IF (arrMask(I,J,K,bi,bj).NE.0.) THEN             IF (arrMask(I,J,K,bi,bj).NE.0.) THEN
72              theMin=min(theMin,tmpVal)              theMin=min(theMin,tmpVal)
73              theMax=max(theMax,tmpVal)              theMax=max(theMax,tmpVal)
74              theDel2 = theDel2+0.25*ABS(              theDel2Tile = theDel2Tile+0.25*ABS(
75       &         (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)
76       &        +(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)
77       &        +(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)
# Line 76  c          IF (tmpVal.NE.0.) THEN Line 80  c          IF (tmpVal.NE.0.) THEN
80              numPnts=numPnts+1              numPnts=numPnts+1
81              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)
82       &                                 *arrMask(I,J,K,bi,bj)       &                                 *arrMask(I,J,K,bi,bj)
83              theVol = theVol   + tmpVol              theVolTile = theVolTile   + tmpVol
84              theMean = theMean + tmpVol*tmpVal              theMeanTile = theMeanTile + tmpVol*tmpVal
85              theVar = theVar   + tmpVol*tmpVal**2              theVarTile = theVarTile   + tmpVol*tmpVal**2
86             ENDIF             ENDIF
87            ENDDO            ENDDO
88           ENDDO           ENDDO
89          ENDDO          ENDDO
90            theDel2 = theDel2 + theDel2Tile
91            theVol = theVol + theVolTile
92            theMean = theMean + theMeanTile
93            theVar = theVar + theVarTile
94         ENDDO         ENDDO
95        ENDDO        ENDDO
96    
# Line 109  c          IF (tmpVal.NE.0.) THEN Line 117  c          IF (tmpVal.NE.0.) THEN
117    
118         DO bj=myByLo(myThid),myByHi(myThid)         DO bj=myByLo(myThid),myByHi(myThid)
119          DO bi=myBxLo(myThid),myBxHi(myThid)          DO bi=myBxLo(myThid),myBxHi(myThid)
120             theSDtile=0.
121           DO K=1,myNr           DO K=1,myNr
122            DO J=1,sNy            DO J=1,sNy
123             DO I=1,sNx             DO I=1,sNx
# Line 117  c           IF (tmpVal.NE.0.) THEN Line 126  c           IF (tmpVal.NE.0.) THEN
126              IF (arrMask(I,J,K,bi,bj).NE.0.) THEN              IF (arrMask(I,J,K,bi,bj).NE.0.) THEN
127               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)
128       &                                *arrMask(I,J,K,bi,bj)       &                                *arrMask(I,J,K,bi,bj)
129               theSD = theSD + tmpVol*(tmpVal-theMean)**2               theSDtile = theSDtile + tmpVol*(tmpVal-theMean)**2
130              ENDIF              ENDIF
131             ENDDO             ENDDO
132            ENDDO            ENDDO
133           ENDDO           ENDDO
134             theSD = theSD + theSDtile
135          ENDDO          ENDDO
136         ENDDO         ENDDO
137    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.22