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

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

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


Revision 1.9 - (hide annotations) (download)
Mon Jun 19 14:40:43 2006 UTC (17 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58m_post, checkpoint58o_post, checkpoint58p_post, checkpoint58q_post, checkpoint58n_post, checkpoint58k_post, checkpoint58l_post
Changes since 1.8: +3 -3 lines
DST advection S/R : use local copy of velocity to compute CFL

1 jmc 1.8 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_dst3_adv_y.F,v 1.7 2006/06/07 01:55:14 heimbach Exp $
2 jmc 1.3 C $Name: $
3 adcroft 1.1
4     #include "GAD_OPTIONS.h"
5    
6 jmc 1.8 SUBROUTINE GAD_DST3_ADV_Y(
7 heimbach 1.5 I bi,bj,k,deltaTloc,
8 jmc 1.8 I vTrans, vFld,
9 jmc 1.4 I maskLocS, tracer,
10 adcroft 1.1 O vT,
11     I myThid )
12     C /==========================================================\
13     C | SUBROUTINE GAD_DST3_ADV_Y |
14     C | o Compute Meridional 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 heimbach 1.5 #include "EEPARAMS.h"
23     #include "PARAMS.h"
24 adcroft 1.1 #include "GAD.h"
25    
26     C == Routine arguments ==
27     INTEGER bi,bj,k
28 heimbach 1.5 _RL deltaTloc
29 adcroft 1.1 _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
30 jmc 1.8 _RL vFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
31 jmc 1.4 _RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
32 adcroft 1.1 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
33     _RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
34     INTEGER myThid
35    
36     C == Local variables ==
37 jmc 1.8 C vLoc :: velocity [m/s], meridional component
38 adcroft 1.1 INTEGER i,j
39     _RL Rjm,Rj,Rjp,cfl,d0,d1
40 adcroft 1.2 _RL psiP,psiM,thetaP,thetaM
41 jmc 1.8 _RL vLoc
42 heimbach 1.5 _RL smallNo
43 jmc 1.6 c _RL Rjjm,Rjjp
44 heimbach 1.5
45     IF (inAdMode) THEN
46     smallNo = 1.0D-20
47     ELSE
48     smallNo = 1.0D-20
49     ENDIF
50 adcroft 1.1
51     DO i=1-Olx,sNx+Olx
52     vT(i,1-Oly)=0.
53     vT(i,2-Oly)=0.
54     vT(i,sNy+Oly)=0.
55     ENDDO
56     DO j=1-Oly+2,sNy+Oly-1
57     DO i=1-Olx,sNx+Olx
58 jmc 1.4 Rjp=(tracer(i,j+1)-tracer(i, j ))*maskLocS(i,j+1)
59     Rj =(tracer(i, j )-tracer(i,j-1))*maskLocS(i, j )
60     Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskLocS(i,j-1)
61 adcroft 1.1
62 jmc 1.9 vLoc = vFld(i,j)
63     c vLoc = vTrans(i,j)*recip_dxG(i,j,bi,bj)
64     c & *recip_drF(k)*_recip_hFacS(i,j,k,bi,bj)
65 jmc 1.8 cfl=abs(vLoc*deltaTloc*recip_dyC(i,j,bi,bj))
66 adcroft 1.2 d0=(2.-cfl)*(1.-cfl)*oneSixth
67     d1=(1.-cfl*cfl)*oneSixth
68 jmc 1.6 #ifdef ALLOW_MATRIX
69     IF (.NOT.useMATRIX) THEN
70     #endif /* ALLOW_MATRIX */
71 heimbach 1.5 IF ( ABS(Rj).LT.smallNo .OR.
72     & ABS(Rjm).LT.smallNo ) THEN
73     thetaP=0.
74     psiP=0.
75 jmc 1.8 ELSE
76 heimbach 1.5 thetaP=(Rjm+smallNo)/(smallNo+Rj)
77     psiP=d0+d1*thetaP
78     ENDIF
79     IF ( ABS(Rj).LT.smallNo .OR.
80     & ABS(Rjp).LT.smallNo ) THEN
81     thetaM=0.
82     psiM=0.
83     ELSE
84     thetaM=(Rjp+smallNo)/(smallNo+Rj)
85     psiM=d0+d1*thetaM
86     ENDIF
87 adcroft 1.1 vT(i,j)=
88     & 0.5*(vTrans(i,j)+abs(vTrans(i,j)))
89 adcroft 1.2 & *( Tracer(i,j-1) + psiP*Rj )
90 adcroft 1.1 & +0.5*(vTrans(i,j)-abs(vTrans(i,j)))
91 adcroft 1.2 & *( Tracer(i, j ) - psiM*Rj )
92 jmc 1.6 #ifdef ALLOW_MATRIX
93 jmc 1.8 ELSE
94 jmc 1.6 vT(i,j)=
95     & 0.5*(vTrans(i,j)+abs(vTrans(i,j)))
96     & *( Tracer(i,j-1) + (d0*Rj+d1*Rjm) )
97     & +0.5*(vTrans(i,j)-abs(vTrans(i,j)))
98     & *( Tracer(i, j ) - (d0*Rj+d1*Rjp) )
99     ENDIF
100 jmc 1.8 #endif /* ALLOW_MATRIX */
101 adcroft 1.1
102     ENDDO
103     ENDDO
104    
105     RETURN
106     END

  ViewVC Help
Powered by ViewVC 1.1.22