/[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.1 - (hide annotations) (download)
Mon Jun 4 13:25:35 2001 UTC (23 years ago) by adcroft
Branch: MAIN
Added Kinetic energy monitoring.

1 adcroft 1.1 C $Header: /u/gcmpack/models/MITgcmUV/pkg/monitor/mon_advcfl.F,v 1.1 2001/05/30 19:33:18 adcroft Exp $
2     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    
20     C === Routine arguments ===
21     CHARACTER*(*) label
22     INTEGER myThid
23    
24     C === Local variables ====
25     INTEGER bi,bj,I,J,K
26     _RL tmpVal,theMax,theMean
27     INTEGER numPnts
28    
29     theMax=0.
30     theMean=0.
31     numPnts=0
32    
33     DO bj=myByLo(myThid),myByHi(myThid)
34     DO bi=myBxLo(myThid),myBxHi(myThid)
35     DO K=1,Nr
36     DO J=1,sNy
37     DO I=1,sNx
38     tmpVal=0.25*( uVel( I , J ,K,bi,bj)*uVel( I , J ,K,bi,bj)
39     & +uVel(I+1, J ,K,bi,bj)*uVel(I+1, J ,K,bi,bj)
40     & +vVel( I , J ,K,bi,bj)*vVel( I , J ,K,bi,bj)
41     & +vVel( I ,J+1,K,bi,bj)*vVel( I ,J+1,K,bi,bj) )
42     theMax=max(theMax,tmpVal)
43     IF (tmpVal.NE.0.) THEN
44     theMean=theMean+tmpVal
45     numPnts=numPnts+1
46     ENDIF
47     ENDDO
48     ENDDO
49     ENDDO
50     ENDDO
51     ENDDO
52     _GLOBAL_MAX_R8(theMax,myThid)
53     _GLOBAL_SUM_R8(theMean,myThid)
54     tmpVal=float(numPnts)
55     _GLOBAL_SUM_R8(tmpVal,myThid)
56     theMean=theMean/tmpVal
57    
58     _BEGIN_MASTER( myThid )
59     WRITE(*,'(A,24x,A,1PE22.14)')
60     & 'MON_KE: ',' max=',theMax
61     WRITE(*,'(A,24x,A,1PE22.14)')
62     & 'MON_KE: ',' mean=',theMean
63     _END_MASTER( )
64    
65     RETURN
66     END

  ViewVC Help
Powered by ViewVC 1.1.22