/[MITgcm]/MITgcm/pkg/generic_advdiff/gad_dst3fl_adv_x.F
ViewVC logotype

Contents of /MITgcm/pkg/generic_advdiff/gad_dst3fl_adv_x.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Tue Sep 4 14:53:11 2001 UTC (22 years, 8 months ago) by adcroft
Branch: MAIN
Added two more methods *BUT* only in (x,y)!
 o DST-3 is 3rd order direct space time method
 o DST-3FL is flux limited 3rd order direct space time method
 o r-direction to come. Place holders commented out in gad_calc_rhs.F
   A stop statement will catch it if you try to use it. Either use with Nr=1
   or write the code. :)

1 C $Header: $
2 C $Name: $
3
4 #include "GAD_OPTIONS.h"
5
6 SUBROUTINE GAD_DST3FL_ADV_X(
7 I bi,bj,k,deltaT,
8 I uTrans, uVel,
9 I tracer,
10 O uT,
11 I myThid )
12 C /==========================================================\
13 C | SUBROUTINE GAD_DST3FL_ADV_X |
14 C | o Compute Zonal 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 uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
28 _RL uVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
29 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
30 _RL uT (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 j=1-Oly,sNy+Oly
38 uT(1-Olx,j)=0.
39 uT(2-Olx,j)=0.
40 uT(sNx+Olx,j)=0.
41 DO i=1-Olx+2,sNx+Olx-1
42 Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj)
43 Rj =(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj)
44 Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskW(i-1,j,k,bi,bj)
45
46 cfl=uVel(i,j,k,bi,bj)*deltaT*recip_dxc(i,j,bi,bj)
47 d0=(2.-abs(cfl))*(1.-abs(cfl))*oneSixth
48 d1=(1.-cfl)*(1.+cfl)*oneSixth
49 thetaP=Rjm/(1.D-30+Rj)
50 psiP=d0+d1*thetaP
51 psiP=max(0., min(min(1.,psiP),(1.-cfl)/cfl*thetaP) )
52 thetaM=Rjp/(-1.D-30+Rj)
53 psiM=d0+d1*thetaM
54 psiM=max(0., min(min(1.,psiM),(1.-cfl)/cfl*thetaM) )
55 uT(i,j)=
56 c & 0.5*(uTrans(i,j)+abs(uTrans(i,j)))
57 c & *( Tracer(i-1,j) + d0*Rj + d1*Rjm )
58 c & +0.5*(uTrans(i,j)-abs(uTrans(i,j)))
59 c & *( Tracer( i ,j) - d0*Rj + d1*Rjp )
60 & 0.5*(uTrans(i,j)+abs(uTrans(i,j)))
61 & *( Tracer(i-1,j) + psiP*Rj )
62 & +0.5*(uTrans(i,j)-abs(uTrans(i,j)))
63 & *( Tracer( i ,j) - psiM*Rj )
64
65 ENDDO
66 ENDDO
67
68 RETURN
69 END

  ViewVC Help
Powered by ViewVC 1.1.22