4 |
#include "GAD_OPTIONS.h" |
#include "GAD_OPTIONS.h" |
5 |
|
|
6 |
SUBROUTINE GAD_DST3_ADV_Y( |
SUBROUTINE GAD_DST3_ADV_Y( |
7 |
I bi,bj,k,deltaT, |
I bi,bj,k,deltaTloc, |
8 |
I vTrans, vVel, |
I vTrans, vVel, |
9 |
I maskLocS, tracer, |
I maskLocS, tracer, |
10 |
O vT, |
O vT, |
19 |
C == GLobal variables == |
C == GLobal variables == |
20 |
#include "SIZE.h" |
#include "SIZE.h" |
21 |
#include "GRID.h" |
#include "GRID.h" |
22 |
|
#include "EEPARAMS.h" |
23 |
|
#include "PARAMS.h" |
24 |
#include "GAD.h" |
#include "GAD.h" |
25 |
|
|
26 |
C == Routine arguments == |
C == Routine arguments == |
27 |
INTEGER bi,bj,k |
INTEGER bi,bj,k |
28 |
_RL deltaT |
_RL deltaTloc |
29 |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
30 |
_RL vVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL vVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
31 |
_RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
39 |
_RL Rjm,Rj,Rjp,cfl,d0,d1 |
_RL Rjm,Rj,Rjp,cfl,d0,d1 |
40 |
_RL psiP,psiM,thetaP,thetaM |
_RL psiP,psiM,thetaP,thetaM |
41 |
_RL vFld |
_RL vFld |
42 |
|
_RL smallNo |
43 |
|
_RL Rjjm,Rjjp |
44 |
|
|
45 |
|
IF (inAdMode) THEN |
46 |
|
smallNo = 1.0D-20 |
47 |
|
ELSE |
48 |
|
smallNo = 1.0D-20 |
49 |
|
ENDIF |
50 |
|
|
51 |
DO i=1-Olx,sNx+Olx |
DO i=1-Olx,sNx+Olx |
52 |
vT(i,1-Oly)=0. |
vT(i,1-Oly)=0. |
62 |
c vFld = vVel(i,j,k,bi,bj) |
c vFld = vVel(i,j,k,bi,bj) |
63 |
vFld = vTrans(i,j)*recip_dxG(i,j,bi,bj) |
vFld = vTrans(i,j)*recip_dxG(i,j,bi,bj) |
64 |
& *recip_drF(k)*recip_hFacS(i,j,k,bi,bj) |
& *recip_drF(k)*recip_hFacS(i,j,k,bi,bj) |
65 |
cfl=abs(vFld*deltaT*recip_dyC(i,j,bi,bj)) |
cfl=abs(vFld*deltaTloc*recip_dyC(i,j,bi,bj)) |
66 |
d0=(2.-cfl)*(1.-cfl)*oneSixth |
d0=(2.-cfl)*(1.-cfl)*oneSixth |
67 |
d1=(1.-cfl*cfl)*oneSixth |
d1=(1.-cfl*cfl)*oneSixth |
68 |
c thetaP=0. |
IF ( ABS(Rj).LT.smallNo .OR. |
69 |
c IF (Rj.NE.0.) thetaP=Rjm/Rj |
& ABS(Rjm).LT.smallNo ) THEN |
70 |
thetaP=Rjm/(1.D-20+Rj) |
thetaP=0. |
71 |
psiP=d0+d1*thetaP |
psiP=0. |
72 |
c psiP=max(0.,min(min(1.,psiP),(1.-cfl)/(1.D-20+cfl)*thetaP)) |
ELSE |
73 |
thetaM=Rjp/(1.D-20+Rj) |
thetaP=(Rjm+smallNo)/(smallNo+Rj) |
74 |
c thetaM=0. |
psiP=d0+d1*thetaP |
75 |
c IF (Rj.NE.0.) thetaM=Rjp/Rj |
ENDIF |
76 |
psiM=d0+d1*thetaM |
IF ( ABS(Rj).LT.smallNo .OR. |
77 |
c psiM=max(0.,min(min(1.,psiM),(1.-cfl)/(1.D-20+cfl)*thetaM)) |
& ABS(Rjp).LT.smallNo ) THEN |
78 |
|
thetaM=0. |
79 |
|
psiM=0. |
80 |
|
ELSE |
81 |
|
thetaM=(Rjp+smallNo)/(smallNo+Rj) |
82 |
|
psiM=d0+d1*thetaM |
83 |
|
ENDIF |
84 |
vT(i,j)= |
vT(i,j)= |
85 |
& 0.5*(vTrans(i,j)+abs(vTrans(i,j))) |
& 0.5*(vTrans(i,j)+abs(vTrans(i,j))) |
86 |
& *( Tracer(i,j-1) + psiP*Rj ) |
& *( Tracer(i,j-1) + psiP*Rj ) |