Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:41:10 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
4a20c1c4ff Jean*0001 #include "GAD_OPTIONS.h"
                0002 
71207ba845 Alis*0003 CBOP
                0004 C !ROUTINE: GAD_U3_ADV_Y
                0005 
                0006 C !INTERFACE: ==========================================================
f614d87886 Jean*0007       SUBROUTINE GAD_U3_ADV_Y(
4a20c1c4ff Jean*0008      I           bi,bj,k,
f614d87886 Jean*0009      I           vTrans, maskLocS,
4a20c1c4ff Jean*0010      I           tracer,
                0011      O           vT,
                0012      I           myThid )
                0013 
71207ba845 Alis*0014 C !DESCRIPTION:
                0015 C Calculates the area integrated meridional flux due to advection of a tracer
                0016 C using upwind biased third-order interpolation (or the $\kappa=1/3$ scheme):
                0017 C \begin{equation*}
                0018 C F^y_{adv} = V \overline{ \theta  - \frac{1}{6} \delta_{jj} \theta }^j
                0019 C                 + \frac{1}{12} |V| \delta_{jjj} \theta
                0020 C \end{equation*}
5cf0b3ba18 Jean*0021 C Near boundaries, mask all the gradients ==> still 3rd O.
71207ba845 Alis*0022 
                0023 C !USES: ===============================================================
                0024       IMPLICIT NONE
4a20c1c4ff Jean*0025 #include "SIZE.h"
f614d87886 Jean*0026 c#include "GRID.h"
4a20c1c4ff Jean*0027 #include "GAD.h"
                0028 
71207ba845 Alis*0029 C !INPUT PARAMETERS: ===================================================
f614d87886 Jean*0030 C  bi,bj        :: tile indices
                0031 C  k            :: vertical level
                0032 C  vTrans       :: meridional volume transport
                0033 C  maskLocS     :: mask (either 0 or 1) at grid-cell southern edge
                0034 C  tracer       :: tracer field
                0035 C  myThid       :: my thread Id number
4a20c1c4ff Jean*0036       INTEGER bi,bj,k
f614d87886 Jean*0037       _RL vTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0038       _RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0039       _RL tracer  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
4a20c1c4ff Jean*0040       INTEGER myThid
                0041 
71207ba845 Alis*0042 C !OUTPUT PARAMETERS: ==================================================
                0043 C  vT                   :: meridional advective flux
f614d87886 Jean*0044       _RL vT      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
71207ba845 Alis*0045 
                0046 C !LOCAL VARIABLES: ====================================================
                0047 C  i,j                  :: loop indices
                0048 C  Rjm,Rj,Rjp           :: differences at j-1,j,j+1
                0049 C  Rjjm,Rjjp            :: second differences at j-1,j
4a20c1c4ff Jean*0050       INTEGER i,j
                0051       _RL Rjm,Rj,Rjp,Rjjm,Rjjp
71207ba845 Alis*0052 CEOP
4a20c1c4ff Jean*0053 
                0054       DO i=1-Olx,sNx+Olx
                0055        vT(i,1-Oly)=0.
                0056        vT(i,2-Oly)=0.
                0057        vT(i,sNy+Oly)=0.
                0058       ENDDO
                0059       DO j=1-Oly+2,sNy+Oly-1
                0060        DO i=1-Olx,sNx+Olx
f614d87886 Jean*0061         Rjp = (tracer(i,j+1)-tracer(i, j ))*maskLocS(i,j+1)
                0062         Rj  = (tracer(i, j )-tracer(i,j-1))*maskLocS(i, j )
                0063         Rjm = (tracer(i,j-1)-tracer(i,j-2))*maskLocS(i,j-1)
5cf0b3ba18 Jean*0064         Rjjp=Rjp-Rj
                0065         Rjjm=Rj-Rjm
f614d87886 Jean*0066         vT(i,j) =
4a20c1c4ff Jean*0067      &   vTrans(i,j)*(
                0068      &     Tracer(i,j)+Tracer(i,j-1)-oneSixth*( Rjjp+Rjjm )
                0069      &               )*0.5 _d 0
                0070      &  +ABS( vTrans(i,j) )*0.5 _d 0*oneSixth*( Rjjp-Rjjm )
                0071        ENDDO
                0072       ENDDO
                0073 
                0074       RETURN
                0075       END