/[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.11 - (show annotations) (download)
Tue Dec 5 22:21:50 2006 UTC (17 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58t_post, checkpoint58w_post, mitgcm_mapl_00, checkpoint58v_post, checkpoint58x_post, checkpoint58u_post, checkpoint58s_post
Changes since 1.10: +7 -8 lines
change horizontal CFL for deep-model.

1 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_dst3_adv_y.F,v 1.10 2006/10/22 01:08:04 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,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 deltaTloc :: local time-step (s)
35 C vTrans :: meridional volume transport
36 C vFld :: meridional flow
37 C tracer :: tracer field
38 C myThid :: thread number
39 INTEGER bi,bj,k
40 _RL deltaTloc
41 _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
42 _RL vFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
43 _RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45 INTEGER myThid
46
47 C !OUTPUT PARAMETERS: ==================================================
48 C vT :: meridional advective flux
49 _RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
50
51 C == Local variables ==
52 C !LOCAL VARIABLES: ====================================================
53 C i,j :: loop indices
54 C vLoc :: velocity [m/s], meridional component
55 C vCFL :: Courant-Friedrich-Levy number
56 INTEGER i,j
57 _RL Rjm,Rj,Rjp,vCFL,d0,d1
58 _RL vLoc
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 vLoc = vFld(i,j)
83 vCFL = ABS( vLoc*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