31 |
INTEGER myThid |
INTEGER myThid |
32 |
|
|
33 |
C == Local variables == |
C == Local variables == |
34 |
|
C uFld :: velocity [m/s], zonal component |
35 |
INTEGER i,j |
INTEGER i,j |
36 |
_RL Rjm,Rj,Rjp,cfl,d0,d1,psiP,psiM,thetaP,thetaM |
_RL Rjm,Rj,Rjp,cfl,d0,d1,psiP,psiM,thetaP,thetaM |
37 |
|
_RL uFld |
38 |
|
|
39 |
DO j=1-Oly,sNy+Oly |
DO j=1-Oly,sNy+Oly |
40 |
uT(1-Olx,j)=0. |
uT(1-Olx,j)=0.D0 |
41 |
uT(2-Olx,j)=0. |
uT(2-Olx,j)=0.D0 |
42 |
uT(sNx+Olx,j)=0. |
uT(sNx+Olx,j)=0.D0 |
43 |
DO i=1-Olx+2,sNx+Olx-1 |
DO i=1-Olx+2,sNx+Olx-1 |
44 |
Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj) |
Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj) |
45 |
Rj =(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj) |
Rj =(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj) |
46 |
Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskW(i-1,j,k,bi,bj) |
Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskW(i-1,j,k,bi,bj) |
47 |
|
|
48 |
cfl=abs(uVel(i,j,k,bi,bj)*deltaT*recip_dxc(i,j,bi,bj)) |
c uFld = uVel(i,j,k,bi,bj) |
49 |
d0=(2.-cfl)*(1.-cfl)*oneSixth |
uFld = uTrans(i,j)*recip_dyG(i,j,bi,bj) |
50 |
d1=(1.-cfl*cfl)*oneSixth |
& *recip_drF(k)*recip_hFacW(i,j,k,bi,bj) |
51 |
c thetaP=0. |
cfl=abs(uFld*deltaT*recip_dxC(i,j,bi,bj)) |
52 |
c IF (Rj.NE.0.) thetaP=Rjm/Rj |
d0=(2.D0-cfl)*(1.D0-cfl)*oneSixth |
53 |
|
d1=(1.D0-cfl*cfl)*oneSixth |
54 |
|
c thetaP=0.D0 |
55 |
|
c IF (Rj.NE.0.D0) thetaP=Rjm/Rj |
56 |
thetaP=Rjm/(1.D-20+Rj) |
thetaP=Rjm/(1.D-20+Rj) |
57 |
psiP=d0+d1*thetaP |
psiP=d0+d1*thetaP |
58 |
psiP=max(0., min(min(1.,psiP),(1.-cfl)/(1.D-20+cfl)*thetaP)) |
psiP=max(0.D0, min(min(1.D0,psiP), |
59 |
|
& (1.D0-cfl)/(1.D-20+cfl)*thetaP)) |
60 |
thetaM=Rjp/(1.D-20+Rj) |
thetaM=Rjp/(1.D-20+Rj) |
61 |
c thetaM=0. |
c thetaM=0.D0 |
62 |
c IF (Rj.NE.0.) thetaM=Rjp/Rj |
c IF (Rj.NE.0.D0) thetaM=Rjp/Rj |
63 |
psiM=d0+d1*thetaM |
psiM=d0+d1*thetaM |
64 |
psiM=max(0., min(min(1.,psiM),(1.-cfl)/(1.D-20+cfl)*thetaM)) |
psiM=max(0.D0, min(min(1.D0,psiM), |
65 |
|
& (1.D0-cfl)/(1.D-20+cfl)*thetaM)) |
66 |
uT(i,j)= |
uT(i,j)= |
67 |
& 0.5*(uTrans(i,j)+abs(uTrans(i,j))) |
& 0.5*(uTrans(i,j)+abs(uTrans(i,j))) |
68 |
& *( Tracer(i-1,j) + psiP*Rj ) |
& *( Tracer(i-1,j) + psiP*Rj ) |