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

Contents 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.12 - (show annotations) (download)
Wed Apr 4 01:39:06 2007 UTC (17 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62u, checkpoint62t, checkpoint62c, checkpoint59, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint58y_post, checkpoint60, checkpoint61, checkpoint62, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint62b, checkpoint61f, checkpoint61n, checkpoint59j, checkpoint61q, checkpoint61e, checkpoint61g, checkpoint61d, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.11: +7 -7 lines
add a logical argument "calcCFL" to DST horizontal Advection S/R
(if false, assume that uFld,vFld are already CFL number in x,y dir)

1 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_dst3_adv_y.F,v 1.11 2006/12/05 22:21:50 jmc Exp $
2 C $Name: $
3
4 #include "GAD_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: GAD_DST3_ADV_Y
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE GAD_DST3_ADV_Y(
11 I bi,bj,k, calcCFL, deltaTloc,
12 I vTrans, vFld,
13 I maskLocS, tracer,
14 O vT,
15 I myThid )
16 C !DESCRIPTION:
17 C Calculates the area integrated Meridional flux due to advection of a
18 C tracer using 3rd-order Direct Space and Time (DST-3) Advection Scheme
19
20 C !USES: ===============================================================
21 IMPLICIT NONE
22
23 C == GLobal variables ==
24 #include "SIZE.h"
25 #include "GRID.h"
26 #include "EEPARAMS.h"
27 #include "PARAMS.h"
28 #include "GAD.h"
29
30 C == Routine arguments ==
31 C !INPUT PARAMETERS: ===================================================
32 C bi,bj :: tile indices
33 C k :: vertical level
34 C calcCFL :: =T: calculate CFL number ; =F: take vFld as CFL
35 C deltaTloc :: local time-step (s)
36 C vTrans :: meridional volume transport
37 C vFld :: meridional flow / CFL number
38 C tracer :: tracer field
39 C myThid :: thread number
40 INTEGER bi,bj,k
41 LOGICAL calcCFL
42 _RL deltaTloc
43 _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44 _RL vFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45 _RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47 INTEGER myThid
48
49 C !OUTPUT PARAMETERS: ==================================================
50 C vT :: meridional advective flux
51 _RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
52
53 C == Local variables ==
54 C !LOCAL VARIABLES: ====================================================
55 C i,j :: loop indices
56 C vCFL :: Courant-Friedrich-Levy number
57 INTEGER i,j
58 _RL Rjm,Rj,Rjp,vCFL,d0,d1
59 #ifdef OLD_DST3_FORMULATION
60 _RL psiP,psiM,thetaP,thetaM
61 _RL smallNo
62 c _RL Rjjm,Rjjp
63
64 IF (inAdMode) THEN
65 smallNo = 1.0D-20
66 ELSE
67 smallNo = 1.0D-20
68 ENDIF
69 #endif
70
71 DO i=1-Olx,sNx+Olx
72 vT(i,1-Oly)=0.
73 vT(i,2-Oly)=0.
74 vT(i,sNy+Oly)=0.
75 ENDDO
76 DO j=1-Oly+2,sNy+Oly-1
77 DO i=1-Olx,sNx+Olx
78 Rjp=(tracer(i,j+1)-tracer(i, j ))*maskLocS(i,j+1)
79 Rj =(tracer(i, j )-tracer(i,j-1))*maskLocS(i, j )
80 Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskLocS(i,j-1)
81
82 vCFL = vFld(i,j)
83 IF ( calcCFL ) vCFL = ABS( vFld(i,j)*deltaTloc
84 & *recip_dyC(i,j,bi,bj)*recip_deepFacC(k) )
85 d0=(2.-vCFL)*(1.-vCFL)*oneSixth
86 d1=(1.-vCFL*vCFL)*oneSixth
87 #ifdef OLD_DST3_FORMULATION
88 IF ( ABS(Rj).LT.smallNo .OR.
89 & ABS(Rjm).LT.smallNo ) THEN
90 thetaP=0.
91 psiP=0.
92 ELSE
93 thetaP=(Rjm+smallNo)/(smallNo+Rj)
94 psiP=d0+d1*thetaP
95 ENDIF
96 IF ( ABS(Rj).LT.smallNo .OR.
97 & ABS(Rjp).LT.smallNo ) THEN
98 thetaM=0.
99 psiM=0.
100 ELSE
101 thetaM=(Rjp+smallNo)/(smallNo+Rj)
102 psiM=d0+d1*thetaM
103 ENDIF
104 vT(i,j)=
105 & 0.5*(vTrans(i,j)+ABS(vTrans(i,j)))
106 & *( Tracer(i,j-1) + psiP*Rj )
107 & +0.5*(vTrans(i,j)-ABS(vTrans(i,j)))
108 & *( Tracer(i, j ) - psiM*Rj )
109 #else /* OLD_DST3_FORMULATION */
110 vT(i,j)=
111 & 0.5*(vTrans(i,j)+ABS(vTrans(i,j)))
112 & *( Tracer(i,j-1) + (d0*Rj+d1*Rjm) )
113 & +0.5*(vTrans(i,j)-ABS(vTrans(i,j)))
114 & *( Tracer(i, j ) - (d0*Rj+d1*Rjp) )
115 #endif /* OLD_DST3_FORMULATION */
116
117 ENDDO
118 ENDDO
119
120 RETURN
121 END

  ViewVC Help
Powered by ViewVC 1.1.22