Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:40:55 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
31566b6684 Alis*0001 #include "GAD_OPTIONS.h"
                0002 
527a84022c Alis*0003 CBOP
                0004 C !ROUTINE: GAD_C4_ADV_X
                0005 
                0006 C !INTERFACE: ==========================================================
f614d87886 Jean*0007       SUBROUTINE GAD_C4_ADV_X(
31566b6684 Alis*0008      I           bi,bj,k,
f614d87886 Jean*0009      I           uTrans, maskLocW,
31566b6684 Alis*0010      I           tracer,
                0011      O           uT,
                0012      I           myThid )
                0013 
527a84022c Alis*0014 C !DESCRIPTION:
                0015 C Calculates the area integrated zonal flux due to advection of a tracer
                0016 C using centered fourth-order interpolation:
                0017 C \begin{equation*}
                0018 C F^x_{adv} = U \overline{ \theta - \frac{1}{6} \delta_{ii} \theta }^i
                0019 C \end{equation*}
                0020 C Near boundaries, the scheme reduces to a second if the flow is away
                0021 C from the boundary and to third order if the flow is towards
                0022 C the boundary.
                0023 
                0024 C !USES: ===============================================================
                0025       IMPLICIT NONE
31566b6684 Alis*0026 #include "SIZE.h"
                0027 #include "GRID.h"
                0028 #include "GAD.h"
                0029 
527a84022c Alis*0030 C !INPUT PARAMETERS: ===================================================
f614d87886 Jean*0031 C  bi,bj        :: tile indices
                0032 C  k            :: vertical level
                0033 C  uTrans       :: zonal volume transport
                0034 C  maskLocW     :: mask (either 0 or 1) at grid-cell western edge
                0035 C  tracer       :: tracer field
                0036 C  myThid       :: my thread Id number
31566b6684 Alis*0037       INTEGER bi,bj,k
f614d87886 Jean*0038       _RL uTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0039       _RS maskLocW(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0040       _RL tracer  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
31566b6684 Alis*0041       INTEGER myThid
                0042 
527a84022c Alis*0043 C !OUTPUT PARAMETERS: ==================================================
f614d87886 Jean*0044 C  uT           :: zonal advective flux
                0045       _RL uT      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
527a84022c Alis*0046 
                0047 C !LOCAL VARIABLES: ====================================================
                0048 C  i,j                  :: loop indices
                0049 C  Rjm,Rj,Rjp           :: differences at i-1,i,i+1
                0050 C  Rjjm,Rjjp            :: second differences at i-1,i
31566b6684 Alis*0051       INTEGER i,j
                0052       _RL Rjm,Rj,Rjp,Rjjm,Rjjp
527a84022c Alis*0053 CEOP
31566b6684 Alis*0054 
                0055       DO j=1-Oly,sNy+Oly
                0056        uT(1-Olx,j)=0.
5bcec3d115 Jean*0057        uT(2-Olx,j)=0.
                0058        uT(sNx+Olx,j)=0.
360ad14abb Mart*0059       ENDDO
                0060       DO j=1-Oly,sNy+Oly
5bcec3d115 Jean*0061        DO i=1-Olx+2,sNx+Olx-1
f614d87886 Jean*0062         Rjp = (tracer(i+1,j)-tracer( i ,j))*maskLocW(i+1,j)
                0063         Rj  = (tracer( i ,j)-tracer(i-1,j))*maskLocW( i ,j)
                0064         Rjm = (tracer(i-1,j)-tracer(i-2,j))*maskLocW(i-1,j)
5d63e10665 Jean*0065         Rjjp=(Rjp-Rj)
                0066         Rjjm=(Rj-Rjm)
8a37624a25 Jean*0067         uT(i,j) =
31566b6684 Alis*0068      &   uTrans(i,j)*(
                0069      &     Tracer(i,j)+Tracer(i-1,j)-oneSixth*( Rjjp+Rjjm )
                0070      &               )*0.5 _d 0
8a37624a25 Jean*0071      &  +ABS( uTrans(i,j) )*0.5 _d 0*oneSixth*( Rjjp-Rjjm )
                0072      &    *( 1. _d 0 - maskW(i-1,j,k,bi,bj)*maskW(i+1,j,k,bi,bj) )
f614d87886 Jean*0073 c    &    *( 1. _d 0 - maskLocW(i-1,j)*maskLocW(i+1,j) )
31566b6684 Alis*0074        ENDDO
                0075       ENDDO
                0076 
                0077       RETURN
                0078       END