32 |
C I,J,K |
C I,J,K |
33 |
INTEGER bi, bj |
INTEGER bi, bj |
34 |
INTEGER I, J, K |
INTEGER I, J, K |
35 |
|
#ifdef ALLOW_NONHYDROSTATIC |
36 |
|
INTEGER Km1 |
37 |
|
_RL hFacUpper,hFacLower |
38 |
|
#endif |
39 |
|
|
40 |
C Calculate quantities derived from XY depth map |
C Calculate quantities derived from XY depth map |
41 |
DO bj = myByLo(myThid), myByHi(myThid) |
DO bj = myByLo(myThid), myByHi(myThid) |
78 |
ELSE |
ELSE |
79 |
C Base of domain is in this cell |
C Base of domain is in this cell |
80 |
C Set hFac to the fraction of the cell that is open. |
C Set hFac to the fraction of the cell that is open. |
81 |
hFacC(I,J,K,bi,bj) = (rF(K)*rkFac-H(I,J,bi,bj)*rkFac)*recip_drF(K) |
hFacC(I,J,K,bi,bj) = |
82 |
|
& (rF(K)*rkFac-H(I,J,bi,bj)*rkFac)*recip_drF(K) |
83 |
ENDIF |
ENDIF |
84 |
C Impose minimum fraction |
C Impose minimum fraction |
85 |
IF (hFacC(I,J,K,bi,bj).LT.hFacMin) THEN |
IF (hFacC(I,J,K,bi,bj).LT.hFacMin) THEN |
190 |
_EXCH_XY_R4(recip_dxV, myThid ) |
_EXCH_XY_R4(recip_dxV, myThid ) |
191 |
_EXCH_XY_R4(recip_dyU, myThid ) |
_EXCH_XY_R4(recip_dyU, myThid ) |
192 |
|
|
193 |
|
#ifdef ALLOW_NONHYDROSTATIC |
194 |
|
C-- Calculate the reciprocal hfac distance/volume for W cells |
195 |
|
DO bj = myByLo(myThid), myByHi(myThid) |
196 |
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
197 |
|
DO K=1,Nr |
198 |
|
Km1=max(K-1,1) |
199 |
|
hFacUpper=drF(Km1)/(drF(Km1)+drF(K)) |
200 |
|
IF (Km1.EQ.K) hFacUpper=0. |
201 |
|
hFacLower=drF(K)/(drF(Km1)+drF(K)) |
202 |
|
DO J=1,sNy |
203 |
|
DO I=1,sNx |
204 |
|
IF (hFacC(I,J,K,bi,bj).NE.0.) THEN |
205 |
|
IF (hFacC(I,J,K,bi,bj).LE.0.5) THEN |
206 |
|
recip_hFacU(I,J,K,bi,bj)= |
207 |
|
& hFacUpper+hFacLower*hFacC(I,J,K,bi,bj) |
208 |
|
ELSE |
209 |
|
recip_hFacU(I,J,K,bi,bj)=1. |
210 |
|
ENDIF |
211 |
|
ELSE |
212 |
|
recip_hFacU(I,J,K,bi,bj)=0. |
213 |
|
ENDIF |
214 |
|
IF (recip_hFacU(I,J,K,bi,bj).NE.0.) |
215 |
|
& recip_hFacU(I,J,K,bi,bj)=1./recip_hFacU(I,J,K,bi,bj) |
216 |
|
ENDDO |
217 |
|
ENDDO |
218 |
|
ENDDO |
219 |
|
ENDDO |
220 |
|
ENDDO |
221 |
|
_EXCH_XY_R4(recip_hFacU, myThid ) |
222 |
|
#endif |
223 |
C |
C |
224 |
RETURN |
RETURN |
225 |
END |
END |