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

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

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

revision 1.3 by adcroft, Fri Sep 21 13:11:43 2001 UTC revision 1.8 by jmc, Sun Jun 18 23:31:35 2006 UTC
# Line 7  CBOP Line 7  CBOP
7  C !ROUTINE: GAD_FLUXLIMIT_ADV_X  C !ROUTINE: GAD_FLUXLIMIT_ADV_X
8    
9  C !INTERFACE: ==========================================================  C !INTERFACE: ==========================================================
10        SUBROUTINE GAD_FLUXLIMIT_ADV_X(        SUBROUTINE GAD_FLUXLIMIT_ADV_X(
11       I           bi,bj,k,deltaT,       I           bi,bj,k,deltaTloc,
12       I           uTrans, uVel,       I           uTrans, uFld,
13       I           tracer,       I           maskLocW, tracer,
14       O           uT,       O           uT,
15       I           myThid )       I           myThid )
16    
# Line 18  C !DESCRIPTION: Line 18  C !DESCRIPTION:
18  C Calculates the area integrated zonal flux due to advection of a tracer  C Calculates the area integrated zonal flux due to advection of a tracer
19  C using second-order interpolation with a flux limiter:  C using second-order interpolation with a flux limiter:
20  C \begin{equation*}  C \begin{equation*}
21  C F^x_{adv} = U \overline{ \theta }^i  C F^x_{adv} = U \overline{ \theta }^i
22  C - \frac{1}{2} \left(  C - \frac{1}{2} \left(
23  C     [ 1 - \psi(C_r) ] |U|  C     [ 1 - \psi(C_r) ] |U|
24  C    + U \frac{u \Delta t}{\Delta x_c} \psi(C_r)  C    + U \frac{u \Delta t}{\Delta x_c} \psi(C_r)
# Line 36  C !INPUT PARAMETERS: =================== Line 36  C !INPUT PARAMETERS: ===================
36  C  bi,bj                :: tile indices  C  bi,bj                :: tile indices
37  C  k                    :: vertical level  C  k                    :: vertical level
38  C  uTrans               :: zonal volume transport  C  uTrans               :: zonal volume transport
39  C  uVel                 :: zonal flow  C  uFld                 :: zonal flow
40  C  tracer               :: tracer field  C  tracer               :: tracer field
41  C  myThid               :: thread number  C  myThid               :: thread number
42        INTEGER bi,bj,k        INTEGER bi,bj,k
43        _RL deltaT        _RL deltaTloc
44        _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45        _RL uVel  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)        _RL uFld  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46          _RS maskLocW(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47        _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
48        INTEGER myThid        INTEGER myThid
49    
# Line 54  C !LOCAL VARIABLES: ==================== Line 55  C !LOCAL VARIABLES: ====================
55  C  i,j                  :: loop indices  C  i,j                  :: loop indices
56  C  Cr                   :: slope ratio  C  Cr                   :: slope ratio
57  C  Rjm,Rj,Rjp           :: differences at i-1,i,i+1  C  Rjm,Rj,Rjp           :: differences at i-1,i,i+1
58    C  uLoc                 :: velocity [m/s], zonal component
59        INTEGER i,j        INTEGER i,j
60        _RL Cr,Rjm,Rj,Rjp        _RL Cr,Rjm,Rj,Rjp
61          _RL uLoc
62  C Statement function provides Limiter(Cr)  C Statement function provides Limiter(Cr)
63  #include "GAD_FLUX_LIMITER.h"  #include "GAD_FLUX_LIMITER.h"
64  CEOP  CEOP
# Line 65  CEOP Line 68  CEOP
68         uT(2-Olx,j)=0.         uT(2-Olx,j)=0.
69         uT(sNx+Olx,j)=0.         uT(sNx+Olx,j)=0.
70         DO i=1-Olx+2,sNx+Olx-1         DO i=1-Olx+2,sNx+Olx-1
71          Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj)  
72          Rj=(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj)  c       uLoc = uFld(i,j)
73          Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskW(i-1,j,k,bi,bj)          uLoc = uTrans(i,j)*recip_dyG(i,j,bi,bj)
74         &       *recip_drF(k)*_recip_hFacW(i,j,k,bi,bj)
75            Rjp=(tracer(i+1,j)-tracer( i ,j))*maskLocW(i+1,j)
76            Rj =(tracer( i ,j)-tracer(i-1,j))*maskLocW( i ,j)
77            Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskLocW(i-1,j)
78    
79          IF (Rj.NE.0.) THEN          IF (Rj.NE.0.) THEN
80           IF (uTrans(i,j).GT.0) THEN           IF (uTrans(i,j).GT.0) THEN
81             Cr=Rjm/Rj             Cr=Rjm/Rj
# Line 82  CEOP Line 90  CEOP
90           ENDIF           ENDIF
91          ENDIF          ENDIF
92          Cr=Limiter(Cr)          Cr=Limiter(Cr)
93          uT(i,j) =          uT(i,j) =
94       &   uTrans(i,j)*(Tracer(i,j)+Tracer(i-1,j))*0.5 _d 0       &   uTrans(i,j)*(Tracer(i,j)+Tracer(i-1,j))*0.5 _d 0
95       &   -0.5*(       &   -0.5*(
96       &        (1-Cr)*ABS(uTrans(i,j))       &        (1-Cr)*ABS(uTrans(i,j))
97       &        +uTrans(i,j)*uVel(i,j,k,bi,bj)*deltaT       &        +uTrans(i,j)*uLoc*deltaTloc
98       &         *recip_dxC(i,j,bi,bj)*Cr       &         *recip_dxC(i,j,bi,bj)*Cr
99       &        )*Rj       &        )*Rj
100         ENDDO         ENDDO

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.22