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

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

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

revision 1.2 by jmc, Wed Jul 11 22:46:32 2001 UTC revision 1.4 by jmc, Wed Mar 6 01:29:36 2002 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_FLUXLIMIT_ADV_Y
8    
9    C !INTERFACE: ==========================================================
10        SUBROUTINE GAD_FLUXLIMIT_ADV_Y(        SUBROUTINE GAD_FLUXLIMIT_ADV_Y(
11       I           bi,bj,k,deltaT,       I           bi,bj,k,deltaT,
12       I           vTrans, vVel,       I           vTrans, vVel,
13       I           tracer,       I           tracer,
14       O           vT,       O           vT,
15       I           myThid )       I           myThid )
 C     /==========================================================\  
 C     | SUBROUTINE GAD_FLUXLIMIT_ADV_Y                           |  
 C     | o Compute Meridional advective Flux of Tracer using      |  
 C     |   Flux Limiter Scheme                                    |  
 C     |==========================================================|  
       IMPLICIT NONE  
16    
17  C     == GLobal variables ==  C !DESCRIPTION:
18    C Calculates the area integrated meridional flux due to advection of a tracer
19    C using second-order interpolation with a flux limiter:
20    C \begin{equation*}
21    C F^y_{adv} = V \overline{ \theta }^j
22    C - \frac{1}{2} \left(
23    C     [ 1 - \psi(C_r) ] |V|
24    C    + V \frac{v \Delta t}{\Delta y_c} \psi(C_r)
25    C              \right) \delta_j \theta
26    C \end{equation*}
27    C where the $\psi(C_r)$ is the limiter function and $C_r$ is
28    C the slope ratio.
29    
30    C !USES: ===============================================================
31          IMPLICIT NONE
32  #include "SIZE.h"  #include "SIZE.h"
33  #include "GRID.h"  #include "GRID.h"
34    
35  C     == Routine arguments ==  C !INPUT PARAMETERS: ===================================================
36    C  bi,bj                :: tile indices
37    C  k                    :: vertical level
38    C  vTrans               :: meridional volume transport
39    C  vVel                 :: meridional flow
40    C  tracer               :: tracer field
41    C  myThid               :: thread number
42        INTEGER bi,bj,k        INTEGER bi,bj,k
43        _RL deltaT        _RL deltaT
44        _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45        _RL vVel  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)        _RL vVel  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
46        _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)  
47        INTEGER myThid        INTEGER myThid
48    
49  C     == Local variables ==  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  i,j                  :: loop indices
55    C  Cr                   :: slope ratio
56    C  Rjm,Rj,Rjp           :: differences at j-1,j,j+1
57    C  vFld                 :: velocity [m/s], meridional component
58        INTEGER i,j        INTEGER i,j
59        _RL Cr,Rjm,Rj,Rjp        _RL Cr,Rjm,Rj,Rjp
60          _RL vFld
61    C Statement function provides Limiter(Cr)
62  #include "GAD_FLUX_LIMITER.h"  #include "GAD_FLUX_LIMITER.h"
63    CEOP
64    
65        DO i=1-Olx,sNx+Olx        DO i=1-Olx,sNx+Olx
66         vT(i,1-Oly)=0.         vT(i,1-Oly)=0.
# Line 41  C     == Local variables == Line 69  C     == Local variables ==
69        ENDDO        ENDDO
70        DO j=1-Oly+2,sNy+Oly-1        DO j=1-Oly+2,sNy+Oly-1
71         DO i=1-Olx,sNx+Olx         DO i=1-Olx,sNx+Olx
72    
73    c       vFld = vVel(i,j,k,bi,bj)
74            vFld = vTrans(i,j)*recip_dxG(i,j,bi,bj)
75         &       *recip_drF(k)*recip_hFacS(i,j,k,bi,bj)
76          Rjp=(tracer(i,j+1)-tracer(i,j))*maskS(i,j+1,k,bi,bj)          Rjp=(tracer(i,j+1)-tracer(i,j))*maskS(i,j+1,k,bi,bj)
77          Rj=(tracer(i,j)-tracer(i,j-1))*maskS(i,j,k,bi,bj)          Rj=(tracer(i,j)-tracer(i,j-1))*maskS(i,j,k,bi,bj)
78          Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskS(i,j-1,k,bi,bj)          Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskS(i,j-1,k,bi,bj)
79    
80          IF (Rj.NE.0.) THEN          IF (Rj.NE.0.) THEN
81           IF (vTrans(i,j).GT.0) THEN           IF (vTrans(i,j).GT.0) THEN
82             Cr=Rjm/Rj             Cr=Rjm/Rj
# Line 62  C     == Local variables == Line 95  C     == Local variables ==
95       &   vTrans(i,j)*(Tracer(i,j)+Tracer(i,j-1))*0.5 _d 0       &   vTrans(i,j)*(Tracer(i,j)+Tracer(i,j-1))*0.5 _d 0
96       &   -0.5*(       &   -0.5*(
97       &        (1-Cr)*ABS(vTrans(i,j))       &        (1-Cr)*ABS(vTrans(i,j))
98       &        +vTrans(i,j)*vVel(i,j,k,bi,bj)*deltaT       &        +vTrans(i,j)*vFld*deltaT
99       &         *recip_dyC(i,j,bi,bj)*Cr       &         *recip_dyC(i,j,bi,bj)*Cr
100       &        )*Rj       &        )*Rj
101         ENDDO         ENDDO

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22