38 |
_RL Rjm,Rj,Rjp,cfl,d0,d1 |
_RL Rjm,Rj,Rjp,cfl,d0,d1 |
39 |
_RL psiP,psiM,thetaP,thetaM |
_RL psiP,psiM,thetaP,thetaM |
40 |
_RL wFld |
_RL wFld |
41 |
|
_RL smallNo |
42 |
|
_RL Rjjm,Rjjp |
43 |
|
|
44 |
IF (.NOT. multiDimAdvection) THEN |
IF (.NOT. multiDimAdvection) THEN |
45 |
C If using the standard time-stepping/advection schemes (ie. AB-II) |
C If using the standard time-stepping/advection schemes (ie. AB-II) |
54 |
bj=1 |
bj=1 |
55 |
ENDIF |
ENDIF |
56 |
|
|
57 |
|
IF (inAdMode) THEN |
58 |
|
smallNo = 1.0D-20 |
59 |
|
ELSE |
60 |
|
smallNo = 1.0D-20 |
61 |
|
ENDIF |
62 |
|
|
63 |
km2=MAX(1,k-2) |
km2=MAX(1,k-2) |
64 |
km1=MAX(1,k-1) |
km1=MAX(1,k-1) |
65 |
kp1=MIN(Nr,k+1) |
kp1=MIN(Nr,k+1) |
78 |
cfl=abs(wFld*dTarg*recip_drC(k)) |
cfl=abs(wFld*dTarg*recip_drC(k)) |
79 |
d0=(2.-cfl)*(1.-cfl)*oneSixth |
d0=(2.-cfl)*(1.-cfl)*oneSixth |
80 |
d1=(1.-cfl*cfl)*oneSixth |
d1=(1.-cfl*cfl)*oneSixth |
81 |
c thetaP=0. |
IF ( ABS(Rj).LT.smallNo .OR. |
82 |
c IF (Rj.NE.0.) thetaP=Rjm/Rj |
& ABS(Rjm).LT.smallNo ) THEN |
83 |
thetaP=Rjm/(1.D-20+Rj) |
thetaP=0. |
84 |
psiP=d0+d1*thetaP |
psiP=0. |
85 |
c psiP=max(0.,min(min(1.,psiP),(1.-cfl)/(1.D-20+cfl)*thetaP)) |
ELSE |
86 |
thetaM=Rjp/(1.D-20+Rj) |
thetaP=(Rjm+smallNo)/(smallNo+Rj) |
87 |
c thetaM=0. |
psiP=d0+d1*thetaP |
88 |
c IF (Rj.NE.0.) thetaM=Rjp/Rj |
ENDIF |
89 |
psiM=d0+d1*thetaM |
IF ( ABS(Rj).LT.smallNo .OR. |
90 |
c psiM=max(0.,min(min(1.,psiM),(1.-cfl)/(1.D-20+cfl)*thetaM)) |
& ABS(Rjp).LT.smallNo ) THEN |
91 |
wT(i,j)= |
thetaM=0. |
92 |
& 0.5*(rTrans(i,j)+abs(rTrans(i,j))) |
psiM=0. |
93 |
& *( Tracer(i,j, k ,bi,bj) + psiM*Rj ) |
ELSE |
94 |
& +0.5*(rTrans(i,j)-abs(rTrans(i,j))) |
thetaM=(Rjp+smallNo)/(smallNo+Rj) |
95 |
& *( Tracer(i,j,km1,bi,bj) - psiP*Rj ) |
psiM=d0+d1*thetaM |
96 |
|
ENDIF |
97 |
|
wT(i,j)= |
98 |
|
& 0.5*(rTrans(i,j)+abs(rTrans(i,j))) |
99 |
|
& *( Tracer(i,j, k ,bi,bj) + psiM*Rj ) |
100 |
|
& +0.5*(rTrans(i,j)-abs(rTrans(i,j))) |
101 |
|
& *( Tracer(i,j,km1,bi,bj) - psiP*Rj ) |
102 |
ENDDO |
ENDDO |
103 |
ENDDO |
ENDDO |
104 |
|
|