/[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.3 - (show annotations) (download)
Mon Jun 4 14:25:53 2001 UTC (22 years, 11 months ago) by adcroft
Branch: MAIN
Changes since 1.2: +2 -2 lines
Divide by zero. DECs ar eso wonderful.

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

  ViewVC Help
Powered by ViewVC 1.1.22