1 |
C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_dst3fl_adv_y.F,v 1.5 2002/03/06 01:29:36 jmc 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 maskLocS, 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 |
_RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
30 |
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
31 |
_RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
32 |
INTEGER myThid |
33 |
|
34 |
C == Local variables == |
35 |
C vFld :: velocity [m/s], meridional component |
36 |
INTEGER i,j |
37 |
_RL Rjm,Rj,Rjp,cfl,d0,d1,psiP,psiM,thetaP,thetaM |
38 |
_RL vFld |
39 |
|
40 |
DO i=1-Olx,sNx+Olx |
41 |
vT(i,1-Oly)=0.D0 |
42 |
vT(i,2-Oly)=0.D0 |
43 |
vT(i,sNy+Oly)=0.D0 |
44 |
ENDDO |
45 |
DO j=1-Oly+2,sNy+Oly-1 |
46 |
DO i=1-Olx,sNx+Olx |
47 |
Rjp=(tracer(i,j+1)-tracer(i, j ))*maskLocS(i,j+1) |
48 |
Rj =(tracer(i, j )-tracer(i,j-1))*maskLocS(i, j ) |
49 |
Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskLocS(i,j-1) |
50 |
|
51 |
c vFld = vVel(i,j,k,bi,bj) |
52 |
vFld = vTrans(i,j)*recip_dxG(i,j,bi,bj) |
53 |
& *recip_drF(k)*recip_hFacS(i,j,k,bi,bj) |
54 |
cfl=abs(vFld*deltaT*recip_dyC(i,j,bi,bj)) |
55 |
d0=(2.D0-cfl)*(1.D0-cfl)*oneSixth |
56 |
d1=(1.D0-cfl*cfl)*oneSixth |
57 |
c thetaP=0.D0 |
58 |
c IF (Rj.NE.0.D0) thetaP=Rjm/Rj |
59 |
thetaP=Rjm/(1.D-20+Rj) |
60 |
psiP=d0+d1*thetaP |
61 |
psiP=max(0.D0, min(min(1.D0,psiP), |
62 |
& (1.D0-cfl)/(1.D-20+cfl)*thetaP)) |
63 |
thetaM=Rjp/(1.D-20+Rj) |
64 |
c thetaM=0.D0 |
65 |
c IF (Rj.NE.0.D0) thetaM=Rjp/Rj |
66 |
psiM=d0+d1*thetaM |
67 |
psiM=max(0.D0, min(min(1.D0,psiM), |
68 |
& (1.D0-cfl)/(1.D-20+cfl)*thetaM)) |
69 |
vT(i,j)= |
70 |
& 0.5*(vTrans(i,j)+abs(vTrans(i,j))) |
71 |
& *( Tracer(i,j-1) + psiP*Rj ) |
72 |
& +0.5*(vTrans(i,j)-abs(vTrans(i,j))) |
73 |
& *( Tracer(i, j ) - psiM*Rj ) |
74 |
|
75 |
ENDDO |
76 |
ENDDO |
77 |
|
78 |
RETURN |
79 |
END |