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

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

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

revision 1.9 by jmc, Mon Jun 19 14:40:43 2006 UTC revision 1.10 by jmc, Sun Oct 22 01:08:04 2006 UTC
# Line 3  C $Name$ Line 3  C $Name$
3    
4  #include "GAD_OPTIONS.h"  #include "GAD_OPTIONS.h"
5    
6    CBOP
7    C !ROUTINE: GAD_DST3_ADV_Y
8    
9    C !INTERFACE: ==========================================================
10        SUBROUTINE GAD_DST3_ADV_Y(        SUBROUTINE GAD_DST3_ADV_Y(
11       I           bi,bj,k,deltaTloc,       I           bi,bj,k,deltaTloc,
12       I           vTrans, vFld,       I           vTrans, vFld,
13       I           maskLocS, tracer,       I           maskLocS, tracer,
14       O           vT,       O           vT,
15       I           myThid )       I           myThid )
16  C     /==========================================================\  C !DESCRIPTION:
17  C     | SUBROUTINE GAD_DST3_ADV_Y                                |  C  Calculates the area integrated Meridional flux due to advection of a
18  C     | o Compute Meridional advective Flux of Tracer using      |  C  tracer using 3rd-order Direct Space and Time (DST-3) Advection Scheme
19  C     |   3rd Order DST Sceheme                                  |  
20  C     |==========================================================|  C !USES: ===============================================================
21        IMPLICIT NONE        IMPLICIT NONE
22    
23  C     == GLobal variables ==  C     == GLobal variables ==
# Line 24  C     == GLobal variables == Line 28  C     == GLobal variables ==
28  #include "GAD.h"  #include "GAD.h"
29    
30  C     == Routine arguments ==  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        INTEGER bi,bj,k
40        _RL deltaTloc        _RL deltaTloc
41        _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
42        _RL vFld  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL vFld  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
43        _RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44        _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
       _RL vT    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
45        INTEGER myThid        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 ==  C     == Local variables ==
52  C     vLoc    :: velocity [m/s], meridional component  C !LOCAL VARIABLES: ====================================================
53    C  i,j               :: loop indices
54    C  vLoc              :: velocity [m/s], meridional component
55    C  cfl               :: Courant-Friedrich-Levy number
56        INTEGER i,j        INTEGER i,j
57        _RL Rjm,Rj,Rjp,cfl,d0,d1        _RL Rjm,Rj,Rjp,cfl,d0,d1
       _RL psiP,psiM,thetaP,thetaM  
58        _RL vLoc        _RL vLoc
59    #ifdef OLD_DST3_FORMULATION
60          _RL psiP,psiM,thetaP,thetaM
61        _RL smallNo        _RL smallNo
62  c     _RL Rjjm,Rjjp  c     _RL Rjjm,Rjjp
63    
# Line 47  c     _RL Rjjm,Rjjp Line 66  c     _RL Rjjm,Rjjp
66        ELSE        ELSE
67         smallNo = 1.0D-20         smallNo = 1.0D-20
68        ENDIF        ENDIF
69    #endif
70    
71        DO i=1-Olx,sNx+Olx        DO i=1-Olx,sNx+Olx
72         vT(i,1-Oly)=0.         vT(i,1-Oly)=0.
# Line 62  c     _RL Rjjm,Rjjp Line 82  c     _RL Rjjm,Rjjp
82          vLoc = vFld(i,j)          vLoc = vFld(i,j)
83  c       vLoc = vTrans(i,j)*recip_dxG(i,j,bi,bj)  c       vLoc = vTrans(i,j)*recip_dxG(i,j,bi,bj)
84  c    &       *recip_drF(k)*_recip_hFacS(i,j,k,bi,bj)  c    &       *recip_drF(k)*_recip_hFacS(i,j,k,bi,bj)
85          cfl=abs(vLoc*deltaTloc*recip_dyC(i,j,bi,bj))          cfl=ABS(vLoc*deltaTloc*recip_dyC(i,j,bi,bj))
86          d0=(2.-cfl)*(1.-cfl)*oneSixth          d0=(2.-cfl)*(1.-cfl)*oneSixth
87          d1=(1.-cfl*cfl)*oneSixth          d1=(1.-cfl*cfl)*oneSixth
88  #ifdef ALLOW_MATRIX  #ifdef OLD_DST3_FORMULATION
         IF (.NOT.useMATRIX) THEN  
 #endif /* ALLOW_MATRIX */  
89          IF ( ABS(Rj).LT.smallNo .OR.          IF ( ABS(Rj).LT.smallNo .OR.
90       &       ABS(Rjm).LT.smallNo ) THEN       &       ABS(Rjm).LT.smallNo ) THEN
91           thetaP=0.           thetaP=0.
# Line 85  c    &       *recip_drF(k)*_recip_hFacS( Line 103  c    &       *recip_drF(k)*_recip_hFacS(
103           psiM=d0+d1*thetaM           psiM=d0+d1*thetaM
104          ENDIF          ENDIF
105          vT(i,j)=          vT(i,j)=
106       &   0.5*(vTrans(i,j)+abs(vTrans(i,j)))       &   0.5*(vTrans(i,j)+ABS(vTrans(i,j)))
107       &      *( Tracer(i,j-1) + psiP*Rj )       &      *( Tracer(i,j-1) + psiP*Rj )
108       &  +0.5*(vTrans(i,j)-abs(vTrans(i,j)))       &  +0.5*(vTrans(i,j)-ABS(vTrans(i,j)))
109       &      *( Tracer(i, j ) - psiM*Rj )       &      *( Tracer(i, j ) - psiM*Rj )
110  #ifdef ALLOW_MATRIX  #else /* OLD_DST3_FORMULATION */
111          ELSE          vT(i,j)=
112            vT(i,j)=       &   0.5*(vTrans(i,j)+ABS(vTrans(i,j)))
113       &     0.5*(vTrans(i,j)+abs(vTrans(i,j)))       &      *( Tracer(i,j-1) + (d0*Rj+d1*Rjm) )
114       &        *( Tracer(i,j-1) + (d0*Rj+d1*Rjm) )       &  +0.5*(vTrans(i,j)-ABS(vTrans(i,j)))
115       &    +0.5*(vTrans(i,j)-abs(vTrans(i,j)))       &      *( Tracer(i, j ) - (d0*Rj+d1*Rjp) )
116       &        *( Tracer(i, j ) - (d0*Rj+d1*Rjp) )  #endif /* OLD_DST3_FORMULATION */
         ENDIF  
 #endif /* ALLOW_MATRIX */  
117    
118         ENDDO         ENDDO
119        ENDDO        ENDDO

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.22