/[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.11 - (show annotations) (download)
Tue May 13 18:18:05 2003 UTC (21 years ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint52d_pre, checkpoint52j_pre, checkpoint51o_pre, checkpoint51l_post, checkpoint52l_post, checkpoint52k_post, checkpoint51, checkpoint52, checkpoint52f_post, checkpoint51f_post, checkpoint51d_post, checkpoint51t_post, checkpoint51n_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint51j_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint52b_pre, checkpoint51l_pre, checkpoint51q_post, checkpoint51b_pre, checkpoint52b_post, checkpoint52c_post, checkpoint51h_pre, checkpoint50f_post, checkpoint50f_pre, checkpoint52f_pre, branchpoint-genmake2, checkpoint51r_post, checkpoint51i_post, checkpoint51b_post, checkpoint51c_post, checkpoint52d_post, checkpoint50g_post, checkpoint52a_pre, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint52h_pre, checkpoint52j_post, checkpoint50e_post, branch-netcdf, checkpoint51e_post, checkpoint51o_post, checkpoint51f_pre, checkpoint52a_post, checkpoint51g_post, ecco_c52_e35, checkpoint51m_post, checkpoint51a_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.10: +2 -2 lines
 o split mon_set.F into mon_set_iounit.F and mon_set_pref.F
 o replaced ref's to CPP_OPTIONS with MONITOR_OPTIONS
 o added new s/r monitor_solution.F that checks that model state
   and if unlikely lets the model die cleanly
   - this is to reduce the number of hanging processes we encounter
     if the model dies due to FPEs

1 C $Header: /u/gcmpack/models/MITgcmUV/pkg/monitor/mon_ke.F,v 1.10 2003/05/02 22:29:07 jmc Exp $
2 C $Name: $
3
4 #include "MONITOR_OPTIONS.h"
5
6 SUBROUTINE MON_KE(
7 I myIter, myThid )
8 C /==========================================================\
9 C | SUBROUTINE MON_KE |
10 C | o Calculates stats for Kinetic energy |
11 C |==========================================================|
12 C \==========================================================/
13 IMPLICIT NONE
14
15 C === Global data ===
16 #include "SIZE.h"
17 #include "EEPARAMS.h"
18 #include "DYNVARS.h"
19 #include "MONITOR.h"
20 #include "GRID.h"
21 #include "SURFACE.h"
22
23 C === Routine arguments ===
24 INTEGER myIter, myThid
25
26 C === Local variables ====
27 INTEGER bi,bj,I,J,K
28 _RL numPnts,theVol,tmpVal,tmpVol
29 _RL theMax,theMean,theVolMean,potEnMean
30
31 numPnts=0.
32 theVol=0.
33 theMax=0.
34 theMean=0.
35 theVolMean=0.
36 potEnMean =0.
37
38 DO bj=myByLo(myThid),myByHi(myThid)
39 DO bi=myBxLo(myThid),myBxHi(myThid)
40 DO K=1,Nr
41 DO J=1,sNy
42 DO I=1,sNx
43 theVol=theVol+rA(i,j,bi,bj)*drF(k)*hFacC(i,j,k,bi,bj)
44
45 C- Vector Invariant form (like in pkg/mom_vecinv/mom_vi_calc_ke.F)
46 c tmpVal=0.25*( uVel( I , J ,K,bi,bj)*uVel( I , J ,K,bi,bj)
47 c & +uVel(I+1, J ,K,bi,bj)*uVel(I+1, J ,K,bi,bj)
48 c & +vVel( I , J ,K,bi,bj)*vVel( I , J ,K,bi,bj)
49 c & +vVel( I ,J+1,K,bi,bj)*vVel( I ,J+1,K,bi,bj) )
50 c theVolMean=theVolMean+tmpVal
51 c & *ra(i,j,bi,bj)*drf(k)*hFacC(i,j,k,bi,bj)
52
53 C- Energy conservative form (like in pkg/mom_fluxform/mom_calc_ke.F)
54 C this is the safe way to check the energy conservation
55 C with no assumption on how grid spacing & area are defined.
56 tmpVal=0.25*(
57 & uVel( i ,j,k,bi,bj)*uVel( i ,j,k,bi,bj)
58 & *dyG( i ,j,bi,bj)*dxC( i ,j,bi,bj)*hFacW( i ,j,k,bi,bj)
59 & +uVel(i+1,j,k,bi,bj)*uVel(i+1,j,k,bi,bj)
60 & *dyG(i+1,j,bi,bj)*dxC(i+1,j,bi,bj)*hFacW(i+1,j,k,bi,bj)
61 & +vVel(i, j ,k,bi,bj)*vVel(i, j ,k,bi,bj)
62 & *dxG(i, j ,bi,bj)*dyC(i, j ,bi,bj)*hFacS(i, j ,k,bi,bj)
63 & +vVel(i,j+1,k,bi,bj)*vVel(i,j+1,k,bi,bj)
64 & *dxG(i,j+1,bi,bj)*dyC(i,j+1,bi,bj)*hFacS(i,j+1,k,bi,bj)
65 & )
66 theVolMean= theVolMean + tmpVal*drF(k)
67 tmpVal= tmpVal*recip_hFacC(i,j,k,bi,bj)*recip_rA(i,j,bi,bj)
68
69 theMax=max(theMax,tmpVal)
70 IF (tmpVal.NE.0.) THEN
71 theMean=theMean+tmpVal
72 numPnts=numPnts+1.
73 ENDIF
74
75 ENDDO
76 ENDDO
77 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
98 ENDDO
99 _GLOBAL_SUM_R8(numPnts,myThid)
100 _GLOBAL_MAX_R8(theMax,myThid)
101 _GLOBAL_SUM_R8(theMean,myThid)
102 IF (numPnts.NE.0.) theMean=theMean/numPnts
103 _GLOBAL_SUM_R8(theVol,myThid)
104 _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)
119 c CALL MON_OUT_RL(mon_string_none,theMean,mon_foot_mean,myThid)
120 CALL MON_OUT_RL(mon_string_none,theVolMean,
121 & mon_foot_mean,myThid)
122 CALL MON_OUT_RL(mon_string_none,theVol,
123 & mon_foot_vol,myThid)
124
125 RETURN
126 END

  ViewVC Help
Powered by ViewVC 1.1.22