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

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

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

revision 1.9 by jmc, Sat Jun 15 03:14:53 2002 UTC revision 1.10 by jmc, Fri May 2 22:29:07 2003 UTC
# Line 4  C $Name$ Line 4  C $Name$
4  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
5    
6        SUBROUTINE MON_KE(        SUBROUTINE MON_KE(
7       I                myThid )       I                  myIter, myThid )
8  C     /==========================================================\  C     /==========================================================\
9  C     | SUBROUTINE MON_KE                                        |  C     | SUBROUTINE MON_KE                                        |
10  C     | o Calculates stats for Kinetic energy                    |  C     | o Calculates stats for Kinetic energy                    |
# Line 18  C     === Global data === Line 18  C     === Global data ===
18  #include "DYNVARS.h"  #include "DYNVARS.h"
19  #include "MONITOR.h"  #include "MONITOR.h"
20  #include "GRID.h"  #include "GRID.h"
21    #include "SURFACE.h"
22    
23  C     === Routine arguments ===  C     === Routine arguments ===
24        INTEGER myThid        INTEGER myIter, myThid
25    
26  C     === Local variables ====  C     === Local variables ====
27        INTEGER bi,bj,I,J,K        INTEGER bi,bj,I,J,K
28        _RL tmpVal,tmpVol,theMax,theMean,theVolMean,theVol        _RL numPnts,theVol,tmpVal,tmpVol
29        INTEGER numPnts        _RL theMax,theMean,theVolMean,potEnMean
30    
31          numPnts=0.
32          theVol=0.
33        theMax=0.        theMax=0.
       numPnts=0  
34        theMean=0.        theMean=0.
35        theVolMean=0.        theVolMean=0.
36        theVol=0.        potEnMean =0.
37    
38        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
39         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
# Line 67  C    with no assumption on how grid spac Line 69  C    with no assumption on how grid spac
69             theMax=max(theMax,tmpVal)             theMax=max(theMax,tmpVal)
70             IF (tmpVal.NE.0.) THEN             IF (tmpVal.NE.0.) THEN
71              theMean=theMean+tmpVal              theMean=theMean+tmpVal
72              numPnts=numPnts+1              numPnts=numPnts+1.
73             ENDIF             ENDIF
74    
75            ENDDO            ENDDO
76           ENDDO           ENDDO
77          ENDDO          ENDDO
78    C- Potential Energy (external mode):
79             DO J=1,sNy
80              DO I=1,sNx
81               tmpVal = 0.5 _d 0*Bo_surf(i,j,bi,bj)
82         &                      *etaN(i,j,bi,bj)*etaN(i,j,bi,bj)
83    C- jmc: if geoid not flat (phi0surf), needs to add this term.
84    C       not sure for atmos/ocean in P ; or atmos. loading in ocean-Z
85               tmpVal = tmpVal
86         &            + phi0surf(i,j,bi,bj)*etaN(i,j,bi,bj)
87               potEnMean = potEnMean
88         &               + tmpVal*rA(i,j,bi,bj)*maskH(i,j,bi,bj)
89    c          tmpVal = etaN(i,j,bi,bj)
90    c    &            + phi0surf(i,j,bi,bj)*recip_Bo(i,j,bi,bj)
91    c          potEnMean = potEnMean
92    c    &        + 0.5 _d 0*Bo_surf(i,j,bi,bj)*tmpVal*tmpVal
93    c    &                  *rA(i,j,bi,bj)*maskH(i,j,bi,bj)
94              ENDDO
95             ENDDO
96    C- end bi,bj loops
97         ENDDO         ENDDO
98        ENDDO        ENDDO
99          _GLOBAL_SUM_R8(numPnts,myThid)
100        _GLOBAL_MAX_R8(theMax,myThid)        _GLOBAL_MAX_R8(theMax,myThid)
101        _GLOBAL_SUM_R8(theMean,myThid)        _GLOBAL_SUM_R8(theMean,myThid)
102        tmpVal=float(numPnts)        IF (numPnts.NE.0.) theMean=theMean/numPnts
       _GLOBAL_SUM_R8(tmpVal,myThid)  
       IF (tmpVal.NE.0.) theMean=theMean/tmpVal  
103        _GLOBAL_SUM_R8(theVol,myThid)        _GLOBAL_SUM_R8(theVol,myThid)
104        _GLOBAL_SUM_R8(theVolMean,myThid)        _GLOBAL_SUM_R8(theVolMean,myThid)
105          _GLOBAL_SUM_R8(potEnMean, myThid)
106          IF (theVol.NE.0.) THEN
107            theVolMean=theVolMean/theVol
108            potEnMean = potEnMean/theVol
109          ENDIF
110    
111    C--   Print stats for (barotropic) Potential Energy:
112          CALL MON_SET_PREF('pe_b',myThid)
113          CALL MON_OUT_RL(mon_string_none,potEnMean,
114         &         mon_foot_mean,myThid)
115    
116    C--   Print stats for KE
117          CALL MON_SET_PREF('ke',myThid)
118        CALL MON_OUT_RL(mon_string_none,theMax,mon_foot_max,myThid)        CALL MON_OUT_RL(mon_string_none,theMax,mon_foot_max,myThid)
119        CALL MON_OUT_RL(mon_string_none,theMean,mon_foot_mean,myThid)  c     CALL MON_OUT_RL(mon_string_none,theMean,mon_foot_mean,myThid)
       CALL MON_OUT_RL(mon_string_none,theVolMean,  
      &         mon_foot_volint,myThid)  
       IF (theVol.NE.0.) theVolMean=theVolMean/theVol  
120        CALL MON_OUT_RL(mon_string_none,theVolMean,        CALL MON_OUT_RL(mon_string_none,theVolMean,
121       &         mon_foot_volmean,myThid)       &         mon_foot_mean,myThid)
122        CALL MON_OUT_RL(mon_string_none,theVol,        CALL MON_OUT_RL(mon_string_none,theVol,
123       &         mon_foot_vol,myThid)       &         mon_foot_vol,myThid)
124    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.22