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: \bv |
C !DESCRIPTION: |
15 |
C *==========================================================* |
C Solve implicitly vertical advection and diffusion for one tracer. |
|
C | S/R GAD_IMPLICIT_R |
|
|
C | o Solve implicitly vertical advection & diffusion |
|
|
C | for one tracer |
|
|
C *==========================================================* |
|
|
C *==========================================================* |
|
|
C \ev |
|
16 |
|
|
17 |
C !USES: |
C !USES: |
18 |
IMPLICIT NONE |
IMPLICIT NONE |
23 |
#include "GRID.h" |
#include "GRID.h" |
24 |
#include "GAD.h" |
#include "GAD.h" |
25 |
|
|
26 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
27 |
C == Routine Arguments == |
C == Routine Arguments == |
28 |
|
C implicitAdvection :: if True, treat vertical advection implicitly |
29 |
|
C advectionScheme :: advection scheme to use |
30 |
|
C tracerIdentity :: Identifier for the tracer |
31 |
|
C kappaRX :: 3-D array for vertical diffusion coefficient |
32 |
|
C wVel :: vertical component of the velcity field |
33 |
|
C tracer :: tracer field at current time step |
34 |
|
C gTracer :: future tracer field |
35 |
|
C bi,bj :: tile indices |
36 |
|
C myTime :: current time |
37 |
|
C myIter :: current iteration number |
38 |
|
C myThid :: thread number |
39 |
LOGICAL implicitAdvection |
LOGICAL implicitAdvection |
40 |
INTEGER advectionScheme |
INTEGER advectionScheme |
41 |
INTEGER tracerIdentity |
INTEGER tracerIdentity |
47 |
_RL myTime |
_RL myTime |
48 |
INTEGER myIter, myThid |
INTEGER myIter, myThid |
49 |
|
|
50 |
C !LOCAL VARIABLES: |
C !LOCAL VARIABLES: |
51 |
C == Local variables == |
C == Local variables == |
52 |
|
C iMin,iMax,jMin,jMax :: computational domain |
53 |
|
C i,j,k :: loop indices |
54 |
|
C a5d :: 2nd lower diagonal of the pentadiagonal matrix |
55 |
|
C b5d :: 1rst lower diagonal of the pentadiagonal matrix |
56 |
|
C c5d :: main diagonal of the pentadiagonal matrix |
57 |
|
C d5d :: 1rst upper diagonal of the pentadiagonal matrix |
58 |
|
C e5d :: 2nd upper diagonal of the pentadiagonal matrix |
59 |
|
C rTrans :: vertical volume transport at inteface k |
60 |
|
C rTransKp1 :: vertical volume transport at inteface k+1 |
61 |
|
C localTijk :: local copy of tracer (for Non-Lin Adv.Scheme) |
62 |
|
C diagonalNumber :: number of non-zero diagonals in the matrix |
63 |
|
C errCode :: > 0 if singular matrix |
64 |
INTEGER iMin,iMax,jMin,jMax |
INTEGER iMin,iMax,jMin,jMax |
65 |
INTEGER i,j,k |
INTEGER i,j,k |
66 |
INTEGER diagonalNumber, errCode |
INTEGER diagonalNumber, errCode |
72 |
_RL rTrans(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL rTrans(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
73 |
_RL rTransKp1(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL rTransKp1(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
74 |
_RL localTijk(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
_RL localTijk(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
|
_RL limitDf (1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
|
|
_RL rFlx |
|
75 |
CEOP |
CEOP |
76 |
|
|
77 |
IF (Nr.LE.1) RETURN |
IF (Nr.LE.1) RETURN |
202 |
ENDDO |
ENDDO |
203 |
ENDDO |
ENDDO |
204 |
|
|
205 |
IF (K.GE.2) THEN |
#ifdef ALLOW_AIM |
206 |
|
C- a hack to prevent Water-Vapor vert.transport into the stratospheric level Nr |
207 |
|
IF ( K.GE.2 .AND. |
208 |
|
& (.NOT.useAIM .OR.tracerIdentity.NE.GAD_SALINITY .OR.K.LT.Nr) |
209 |
|
& ) THEN |
210 |
|
#else |
211 |
|
IF ( K.GE.2 ) THEN |
212 |
|
#endif |
213 |
|
|
214 |
IF ( advectionScheme.EQ.ENUM_CENTERED_2ND ) THEN |
IF ( advectionScheme.EQ.ENUM_CENTERED_2ND ) THEN |
215 |
diagonalNumber = 3 |
diagonalNumber = 3 |