6 |
CBOP |
CBOP |
7 |
C !ROUTINE: GAD_IMPLICIT_R |
C !ROUTINE: GAD_IMPLICIT_R |
8 |
C !INTERFACE: |
C !INTERFACE: |
9 |
SUBROUTINE GAD_IMPLICIT_R( |
SUBROUTINE GAD_IMPLICIT_R( |
10 |
I implicitAdvection, advectionScheme, tracerIdentity, |
I implicitAdvection, advectionScheme, tracerIdentity, |
11 |
I kappaRX, wVel, tracer, |
I kappaRX, wVel, tracer, |
12 |
U gTracer, |
U gTracer, |
13 |
I bi, bj, myTime, myIter, myThid ) |
I bi, bj, myTime, myIter, myThid ) |
14 |
C !DESCRIPTION: |
C !DESCRIPTION: |
69 |
_RL c5d(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
_RL c5d(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
70 |
_RL d5d(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
_RL d5d(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
71 |
_RL e5d(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
_RL e5d(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
72 |
_RL rTrans(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL wFld (1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
73 |
|
_RL rTrans (1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
74 |
_RL rTransKp1(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL rTransKp1(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
75 |
_RL localTijk(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
_RL localTijk(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
76 |
#ifdef ALLOW_DIAGNOSTICS |
#ifdef ALLOW_DIAGNOSTICS |
105 |
diagonalNumber = 1 |
diagonalNumber = 1 |
106 |
|
|
107 |
C-- Non-Linear Advection scheme: keep a local copy of tracer field |
C-- Non-Linear Advection scheme: keep a local copy of tracer field |
108 |
IF ( advectionScheme.EQ.ENUM_FLUX_LIMIT .OR. |
IF ( advectionScheme.EQ.ENUM_FLUX_LIMIT .OR. |
109 |
& advectionScheme.EQ.ENUM_DST3_FLUX_LIMIT ) THEN |
& advectionScheme.EQ.ENUM_DST3_FLUX_LIMIT ) THEN |
110 |
IF ( multiDimAdvection ) THEN |
IF ( multiDimAdvection ) THEN |
111 |
DO k=1,Nr |
DO k=1,Nr |
183 |
IF (k.EQ.1) THEN |
IF (k.EQ.1) THEN |
184 |
DO j=1-Oly,sNy+Oly |
DO j=1-Oly,sNy+Oly |
185 |
DO i=1-Olx,sNx+Olx |
DO i=1-Olx,sNx+Olx |
186 |
rTrans(i,j) = 0. |
wFld(i,j) = 0. _d 0 |
187 |
|
rTrans(i,j) = 0. _d 0 |
188 |
ENDDO |
ENDDO |
189 |
ENDDO |
ENDDO |
190 |
ELSE |
ELSE |
191 |
DO j=1-Oly,sNy+Oly |
DO j=1-Oly,sNy+Oly |
192 |
DO i=1-Olx,sNx+Olx |
DO i=1-Olx,sNx+Olx |
193 |
rTrans(i,j) = wVel(i,j,k,bi,bj)*rA(i,j,bi,bj) |
wFld(i,j) = wVel(i,j,k,bi,bj) |
194 |
& *maskC(i,j,k-1,bi,bj) |
rTrans(i,j) = wFld(i,j)*rA(i,j,bi,bj)*maskC(i,j,k-1,bi,bj) |
195 |
ENDDO |
ENDDO |
196 |
ENDDO |
ENDDO |
197 |
#ifdef ALLOW_GMREDI |
#ifdef ALLOW_GMREDI |
198 |
C-- Residual transp = Bolus transp + Eulerian transp |
C-- Residual transp = Bolus transp + Eulerian transp |
199 |
IF (useGMRedi) |
IF (useGMRedi) |
200 |
& CALL GMREDI_CALC_WFLOW( |
& CALL GMREDI_CALC_WFLOW( |
201 |
& rTrans, bi, bj, k, myThid) |
U wFld, rTrans, |
202 |
|
I k, bi, bj, myThid ) |
203 |
#endif /* ALLOW_GMREDI */ |
#endif /* ALLOW_GMREDI */ |
204 |
ENDIF |
ENDIF |
205 |
DO j=jMin,jMax |
DO j=jMin,jMax |
206 |
DO i=iMin,iMax |
DO i=iMin,iMax |
207 |
c localTijk(i,j,k) = gTracer(i,j,k,bi,bj) |
c localTijk(i,j,k) = gTracer(i,j,k,bi,bj) |
208 |
gTracer(i,j,k,bi,bj) = gTracer(i,j,k,bi,bj) |
gTracer(i,j,k,bi,bj) = gTracer(i,j,k,bi,bj) |
209 |
& + dTtracerLev(1)*recip_rA(i,j,bi,bj) |
& + dTtracerLev(1)*recip_rA(i,j,bi,bj) |
210 |
& *_recip_hFacC(i,j,k,bi,bj)*recip_drF(k) |
& *_recip_hFacC(i,j,k,bi,bj)*recip_drF(k) |
308 |
ELSE |
ELSE |
309 |
DO j=1,sNy |
DO j=1,sNy |
310 |
DO i=1,sNx |
DO i=1,sNx |
311 |
df(i,j) = |
df(i,j) = |
312 |
& rA(i,j,bi,bj) |
& rA(i,j,bi,bj) |
313 |
& * KappaRX(i,j,k)*recip_drC(k) |
& * KappaRX(i,j,k)*recip_drC(k) |
314 |
& * (gTracer(i,j,k,bi,bj) - gTracer(i,j,k-1,bi,bj)) |
& * (gTracer(i,j,k,bi,bj) - gTracer(i,j,k-1,bi,bj)) |