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

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

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


Revision 1.5 - (hide annotations) (download)
Sat Apr 3 04:57:12 2004 UTC (20 years, 2 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint57t_post, checkpoint57o_post, checkpoint52n_post, checkpoint53d_post, checkpoint54a_pre, checkpoint57m_post, checkpoint55c_post, checkpoint54e_post, checkpoint57s_post, checkpoint54a_post, checkpoint53c_post, checkpoint57k_post, checkpoint55d_pre, checkpoint57d_post, checkpoint57g_post, checkpoint57b_post, checkpoint57c_pre, checkpoint55j_post, checkpoint56b_post, checkpoint57i_post, checkpoint57e_post, checkpoint55h_post, checkpoint53b_post, checkpoint57g_pre, checkpoint54b_post, checkpoint53b_pre, checkpoint55b_post, checkpoint54d_post, checkpoint56c_post, checkpoint52m_post, checkpoint55, checkpoint53a_post, checkpoint57f_pre, checkpoint57a_post, checkpoint54, checkpoint54f_post, checkpoint57v_post, checkpoint55g_post, checkpoint55f_post, checkpoint57r_post, checkpoint57a_pre, checkpoint55i_post, checkpoint57, checkpoint56, checkpoint53, eckpoint57e_pre, checkpoint57h_done, checkpoint53g_post, checkpoint57n_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint57f_post, checkpoint57q_post, checkpoint57c_post, checkpoint55e_post, checkpoint53f_post, checkpoint55a_post, checkpoint53d_pre, checkpoint54c_post, checkpoint57j_post, checkpoint57h_pre, checkpoint57l_post, checkpoint57h_post, checkpoint56a_post, checkpoint55d_post
Changes since 1.4: +27 -24 lines
 o add monitor to apr_reference
 o another _R[48] clean-up in eesupp

1 edhill 1.5 C $Header: /u/gcmpack/MITgcm/pkg/monitor/mon_stats_latbnd_rl.F,v 1.4 2004/03/05 02:28:11 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "MONITOR_OPTIONS.h"
5    
6 edhill 1.5 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7     CBOP
8     C !ROUTINE: MON_STATS_LATBND_RL
9    
10     C !INTERFACE:
11 jmc 1.1 SUBROUTINE MON_STATS_LATBND_RL(
12 edhill 1.5 I myNr, mskNr, kLoc, nSepBnd, ySepBnd,
13     I arr, arrMask, arrhFac, arrArea, arrY, arrDr,
14     O theMin,theMax,theMean,theVar,theVol,
15     I myThid )
16    
17     C !DESCRIPTION:
18     C Calculate bare statistics of global array "\_RL arr" on each
19     C Latitude band (given by \texttt{ySepBnd}).
20    
21     C !USES:
22 jmc 1.1 IMPLICIT NONE
23     #include "SIZE.h"
24     #include "EEPARAMS.h"
25 edhill 1.5 INTEGER NLATBND
26     EXTERNAL NLATBND
27 jmc 1.1
28 edhill 1.5 C !INPUT PARAMETERS:
29 jmc 1.1 C nSepBnd :: Number of latitude bands
30 jmc 1.3 C ySepBnd :: Southern latitude egde (from 2 to nSepBnd, 1 is not used)
31 jmc 1.2 INTEGER myNr, mskNr, kLoc
32 jmc 1.1 INTEGER nSepBnd
33     _RS ySepBnd(nSepBnd)
34     _RL arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNr,nSx,nSy)
35 jmc 1.2 _RS arrMask(1-OLx:sNx+OLx,1-OLy:sNy+OLy,mskNr,nSx,nSy)
36     _RS arrhFac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,mskNr,nSx,nSy)
37 jmc 1.1 _RS arrArea(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
38     _RS arrY(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
39     _RS arrDr(myNr)
40     _RL theMin(nSepBnd)
41     _RL theMax(nSepBnd)
42     _RL theMean(nSepBnd)
43     _RL theVar(nSepBnd)
44     _RL theVol(nSepBnd)
45     INTEGER myThid
46 edhill 1.5 CEOP
47 jmc 1.1
48 edhill 1.5 C !LOCAL VARIABLES:
49 jmc 1.1 INTEGER bi,bj,i,j,k,n
50 jmc 1.2 INTEGER km, k1, k2
51 jmc 1.1 INTEGER numPnts
52     LOGICAL noPnts(Ny)
53     _RL tmpVal,rNumPnts
54     _RL tmpVol
55    
56 jmc 1.2 C- set k index range [k1,k2]
57     IF ( kLoc.EQ.0 ) THEN
58     k1 = 1
59     k2 = myNr
60     ELSE
61     k1 = kLoc
62     k2 = kLoc
63     ENDIF
64    
65 jmc 1.1 DO n=1,nSepBnd
66     noPnts(n)=.TRUE.
67     theMin(n)=0.
68     theMax(n)=0.
69     theMean(n)=0.
70     theVar(n)=0.
71     theVol(n)=0.
72     ENDDO
73    
74     DO bj=myByLo(myThid),myByHi(myThid)
75     DO bi=myBxLo(myThid),myBxHi(myThid)
76 jmc 1.2 DO k=k1,k2
77     km = MIN(k,mskNr)
78 jmc 1.1 DO j=1,sNy
79     DO i=1,sNx
80     n = NLATBND(nSepBnd, ySepBnd, arrY(i,j,bi,bj) )
81     tmpVal=arr(i,j,k,bi,bj)
82 jmc 1.2 IF (arrMask(i,j,km,bi,bj).NE.0. .AND. noPnts(n)) THEN
83 jmc 1.1 theMin(n)=tmpVal
84     theMax(n)=tmpVal
85     noPnts(n)=.FALSE.
86     ENDIF
87 jmc 1.2 IF (arrMask(i,j,km,bi,bj).NE.0.) THEN
88 jmc 1.3 theMin(n)=MIN(theMin(n),tmpVal)
89     theMax(n)=MAX(theMax(n),tmpVal)
90 jmc 1.2 tmpVol = arrArea(i,j,bi,bj)*arrhFac(i,j,km,bi,bj)*arrDr(k)
91     & *arrMask(i,j,km,bi,bj)
92 jmc 1.1 theVol(n) = theVol(n) + tmpVol
93 jmc 1.2 theMean(n)= theMean(n)+ tmpVol*tmpVal
94 jmc 1.1 theVar(n) = theVar(n) + tmpVol*tmpVal*tmpVal
95     ENDIF
96     ENDDO
97     ENDDO
98     ENDDO
99     ENDDO
100     ENDDO
101    
102     DO n=1,nSepBnd
103     _GLOBAL_SUM_R8(theVol(n), myThid)
104     _GLOBAL_SUM_R8(theMean(n),myThid)
105     _GLOBAL_SUM_R8(theVar(n), myThid)
106     ENDDO
107    
108     DO n=1,nSepBnd
109     IF (theVol(n).GT.0.) THEN
110     theMean(n)= theMean(n)/theVol(n)
111     theVar(n) = theVar(n) /theVol(n)
112 jmc 1.4 theVar(n) = theVar(n) -theMean(n)*theMean(n)
113     IF ( noPnts(n) ) theMin(n) = theMean(n)
114     theMin(n) = -theMin(n)
115     _GLOBAL_MAX_R8(theMin(n), myThid)
116     theMin(n)=-theMin(n)
117     IF ( noPnts(n) ) theMax(n) = theMin(n)
118     _GLOBAL_MAX_R8(theMax(n), myThid)
119 jmc 1.1 ENDIF
120     ENDDO
121    
122     RETURN
123     END
124    
125 edhill 1.5 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
126 jmc 1.1 CBOP
127     C !ROUTINE: NLATBND
128    
129     C !INTERFACE:
130     INTEGER FUNCTION NLATBND( nBnd, yBnd, yLoc )
131     IMPLICIT NONE
132    
133     C !DESCRIPTION:
134 edhill 1.5 C Find the latidude band of yLoc in nSep strip
135    
136 jmc 1.1 C !INPUT PARAMETERS:
137 jmc 1.3 C nBnd :: Number of latitude bands
138     C yBnd :: latitude of southern boundary (for each lat. band)
139 jmc 1.1 C yLoc :: current latitude
140     INTEGER nBnd
141     _RS yBnd(nBnd)
142     _RS yLoc
143 edhill 1.5 CEOP
144 jmc 1.1
145     C !LOCAL VARIABLES:
146     INTEGER n
147    
148 jmc 1.3 NLATBND = 1
149     DO n=2,nBnd
150     IF (yLoc .GT. yBnd(n)) NLATBND = n
151 jmc 1.1 ENDDO
152    
153     RETURN
154     END
155 edhill 1.5
156     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|

  ViewVC Help
Powered by ViewVC 1.1.22