1 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/generic_advdiff/gad_dst3fl_adv_y.F,v 1.1 2001/09/04 14:53:11 adcroft Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "GAD_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE GAD_DST3FL_ADV_Y( |
7 |
I bi,bj,k,deltaT, |
8 |
I vTrans, vVel, |
9 |
I tracer, |
10 |
O vT, |
11 |
I myThid ) |
12 |
C /==========================================================\ |
13 |
C | SUBROUTINE GAD_DST3FL_ADV_Y | |
14 |
C | o Compute Meridional advective Flux of Tracer using | |
15 |
C | 3rd Order DST Sceheme with flux limiting | |
16 |
C |==========================================================| |
17 |
IMPLICIT NONE |
18 |
|
19 |
C == GLobal variables == |
20 |
#include "SIZE.h" |
21 |
#include "GRID.h" |
22 |
#include "GAD.h" |
23 |
|
24 |
C == Routine arguments == |
25 |
INTEGER bi,bj,k |
26 |
_RL deltaT |
27 |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
28 |
_RL vVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
29 |
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
30 |
_RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
31 |
INTEGER myThid |
32 |
|
33 |
C == Local variables == |
34 |
INTEGER i,j |
35 |
_RL Rjm,Rj,Rjp,cfl,d0,d1,psiP,thetaP,psiM,thetaM |
36 |
|
37 |
DO i=1-Olx,sNx+Olx |
38 |
vT(i,1-Olx)=0. |
39 |
vT(i,2-Olx)=0. |
40 |
vT(i,sNx+Olx)=0. |
41 |
ENDDO |
42 |
DO j=1-Oly+2,sNy+Oly-1 |
43 |
DO i=1-Olx,sNx+Olx |
44 |
Rjp=(tracer(i,j+1)-tracer(i,j))*maskS(i,j+1,k,bi,bj) |
45 |
Rj =(tracer(i,j)-tracer(i,j-1))*maskS(i,j,k,bi,bj) |
46 |
Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskS(i,j-1,k,bi,bj) |
47 |
|
48 |
cfl=vVel(i,j,k,bi,bj)*deltaT*recip_dyc(i,j,bi,bj) |
49 |
d0=(2.-abs(cfl))*(1.-abs(cfl))*oneSixth |
50 |
d1=(1.-cfl)*(1.+cfl)*oneSixth |
51 |
thetaP=Rjm/(1.D-30+Rj) |
52 |
psiP=d0+d1*thetaP |
53 |
psiP=max(0., min(min(1.,psiP),(1.-cfl)/cfl*thetaP) ) |
54 |
thetaM=Rjp/(-1.D-30+Rj) |
55 |
psiM=d0+d1*thetaM |
56 |
psiM=max(0., min(min(1.,psiM),(1.-cfl)/cfl*thetaM) ) |
57 |
vT(i,j)= |
58 |
& 0.5*(vTrans(i,j)+abs(vTrans(i,j))) |
59 |
& *( Tracer(i,j-1) + psiP*Rj ) |
60 |
& +0.5*(vTrans(i,j)-abs(vTrans(i,j))) |
61 |
& *( Tracer(i, j ) - psiM*Rj ) |
62 |
cph *note* put these comments after end of continued line |
63 |
cph to ensure TAMC compatibility |
64 |
c & 0.5*(vTrans(i,j)+abs(vTrans(i,j))) |
65 |
c & *( Tracer(i,j-1) + d0*Rj + d1*Rjm ) |
66 |
c & +0.5*(vTrans(i,j)-abs(vTrans(i,j))) |
67 |
c & *( Tracer(i, j ) - d0*Rj + d1*Rjp ) |
68 |
|
69 |
ENDDO |
70 |
ENDDO |
71 |
|
72 |
RETURN |
73 |
END |