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

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

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


Revision 1.9 - (hide annotations) (download)
Sat Jun 15 03:14:53 2002 UTC (21 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint47e_post, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, checkpoint46f_post, checkpoint48e_post, checkpoint50c_pre, checkpoint46b_post, checkpoint48i_post, checkpoint46l_pre, checkpoint50, checkpoint50b_pre, checkpoint48b_post, checkpoint48c_pre, checkpoint47d_pre, checkpoint47a_post, checkpoint48d_pre, checkpoint47i_post, checkpoint47d_post, checkpoint46d_pre, checkpoint48d_post, checkpoint48f_post, checkpoint45d_post, checkpoint46j_pre, checkpoint48h_post, checkpoint46a_post, checkpoint47g_post, checkpoint46j_post, checkpoint46k_post, checkpoint48a_post, checkpoint50a_post, checkpoint47j_post, branch-exfmods-tag, checkpoint46e_pre, checkpoint48c_post, checkpoint46b_pre, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint46h_pre, checkpoint46m_post, checkpoint46a_pre, checkpoint46g_post, checkpoint47f_post, checkpoint46i_post, checkpoint46c_post, checkpoint46e_post, checkpoint47, checkpoint48, checkpoint49, checkpoint46h_post, checkpoint48g_post, checkpoint47h_post, checkpoint46d_post, checkpoint50b_post
Branch point for: branch-exfmods-curt
Changes since 1.8: +31 -9 lines
* monitor output : add ocean volume output and change definition of KE
  => allow to check conservation of Energy with and without NLFS

1 jmc 1.9 C $Header: /u/gcmpack/MITgcm/pkg/monitor/mon_ke.F,v 1.8 2001/11/08 16:47:34 jmc Exp $
2 adcroft 1.1 C $Name: $
3    
4     #include "CPP_OPTIONS.h"
5    
6     SUBROUTINE MON_KE(
7     I 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 cnh 1.5 #include "MONITOR.h"
20 jmc 1.8 #include "GRID.h"
21 adcroft 1.1
22     C === Routine arguments ===
23     INTEGER myThid
24    
25     C === Local variables ====
26     INTEGER bi,bj,I,J,K
27 jmc 1.9 _RL tmpVal,tmpVol,theMax,theMean,theVolMean,theVol
28 adcroft 1.1 INTEGER numPnts
29    
30     theMax=0.
31 jmc 1.8 numPnts=0
32 adcroft 1.1 theMean=0.
33 jmc 1.8 theVolMean=0.
34     theVol=0.
35 adcroft 1.1
36     DO bj=myByLo(myThid),myByHi(myThid)
37     DO bi=myBxLo(myThid),myBxHi(myThid)
38     DO K=1,Nr
39     DO J=1,sNy
40     DO I=1,sNx
41 jmc 1.9 theVol=theVol+rA(i,j,bi,bj)*drF(k)*hFacC(i,j,k,bi,bj)
42    
43     C- Vector Invariant form (like in pkg/mom_vecinv/mom_vi_calc_ke.F)
44     c tmpVal=0.25*( uVel( I , J ,K,bi,bj)*uVel( I , J ,K,bi,bj)
45     c & +uVel(I+1, J ,K,bi,bj)*uVel(I+1, J ,K,bi,bj)
46     c & +vVel( I , J ,K,bi,bj)*vVel( I , J ,K,bi,bj)
47     c & +vVel( I ,J+1,K,bi,bj)*vVel( I ,J+1,K,bi,bj) )
48     c theVolMean=theVolMean+tmpVal
49     c & *ra(i,j,bi,bj)*drf(k)*hFacC(i,j,k,bi,bj)
50    
51     C- Energy conservative form (like in pkg/mom_fluxform/mom_calc_ke.F)
52     C this is the safe way to check the energy conservation
53     C with no assumption on how grid spacing & area are defined.
54     tmpVal=0.25*(
55     & uVel( i ,j,k,bi,bj)*uVel( i ,j,k,bi,bj)
56     & *dyG( i ,j,bi,bj)*dxC( i ,j,bi,bj)*hFacW( i ,j,k,bi,bj)
57     & +uVel(i+1,j,k,bi,bj)*uVel(i+1,j,k,bi,bj)
58     & *dyG(i+1,j,bi,bj)*dxC(i+1,j,bi,bj)*hFacW(i+1,j,k,bi,bj)
59     & +vVel(i, j ,k,bi,bj)*vVel(i, j ,k,bi,bj)
60     & *dxG(i, j ,bi,bj)*dyC(i, j ,bi,bj)*hFacS(i, j ,k,bi,bj)
61     & +vVel(i,j+1,k,bi,bj)*vVel(i,j+1,k,bi,bj)
62     & *dxG(i,j+1,bi,bj)*dyC(i,j+1,bi,bj)*hFacS(i,j+1,k,bi,bj)
63     & )
64     theVolMean= theVolMean + tmpVal*drF(k)
65     tmpVal= tmpVal*recip_hFacC(i,j,k,bi,bj)*recip_rA(i,j,bi,bj)
66    
67 adcroft 1.1 theMax=max(theMax,tmpVal)
68     IF (tmpVal.NE.0.) THEN
69     theMean=theMean+tmpVal
70     numPnts=numPnts+1
71     ENDIF
72 jmc 1.9
73 adcroft 1.1 ENDDO
74     ENDDO
75     ENDDO
76     ENDDO
77     ENDDO
78     _GLOBAL_MAX_R8(theMax,myThid)
79     _GLOBAL_SUM_R8(theMean,myThid)
80     tmpVal=float(numPnts)
81     _GLOBAL_SUM_R8(tmpVal,myThid)
82 adcroft 1.6 IF (tmpVal.NE.0.) theMean=theMean/tmpVal
83 jmc 1.8 _GLOBAL_SUM_R8(theVol,myThid)
84     _GLOBAL_SUM_R8(theVolMean,myThid)
85 adcroft 1.1
86 jmc 1.8 CALL MON_OUT_RL(mon_string_none,theMax,mon_foot_max,myThid)
87     CALL MON_OUT_RL(mon_string_none,theMean,mon_foot_mean,myThid)
88     CALL MON_OUT_RL(mon_string_none,theVolMean,
89     & mon_foot_volint,myThid)
90     IF (theVol.NE.0.) theVolMean=theVolMean/theVol
91     CALL MON_OUT_RL(mon_string_none,theVolMean,
92     & mon_foot_volmean,myThid)
93 jmc 1.9 CALL MON_OUT_RL(mon_string_none,theVol,
94     & mon_foot_vol,myThid)
95 adcroft 1.1
96     RETURN
97     END

  ViewVC Help
Powered by ViewVC 1.1.22