/[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.6 - (show annotations) (download)
Fri Sep 24 16:53:45 2004 UTC (19 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57m_post, checkpoint57g_pre, checkpoint57b_post, checkpoint57g_post, checkpoint56b_post, checkpoint57d_post, checkpoint57i_post, checkpoint57, checkpoint56, checkpoint57n_post, checkpoint55i_post, checkpoint57l_post, checkpoint57f_post, checkpoint57a_post, checkpoint57h_pre, checkpoint57h_post, checkpoint55g_post, checkpoint57c_post, checkpoint55d_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, checkpoint55h_post, checkpoint57e_post, checkpoint55f_post, checkpoint57p_post, eckpoint57e_pre, checkpoint56a_post, checkpoint57h_done, checkpoint57j_post, checkpoint57f_pre, checkpoint56c_post, checkpoint57a_pre, checkpoint57o_post, checkpoint57k_post, checkpoint55e_post
Changes since 1.5: +6 -5 lines
use a local copy of maskW & maskS (new arguments of advection S/R) for
 the purpose of doing multidimAdvection on CS-grid.

1 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_dst3fl_adv_x.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_X(
7 I bi,bj,k,deltaT,
8 I uTrans, uVel,
9 I maskLocW, 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 _RS maskLocW(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
30 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
31 _RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
32 INTEGER myThid
33
34 C == Local variables ==
35 C uFld :: velocity [m/s], zonal component
36 INTEGER i,j
37 _RL Rjm,Rj,Rjp,cfl,d0,d1,psiP,psiM,thetaP,thetaM
38 _RL uFld
39
40 DO j=1-Oly,sNy+Oly
41 uT(1-Olx,j)=0.D0
42 uT(2-Olx,j)=0.D0
43 uT(sNx+Olx,j)=0.D0
44 DO i=1-Olx+2,sNx+Olx-1
45 Rjp=(tracer(i+1,j)-tracer( i ,j))*maskLocW(i+1,j)
46 Rj =(tracer( i ,j)-tracer(i-1,j))*maskLocW( i ,j)
47 Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskLocW(i-1,j)
48
49 c uFld = uVel(i,j,k,bi,bj)
50 uFld = uTrans(i,j)*recip_dyG(i,j,bi,bj)
51 & *recip_drF(k)*recip_hFacW(i,j,k,bi,bj)
52 cfl=abs(uFld*deltaT*recip_dxC(i,j,bi,bj))
53 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)
58 psiP=d0+d1*thetaP
59 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)
62 c thetaM=0.D0
63 c IF (Rj.NE.0.D0) thetaM=Rjp/Rj
64 psiM=d0+d1*thetaM
65 psiM=max(0.D0, min(min(1.D0,psiM),
66 & (1.D0-cfl)/(1.D-20+cfl)*thetaM))
67 uT(i,j)=
68 & 0.5*(uTrans(i,j)+abs(uTrans(i,j)))
69 & *( Tracer(i-1,j) + psiP*Rj )
70 & +0.5*(uTrans(i,j)-abs(uTrans(i,j)))
71 & *( Tracer( i ,j) - psiM*Rj )
72
73 ENDDO
74 ENDDO
75
76 RETURN
77 END

  ViewVC Help
Powered by ViewVC 1.1.22