/[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.12 - (hide 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 jmc 1.12 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 jmc 1.3 C $Name: $
3 adcroft 1.1
4     #include "GAD_OPTIONS.h"
5    
6 jmc 1.10 CBOP
7     C !ROUTINE: GAD_DST3_ADV_Y
8    
9     C !INTERFACE: ==========================================================
10 jmc 1.8 SUBROUTINE GAD_DST3_ADV_Y(
11 jmc 1.12 I bi,bj,k, calcCFL, deltaTloc,
12 jmc 1.8 I vTrans, vFld,
13 jmc 1.4 I maskLocS, tracer,
14 adcroft 1.1 O vT,
15     I myThid )
16 jmc 1.10 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 adcroft 1.1 IMPLICIT NONE
22    
23     C == GLobal variables ==
24     #include "SIZE.h"
25     #include "GRID.h"
26 heimbach 1.5 #include "EEPARAMS.h"
27     #include "PARAMS.h"
28 adcroft 1.1 #include "GAD.h"
29    
30     C == Routine arguments ==
31 jmc 1.10 C !INPUT PARAMETERS: ===================================================
32     C bi,bj :: tile indices
33     C k :: vertical level
34 jmc 1.12 C calcCFL :: =T: calculate CFL number ; =F: take vFld as CFL
35 jmc 1.10 C deltaTloc :: local time-step (s)
36     C vTrans :: meridional volume transport
37 jmc 1.12 C vFld :: meridional flow / CFL number
38 jmc 1.10 C tracer :: tracer field
39     C myThid :: thread number
40 adcroft 1.1 INTEGER bi,bj,k
41 jmc 1.12 LOGICAL calcCFL
42 heimbach 1.5 _RL deltaTloc
43 adcroft 1.1 _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44 jmc 1.8 _RL vFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45 jmc 1.4 _RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46 adcroft 1.1 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47 jmc 1.10 INTEGER myThid
48    
49     C !OUTPUT PARAMETERS: ==================================================
50     C vT :: meridional advective flux
51 adcroft 1.1 _RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
52    
53     C == Local variables ==
54 jmc 1.10 C !LOCAL VARIABLES: ====================================================
55     C i,j :: loop indices
56 jmc 1.11 C vCFL :: Courant-Friedrich-Levy number
57 adcroft 1.1 INTEGER i,j
58 jmc 1.11 _RL Rjm,Rj,Rjp,vCFL,d0,d1
59 jmc 1.10 #ifdef OLD_DST3_FORMULATION
60 adcroft 1.2 _RL psiP,psiM,thetaP,thetaM
61 heimbach 1.5 _RL smallNo
62 jmc 1.6 c _RL Rjjm,Rjjp
63 heimbach 1.5
64     IF (inAdMode) THEN
65     smallNo = 1.0D-20
66     ELSE
67     smallNo = 1.0D-20
68     ENDIF
69 jmc 1.10 #endif
70 adcroft 1.1
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 jmc 1.4 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 adcroft 1.1
82 jmc 1.12 vCFL = vFld(i,j)
83     IF ( calcCFL ) vCFL = ABS( vFld(i,j)*deltaTloc
84 jmc 1.11 & *recip_dyC(i,j,bi,bj)*recip_deepFacC(k) )
85     d0=(2.-vCFL)*(1.-vCFL)*oneSixth
86     d1=(1.-vCFL*vCFL)*oneSixth
87 jmc 1.10 #ifdef OLD_DST3_FORMULATION
88 heimbach 1.5 IF ( ABS(Rj).LT.smallNo .OR.
89     & ABS(Rjm).LT.smallNo ) THEN
90     thetaP=0.
91     psiP=0.
92 jmc 1.8 ELSE
93 heimbach 1.5 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 adcroft 1.1 vT(i,j)=
105 jmc 1.10 & 0.5*(vTrans(i,j)+ABS(vTrans(i,j)))
106 adcroft 1.2 & *( Tracer(i,j-1) + psiP*Rj )
107 jmc 1.10 & +0.5*(vTrans(i,j)-ABS(vTrans(i,j)))
108 adcroft 1.2 & *( Tracer(i, j ) - psiM*Rj )
109 jmc 1.10 #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 adcroft 1.1
117     ENDDO
118     ENDDO
119    
120     RETURN
121     END

  ViewVC Help
Powered by ViewVC 1.1.22