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

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

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


Revision 1.16 - (show annotations) (download)
Mon Oct 15 00:20:47 2007 UTC (16 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59k, checkpoint61f, checkpoint59j, checkpoint61e, checkpoint61g, checkpoint61d, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61l, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i
Changes since 1.15: +45 -34 lines
- use GLOBAL_SUM_TILE instead of _GLOBAL_SUM
- account for deep Atmosphere factor and density factor (anelastic)

1 C $Header: /u/gcmpack/MITgcm/pkg/monitor/mon_ke.F,v 1.15 2006/06/07 01:55:15 heimbach Exp $
2 C $Name: $
3
4 #include "MONITOR_OPTIONS.h"
5
6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 CBOP
8 C !ROUTINE: MON_KE
9
10 C !INTERFACE:
11 SUBROUTINE MON_KE(
12 I myIter, myThid )
13
14 C !DESCRIPTION:
15 C Calculates stats for Kinetic energy
16
17 C !USES:
18 IMPLICIT NONE
19 #include "SIZE.h"
20 #include "EEPARAMS.h"
21 #include "PARAMS.h"
22 #include "DYNVARS.h"
23 #include "MONITOR.h"
24 #include "GRID.h"
25 #include "SURFACE.h"
26
27 C !INPUT PARAMETERS:
28 INTEGER myIter, myThid
29 CEOP
30
31 C !LOCAL VARIABLES:
32 INTEGER bi,bj,i,j,k
33 _RL numPnts,theVol,tmpVal
34 _RL theMax,theMean,theVolMean,potEnMean
35 _RL tileMean(nSx,nSy)
36 _RL tileVlAv(nSx,nSy)
37 _RL tilePEav(nSx,nSy)
38 _RL tileVol (nSx,nSy)
39
40 numPnts=0.
41 theVol=0.
42 theMax=0.
43 theMean=0.
44 theVolMean=0.
45 potEnMean =0.
46
47 DO bj=myByLo(myThid),myByHi(myThid)
48 DO bi=myBxLo(myThid),myBxHi(myThid)
49 tileVol(bi,bj) = 0. _d 0
50 tileMean(bi,bj) = 0. _d 0
51 tileVlAv(bi,bj) = 0. _d 0
52 tilePEav(bi,bj) = 0. _d 0
53 DO k=1,Nr
54 DO j=1,sNy
55 DO i=1,sNx
56 tileVol(bi,bj) = tileVol(bi,bj)
57 & + rA(i,j,bi,bj)*deepFac2C(k)
58 & *rhoFacC(k)*drF(k)*_hFacC(i,j,k,bi,bj)
59
60 C- Vector Invariant form (like in pkg/mom_vecinv/mom_vi_calc_ke.F)
61 c tmpVal=0.25*( uVel( i , j ,k,bi,bj)*uVel( i , j ,k,bi,bj)
62 c & +uVel(i+1, j ,k,bi,bj)*uVel(i+1, j ,k,bi,bj)
63 c & +vVel( i , j ,k,bi,bj)*vVel( i , j ,k,bi,bj)
64 c & +vVel( i ,j+1,k,bi,bj)*vVel( i ,j+1,k,bi,bj) )
65 c tileVlAv(bi,bj) = tileVlAv(bi,bj)
66 c & +tmpVal*rA(i,j,bi,bj)*drF(k)*hFacC(i,j,k,bi,bj)
67
68 C- Energy conservative form (like in pkg/mom_fluxform/mom_calc_ke.F)
69 C this is the safe way to check the energy conservation
70 C with no assumption on how grid spacing & area are defined.
71 tmpVal=0.25*(
72 & uVel( i ,j,k,bi,bj)*uVel( i ,j,k,bi,bj)
73 & *dyG( i ,j,bi,bj)*dxC( i ,j,bi,bj)*_hFacW( i ,j,k,bi,bj)
74 & +uVel(i+1,j,k,bi,bj)*uVel(i+1,j,k,bi,bj)
75 & *dyG(i+1,j,bi,bj)*dxC(i+1,j,bi,bj)*_hFacW(i+1,j,k,bi,bj)
76 & +vVel(i, j ,k,bi,bj)*vVel(i, j ,k,bi,bj)
77 & *dxG(i, j ,bi,bj)*dyC(i, j ,bi,bj)*_hFacS(i, j ,k,bi,bj)
78 & +vVel(i,j+1,k,bi,bj)*vVel(i,j+1,k,bi,bj)
79 & *dxG(i,j+1,bi,bj)*dyC(i,j+1,bi,bj)*_hFacS(i,j+1,k,bi,bj)
80 & )
81 tileVlAv(bi,bj) = tileVlAv(bi,bj)
82 & + tmpVal*deepFac2C(k)*rhoFacC(k)*drF(k)
83 tmpVal= tmpVal*_recip_hFacC(i,j,k,bi,bj)*recip_rA(i,j,bi,bj)
84
85 theMax=MAX(theMax,tmpVal)
86 IF (tmpVal.NE.0.) THEN
87 tileMean(bi,bj)=tileMean(bi,bj)+tmpVal
88 numPnts=numPnts+1.
89 ENDIF
90
91 ENDDO
92 ENDDO
93 ENDDO
94 C- Potential Energy (external mode):
95 DO j=1,sNy
96 DO i=1,sNx
97 tmpVal = 0.5 _d 0*Bo_surf(i,j,bi,bj)
98 & *etaN(i,j,bi,bj)*etaN(i,j,bi,bj)
99 C- jmc: if geoid not flat (phi0surf), needs to add this term.
100 C not sure for atmos/ocean in P ; or atmos. loading in ocean-Z
101 tmpVal = tmpVal
102 & + phi0surf(i,j,bi,bj)*etaN(i,j,bi,bj)
103 tilePEav(bi,bj) = tilePEav(bi,bj)
104 & + tmpVal*rA(i,j,bi,bj)*deepFac2F(1)*maskH(i,j,bi,bj)
105 c tmpVal = etaN(i,j,bi,bj)
106 c & + phi0surf(i,j,bi,bj)*recip_Bo(i,j,bi,bj)
107 c tilePEav(bi,bj) = tilePEav(bi,bj)
108 c & + 0.5 _d 0*Bo_surf(i,j,bi,bj)*tmpVal*tmpVal
109 c & *rA(i,j,bi,bj)*maskH(i,j,bi,bj)
110 ENDDO
111 ENDDO
112 c theMean = theMean + tileMean(bi,bj)
113 c theVol = theVol + tileVol(bi,bj)
114 c theVolMean = theVolMean + tileVlAv(bi,bj)
115 c potEnMean = potEnMean + tilePEav(bi,bj)
116 C- end bi,bj loops
117 ENDDO
118 ENDDO
119 _GLOBAL_SUM_R8(numPnts,myThid)
120 _GLOBAL_MAX_R8(theMax,myThid)
121 c _GLOBAL_SUM_R8(theMean,myThid)
122 c _GLOBAL_SUM_R8(theVol,myThid)
123 c _GLOBAL_SUM_R8(theVolMean,myThid)
124 c _GLOBAL_SUM_R8(potEnMean, myThid)
125 CALL GLOBAL_SUM_TILE_RL( tileMean, theMean , myThid )
126 CALL GLOBAL_SUM_TILE_RL( tileVol , theVol , myThid )
127 CALL GLOBAL_SUM_TILE_RL( tileVlAv, theVolMean, myThid )
128 CALL GLOBAL_SUM_TILE_RL( tilePEav, potEnMean , myThid )
129 IF (numPnts.NE.0.) theMean=theMean/numPnts
130 IF (theVol.NE.0.) THEN
131 theVolMean=theVolMean/theVol
132 potEnMean = potEnMean/theVol
133 ENDIF
134
135 C-- Print stats for (barotropic) Potential Energy:
136 CALL MON_SET_PREF('pe_b',myThid)
137 CALL MON_OUT_RL(mon_string_none,potEnMean,
138 & mon_foot_mean,myThid)
139
140 C-- Print stats for KE
141 CALL MON_SET_PREF('ke',myThid)
142 CALL MON_OUT_RL(mon_string_none,theMax,mon_foot_max,myThid)
143 c CALL MON_OUT_RL(mon_string_none,theMean,mon_foot_mean,myThid)
144 CALL MON_OUT_RL(mon_string_none,theVolMean,
145 & mon_foot_mean,myThid)
146 CALL MON_OUT_RL(mon_string_none,theVol,
147 & mon_foot_vol,myThid)
148
149 RETURN
150 END
151
152 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|

  ViewVC Help
Powered by ViewVC 1.1.22