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

Contents 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 - (show 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 C $Header: /u/gcmpack/MITgcm/pkg/monitor/mon_stats_latbnd_rl.F,v 1.4 2004/03/05 02:28:11 jmc Exp $
2 C $Name: $
3
4 #include "MONITOR_OPTIONS.h"
5
6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 CBOP
8 C !ROUTINE: MON_STATS_LATBND_RL
9
10 C !INTERFACE:
11 SUBROUTINE MON_STATS_LATBND_RL(
12 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 IMPLICIT NONE
23 #include "SIZE.h"
24 #include "EEPARAMS.h"
25 INTEGER NLATBND
26 EXTERNAL NLATBND
27
28 C !INPUT PARAMETERS:
29 C nSepBnd :: Number of latitude bands
30 C ySepBnd :: Southern latitude egde (from 2 to nSepBnd, 1 is not used)
31 INTEGER myNr, mskNr, kLoc
32 INTEGER nSepBnd
33 _RS ySepBnd(nSepBnd)
34 _RL arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNr,nSx,nSy)
35 _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 _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 CEOP
47
48 C !LOCAL VARIABLES:
49 INTEGER bi,bj,i,j,k,n
50 INTEGER km, k1, k2
51 INTEGER numPnts
52 LOGICAL noPnts(Ny)
53 _RL tmpVal,rNumPnts
54 _RL tmpVol
55
56 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 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 DO k=k1,k2
77 km = MIN(k,mskNr)
78 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 IF (arrMask(i,j,km,bi,bj).NE.0. .AND. noPnts(n)) THEN
83 theMin(n)=tmpVal
84 theMax(n)=tmpVal
85 noPnts(n)=.FALSE.
86 ENDIF
87 IF (arrMask(i,j,km,bi,bj).NE.0.) THEN
88 theMin(n)=MIN(theMin(n),tmpVal)
89 theMax(n)=MAX(theMax(n),tmpVal)
90 tmpVol = arrArea(i,j,bi,bj)*arrhFac(i,j,km,bi,bj)*arrDr(k)
91 & *arrMask(i,j,km,bi,bj)
92 theVol(n) = theVol(n) + tmpVol
93 theMean(n)= theMean(n)+ tmpVol*tmpVal
94 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 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 ENDIF
120 ENDDO
121
122 RETURN
123 END
124
125 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
126 CBOP
127 C !ROUTINE: NLATBND
128
129 C !INTERFACE:
130 INTEGER FUNCTION NLATBND( nBnd, yBnd, yLoc )
131 IMPLICIT NONE
132
133 C !DESCRIPTION:
134 C Find the latidude band of yLoc in nSep strip
135
136 C !INPUT PARAMETERS:
137 C nBnd :: Number of latitude bands
138 C yBnd :: latitude of southern boundary (for each lat. band)
139 C yLoc :: current latitude
140 INTEGER nBnd
141 _RS yBnd(nBnd)
142 _RS yLoc
143 CEOP
144
145 C !LOCAL VARIABLES:
146 INTEGER n
147
148 NLATBND = 1
149 DO n=2,nBnd
150 IF (yLoc .GT. yBnd(n)) NLATBND = n
151 ENDDO
152
153 RETURN
154 END
155
156 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|

  ViewVC Help
Powered by ViewVC 1.1.22