46 |
CEOP |
CEOP |
47 |
|
|
48 |
C !LOCAL VARIABLES: |
C !LOCAL VARIABLES: |
49 |
|
C msgBuf :: Informational/error meesage buffer |
50 |
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
51 |
INTEGER bi,bj,i,j,k,n |
INTEGER bi,bj,i,j,k,n |
52 |
INTEGER km, k1, k2 |
INTEGER km, k1, k2 |
|
INTEGER numPnts |
|
53 |
LOGICAL noPnts(Ny) |
LOGICAL noPnts(Ny) |
54 |
_RL tmpVal,rNumPnts |
_RL tmpVal |
55 |
_RL tmpVol |
_RL tmpVol |
56 |
|
INTEGER nSepDim |
57 |
|
PARAMETER ( nSepDim = 200 ) |
58 |
|
_RL tileVol (nSx,nSy,nSepDim) |
59 |
|
_RL tileMean(nSx,nSy,nSepDim) |
60 |
|
_RL tileVar (nSx,nSy,nSepDim) |
61 |
|
|
62 |
|
C- Check local Dim |
63 |
|
IF ( nSepBnd .GT. nSepDim ) THEN |
64 |
|
WRITE(msgBuf,'(A,I6,A)') |
65 |
|
& 'MON_STATS_LATBND_RL: local array Dim (nSepDim=',nSepDim, |
66 |
|
& ' ) too small' |
67 |
|
CALL PRINT_ERROR( msgBuf , myThid) |
68 |
|
WRITE(msgBuf,'(A,I6)') |
69 |
|
& 'MON_STATS_LATBND_RL: Need nSepDim to be at least =', nSepBnd |
70 |
|
CALL PRINT_ERROR( msgBuf , myThid) |
71 |
|
STOP 'ABNORMAL END: S/R MON_STATS_LATBND_RL' |
72 |
|
ENDIF |
73 |
|
|
|
C- set k index range [k1,k2] |
|
74 |
IF ( kLoc.EQ.0 ) THEN |
IF ( kLoc.EQ.0 ) THEN |
75 |
k1 = 1 |
k1 = 1 |
76 |
k2 = myNr |
k2 = myNr |
90 |
|
|
91 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
92 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
93 |
|
DO n=1,nSepBnd |
94 |
|
tileVol (bi,bj,n) = 0. |
95 |
|
tileMean(bi,bj,n) = 0. |
96 |
|
tileVar (bi,bj,n) = 0. |
97 |
|
ENDDO |
98 |
DO k=k1,k2 |
DO k=k1,k2 |
99 |
km = MIN(k,mskNr) |
km = MIN(k,mskNr) |
100 |
DO j=1,sNy |
DO j=1,sNy |
111 |
theMax(n)=MAX(theMax(n),tmpVal) |
theMax(n)=MAX(theMax(n),tmpVal) |
112 |
tmpVol = arrArea(i,j,bi,bj)*arrhFac(i,j,km,bi,bj)*arrDr(k) |
tmpVol = arrArea(i,j,bi,bj)*arrhFac(i,j,km,bi,bj)*arrDr(k) |
113 |
& *arrMask(i,j,km,bi,bj) |
& *arrMask(i,j,km,bi,bj) |
114 |
theVol(n) = theVol(n) + tmpVol |
tileVol (bi,bj,n) = tileVol (bi,bj,n) + tmpVol |
115 |
theMean(n)= theMean(n)+ tmpVol*tmpVal |
tileMean(bi,bj,n) = tileMean(bi,bj,n) + tmpVol*tmpVal |
116 |
theVar(n) = theVar(n) + tmpVol*tmpVal*tmpVal |
tileVar (bi,bj,n) = tileVar (bi,bj,n) + tmpVol*tmpVal*tmpVal |
117 |
ENDIF |
ENDIF |
118 |
ENDDO |
ENDDO |
119 |
ENDDO |
ENDDO |
122 |
ENDDO |
ENDDO |
123 |
|
|
124 |
DO n=1,nSepBnd |
DO n=1,nSepBnd |
125 |
_GLOBAL_SUM_R8(theVol(n), myThid) |
CALL GLOBAL_SUM_TILE_RL( tileVol(1,1,n) , theVol(n) , myThid ) |
126 |
_GLOBAL_SUM_R8(theMean(n),myThid) |
CALL GLOBAL_SUM_TILE_RL( tileMean(1,1,n), theMean(n), myThid ) |
127 |
_GLOBAL_SUM_R8(theVar(n), myThid) |
CALL GLOBAL_SUM_TILE_RL( tileVar(1,1,n) , theVar(n) , myThid ) |
128 |
ENDDO |
ENDDO |
129 |
|
|
130 |
DO n=1,nSepBnd |
DO n=1,nSepBnd |
134 |
theVar(n) = theVar(n) -theMean(n)*theMean(n) |
theVar(n) = theVar(n) -theMean(n)*theMean(n) |
135 |
IF ( noPnts(n) ) theMin(n) = theMean(n) |
IF ( noPnts(n) ) theMin(n) = theMean(n) |
136 |
theMin(n) = -theMin(n) |
theMin(n) = -theMin(n) |
137 |
_GLOBAL_MAX_R8(theMin(n), myThid) |
_GLOBAL_MAX_RL(theMin(n), myThid) |
138 |
theMin(n)=-theMin(n) |
theMin(n)=-theMin(n) |
139 |
IF ( noPnts(n) ) theMax(n) = theMin(n) |
IF ( noPnts(n) ) theMax(n) = theMin(n) |
140 |
_GLOBAL_MAX_R8(theMax(n), myThid) |
_GLOBAL_MAX_RL(theMax(n), myThid) |
141 |
ENDIF |
ENDIF |
142 |
ENDDO |
ENDDO |
143 |
|
|
144 |
RETURN |
RETURN |
145 |
END |
END |
146 |
|
|
147 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
148 |
CBOP |
CBOP |
149 |
C !ROUTINE: NLATBND |
C !ROUTINE: NLATBND |
160 |
C yBnd :: latitude of southern boundary (for each lat. band) |
C yBnd :: latitude of southern boundary (for each lat. band) |
161 |
C yLoc :: current latitude |
C yLoc :: current latitude |
162 |
INTEGER nBnd |
INTEGER nBnd |
163 |
_RS yBnd(nBnd) |
_RS yBnd(nBnd) |
164 |
_RS yLoc |
_RS yLoc |
165 |
CEOP |
CEOP |
166 |
|
|