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

Annotation of /MITgcm/pkg/generic_advdiff/gad_dst3_adv_x.F

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


Revision 1.4 - (hide annotations) (download)
Fri Sep 24 16:53:45 2004 UTC (19 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57b_post, checkpoint56b_post, checkpoint57d_post, checkpoint57, checkpoint56, checkpoint55i_post, checkpoint57a_post, checkpoint55g_post, checkpoint57c_post, checkpoint55d_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, checkpoint55h_post, checkpoint57e_post, checkpoint55f_post, eckpoint57e_pre, checkpoint56a_post, checkpoint56c_post, checkpoint57a_pre, checkpoint55e_post
Changes since 1.3: +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 jmc 1.4 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_dst3_adv_x.F,v 1.3 2002/03/06 01:29:36 jmc Exp $
2 adcroft 1.2 C $Name: $
3 adcroft 1.1
4     #include "GAD_OPTIONS.h"
5    
6     SUBROUTINE GAD_DST3_ADV_X(
7     I bi,bj,k,deltaT,
8     I uTrans, uVel,
9 jmc 1.4 I maskLocW, tracer,
10 adcroft 1.1 O uT,
11     I myThid )
12     C /==========================================================\
13     C | SUBROUTINE GAD_DST3_ADV_X |
14     C | o Compute Zonal advective Flux of Tracer using |
15     C | 3rd Order DST Sceheme |
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 jmc 1.4 _RS maskLocW(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
30 adcroft 1.1 _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 jmc 1.3 C uFld :: velocity [m/s], zonal component
36 adcroft 1.1 INTEGER i,j
37     _RL Rjm,Rj,Rjp,cfl,d0,d1
38 adcroft 1.2 _RL psiP,psiM,thetaP,thetaM
39 jmc 1.3 _RL uFld
40 adcroft 1.1
41     DO j=1-Oly,sNy+Oly
42     uT(1-Olx,j)=0.
43     uT(2-Olx,j)=0.
44     uT(sNx+Olx,j)=0.
45     DO i=1-Olx+2,sNx+Olx-1
46 jmc 1.4 Rjp=(tracer(i+1,j)-tracer( i ,j))*maskLocW(i+1,j)
47     Rj =(tracer( i ,j)-tracer(i-1,j))*maskLocW( i ,j)
48     Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskLocW(i-1,j)
49 adcroft 1.1
50 jmc 1.3 c uFld = uVel(i,j,k,bi,bj)
51     uFld = uTrans(i,j)*recip_dyG(i,j,bi,bj)
52     & *recip_drF(k)*recip_hFacW(i,j,k,bi,bj)
53     cfl=abs(uFld*deltaT*recip_dxC(i,j,bi,bj))
54 adcroft 1.2 d0=(2.-cfl)*(1.-cfl)*oneSixth
55     d1=(1.-cfl*cfl)*oneSixth
56     c thetaP=0.
57     c IF (Rj.NE.0.) thetaP=Rjm/Rj
58     thetaP=Rjm/(1.D-20+Rj)
59     psiP=d0+d1*thetaP
60     c psiP=max(0.,min(min(1.,psiP),(1.-cfl)/(1.D-20+cfl)*thetaP))
61     thetaM=Rjp/(1.D-20+Rj)
62     c thetaM=0.
63     c IF (Rj.NE.0.) thetaM=Rjp/Rj
64     psiM=d0+d1*thetaM
65     c psiM=max(0.,min(min(1.,psiM),(1.-cfl)/(1.D-20+cfl)*thetaM))
66 adcroft 1.1 uT(i,j)=
67     & 0.5*(uTrans(i,j)+abs(uTrans(i,j)))
68 adcroft 1.2 & *( Tracer(i-1,j) + psiP*Rj )
69 adcroft 1.1 & +0.5*(uTrans(i,j)-abs(uTrans(i,j)))
70 adcroft 1.2 & *( Tracer( i ,j) - psiM*Rj )
71 adcroft 1.1
72     ENDDO
73     ENDDO
74    
75     RETURN
76     END

  ViewVC Help
Powered by ViewVC 1.1.22