1 |
jmc |
1.8 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/monitor/mon_ke.F,v 1.7 2001/06/25 20:35:23 adcroft 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.8 |
_RL tmpVal,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.8 |
theVol=theVol+ra(i,j,bi,bj)*drf(k)*hFacC(i,j,k,bi,bj) |
42 |
adcroft |
1.1 |
tmpVal=0.25*( uVel( I , J ,K,bi,bj)*uVel( I , J ,K,bi,bj) |
43 |
|
|
& +uVel(I+1, J ,K,bi,bj)*uVel(I+1, J ,K,bi,bj) |
44 |
|
|
& +vVel( I , J ,K,bi,bj)*vVel( I , J ,K,bi,bj) |
45 |
|
|
& +vVel( I ,J+1,K,bi,bj)*vVel( I ,J+1,K,bi,bj) ) |
46 |
|
|
theMax=max(theMax,tmpVal) |
47 |
|
|
IF (tmpVal.NE.0.) THEN |
48 |
|
|
theMean=theMean+tmpVal |
49 |
|
|
numPnts=numPnts+1 |
50 |
|
|
ENDIF |
51 |
jmc |
1.8 |
theVolMean=theVolMean+tmpVal |
52 |
|
|
& *ra(i,j,bi,bj)*drf(k)*hFacC(i,j,k,bi,bj) |
53 |
adcroft |
1.1 |
ENDDO |
54 |
|
|
ENDDO |
55 |
|
|
ENDDO |
56 |
|
|
ENDDO |
57 |
|
|
ENDDO |
58 |
|
|
_GLOBAL_MAX_R8(theMax,myThid) |
59 |
|
|
_GLOBAL_SUM_R8(theMean,myThid) |
60 |
|
|
tmpVal=float(numPnts) |
61 |
|
|
_GLOBAL_SUM_R8(tmpVal,myThid) |
62 |
adcroft |
1.6 |
IF (tmpVal.NE.0.) theMean=theMean/tmpVal |
63 |
jmc |
1.8 |
_GLOBAL_SUM_R8(theVol,myThid) |
64 |
|
|
_GLOBAL_SUM_R8(theVolMean,myThid) |
65 |
adcroft |
1.1 |
|
66 |
jmc |
1.8 |
CALL MON_OUT_RL(mon_string_none,theMax,mon_foot_max,myThid) |
67 |
|
|
CALL MON_OUT_RL(mon_string_none,theMean,mon_foot_mean,myThid) |
68 |
|
|
CALL MON_OUT_RL(mon_string_none,theVolMean, |
69 |
|
|
& mon_foot_volint,myThid) |
70 |
|
|
IF (theVol.NE.0.) theVolMean=theVolMean/theVol |
71 |
|
|
CALL MON_OUT_RL(mon_string_none,theVolMean, |
72 |
|
|
& mon_foot_volmean,myThid) |
73 |
adcroft |
1.1 |
|
74 |
|
|
RETURN |
75 |
|
|
END |