/[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.7 - (hide annotations) (download)
Mon Jun 25 20:35:23 2001 UTC (22 years, 11 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint40pre3, checkpoint40pre1, checkpoint40pre7, checkpoint40pre6, checkpoint40pre9, checkpoint40pre8, release1_b1, checkpoint43, checkpoint40pre2, checkpoint40pre4, checkpoint40pre5, ecco-branch-mod1, release1_beta1, checkpoint42, checkpoint40, checkpoint41
Branch point for: release1, ecco-branch, release1_coupled
Changes since 1.6: +3 -3 lines
Fixes for multi-threaded code: someone (who shall remain unnamed) broke
"monitor" by removing the _MASTER_THID() stuff around the I/O. I've
put it back in the appropriate place. In the meantime, I hope Chris
(oops) feels ashamed for not adhering to his own rules about passing
myThid around...   A.

1 adcroft 1.7 C $Header: /u/gcmpack/models/MITgcmUV/pkg/monitor/mon_ke.F,v 1.6 2001/06/19 14:37:29 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 adcroft 1.1
21     C === Routine arguments ===
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 adcroft 1.6 IF (tmpVal.NE.0.) theMean=theMean/tmpVal
57 adcroft 1.1
58 adcroft 1.7 CALL MON_OUT_RL( mon_string_none, theMax, mon_foot_max ,myThid)
59     CALL MON_OUT_RL( mon_string_none, theMean, mon_foot_mean ,myThid)
60 adcroft 1.1
61     RETURN
62     END

  ViewVC Help
Powered by ViewVC 1.1.22