6 |
SUBROUTINE GAD_DST3FL_ADV_X( |
SUBROUTINE GAD_DST3FL_ADV_X( |
7 |
I bi,bj,k,deltaT, |
I bi,bj,k,deltaT, |
8 |
I uTrans, uVel, |
I uTrans, uVel, |
9 |
I tracer, |
I maskLocW, tracer, |
10 |
O uT, |
O uT, |
11 |
I myThid ) |
I myThid ) |
12 |
C /==========================================================\ |
C /==========================================================\ |
26 |
_RL deltaT |
_RL deltaT |
27 |
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
28 |
_RL uVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL uVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
29 |
|
_RS maskLocW(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
30 |
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
31 |
_RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
32 |
INTEGER myThid |
INTEGER myThid |
33 |
|
|
34 |
C == Local variables == |
C == Local variables == |
35 |
|
C uFld :: velocity [m/s], zonal component |
36 |
INTEGER i,j |
INTEGER i,j |
37 |
_RL Rjm,Rj,Rjp,cfl,d0,d1,psiP,psiM,thetaP,thetaM |
_RL Rjm,Rj,Rjp,cfl,d0,d1,psiP,psiM,thetaP,thetaM |
38 |
|
_RL uFld |
39 |
|
|
40 |
DO j=1-Oly,sNy+Oly |
DO j=1-Oly,sNy+Oly |
41 |
uT(1-Olx,j)=0. |
uT(1-Olx,j)=0.D0 |
42 |
uT(2-Olx,j)=0. |
uT(2-Olx,j)=0.D0 |
43 |
uT(sNx+Olx,j)=0. |
uT(sNx+Olx,j)=0.D0 |
44 |
DO i=1-Olx+2,sNx+Olx-1 |
DO i=1-Olx+2,sNx+Olx-1 |
45 |
Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj) |
Rjp=(tracer(i+1,j)-tracer( i ,j))*maskLocW(i+1,j) |
46 |
Rj =(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj) |
Rj =(tracer( i ,j)-tracer(i-1,j))*maskLocW( i ,j) |
47 |
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))*maskLocW(i-1,j) |
48 |
|
|
49 |
cfl=abs(uVel(i,j,k,bi,bj)*deltaT*recip_dxc(i,j,bi,bj)) |
c uFld = uVel(i,j,k,bi,bj) |
50 |
d0=(2.-cfl)*(1.-cfl)*oneSixth |
uFld = uTrans(i,j)*recip_dyG(i,j,bi,bj) |
51 |
d1=(1.-cfl*cfl)*oneSixth |
& *recip_drF(k)*recip_hFacW(i,j,k,bi,bj) |
52 |
c thetaP=0. |
cfl=abs(uFld*deltaT*recip_dxC(i,j,bi,bj)) |
53 |
c IF (Rj.NE.0.) thetaP=Rjm/Rj |
d0=(2.D0-cfl)*(1.D0-cfl)*oneSixth |
54 |
|
d1=(1.D0-cfl*cfl)*oneSixth |
55 |
|
c thetaP=0.D0 |
56 |
|
c IF (Rj.NE.0.D0) thetaP=Rjm/Rj |
57 |
thetaP=Rjm/(1.D-20+Rj) |
thetaP=Rjm/(1.D-20+Rj) |
58 |
psiP=d0+d1*thetaP |
psiP=d0+d1*thetaP |
59 |
psiP=max(0., min(min(1.,psiP),(1.-cfl)/(1.D-20+cfl)*thetaP)) |
psiP=max(0.D0, min(min(1.D0,psiP), |
60 |
|
& (1.D0-cfl)/(1.D-20+cfl)*thetaP)) |
61 |
thetaM=Rjp/(1.D-20+Rj) |
thetaM=Rjp/(1.D-20+Rj) |
62 |
c thetaM=0. |
c thetaM=0.D0 |
63 |
c IF (Rj.NE.0.) thetaM=Rjp/Rj |
c IF (Rj.NE.0.D0) thetaM=Rjp/Rj |
64 |
psiM=d0+d1*thetaM |
psiM=d0+d1*thetaM |
65 |
psiM=max(0., min(min(1.,psiM),(1.-cfl)/(1.D-20+cfl)*thetaM)) |
psiM=max(0.D0, min(min(1.D0,psiM), |
66 |
|
& (1.D0-cfl)/(1.D-20+cfl)*thetaM)) |
67 |
uT(i,j)= |
uT(i,j)= |
68 |
& 0.5*(uTrans(i,j)+abs(uTrans(i,j))) |
& 0.5*(uTrans(i,j)+abs(uTrans(i,j))) |
69 |
& *( Tracer(i-1,j) + psiP*Rj ) |
& *( Tracer(i-1,j) + psiP*Rj ) |