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_Y
                0005 
                0006 C !INTERFACE: ==========================================================
f614d87886 Jean*0007       SUBROUTINE GAD_C4_ADV_Y(
31566b6684 Alis*0008      I           bi,bj,k,
f614d87886 Jean*0009      I           vTrans, maskLocS,
31566b6684 Alis*0010      I           tracer,
                0011      O           vT,
                0012      I           myThid )
                0013 
527a84022c Alis*0014 C !DESCRIPTION:
                0015 C Calculates the area integrated meridional flux due to advection of a tracer
                0016 C using centered fourth-order interpolation:
                0017 C \begin{equation*}
                0018 C F^y_{adv} = V \overline{ \theta - \frac{1}{6} \delta_{jj} \theta }^j
                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  vTrans       :: meridional volume transport
                0034 C  maskLocS     :: mask (either 0 or 1) at grid-cell southern edge
                0035 C  tracer       :: tracer field
                0036 C  myThid       :: my thread Id number
31566b6684 Alis*0037       INTEGER bi,bj,k
f614d87886 Jean*0038       _RL vTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0039       _RS maskLocS(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 vT      (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 j-1,j,j+1
                0050 C  Rjjm,Rjjp            :: second differences at j-1,j
31566b6684 Alis*0051       INTEGER i,j
                0052       _RL Rjm,Rj,Rjp,Rjjm,Rjjp
527a84022c Alis*0053 CEOP
31566b6684 Alis*0054 
                0055       DO i=1-Olx,sNx+Olx
                0056        vT(i,1-Oly)=0.
5bcec3d115 Jean*0057        vT(i,2-Oly)=0.
                0058        vT(i,sNy+Oly)=0.
31566b6684 Alis*0059       ENDDO
5bcec3d115 Jean*0060       DO j=1-Oly+2,sNy+Oly-1
31566b6684 Alis*0061        DO i=1-Olx,sNx+Olx
f614d87886 Jean*0062         Rjp = (tracer(i,j+1)-tracer(i, j ))*maskLocS(i,j+1)
                0063         Rj  = (tracer(i, j )-tracer(i,j-1))*maskLocS(i, j )
                0064         Rjm = (tracer(i,j-1)-tracer(i,j-2))*maskLocS(i,j-1)
5d63e10665 Jean*0065         Rjjp=(Rjp-Rj)
                0066         Rjjm=(Rj-Rjm)
8a37624a25 Jean*0067         vT(i,j) =
31566b6684 Alis*0068      &   vTrans(i,j)*(
                0069      &     Tracer(i,j)+Tracer(i,j-1)-oneSixth*( Rjjp+Rjjm )
                0070      &               )*0.5 _d 0
8a37624a25 Jean*0071      &  +ABS( vTrans(i,j) )*0.5 _d 0*oneSixth*( Rjjp-Rjjm )
                0072      &    *( 1. _d 0 - maskS(i,j-1,k,bi,bj)*maskS(i,j+1,k,bi,bj) )
f614d87886 Jean*0073 c    &    *( 1. _d 0 - maskLocS(i,j-1)*maskLocS(i,j+1) )
31566b6684 Alis*0074        ENDDO
                0075       ENDDO
                0076 
                0077       RETURN
                0078       END