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_X
                0005 
                0006 C !INTERFACE: ==========================================================
f614d87886 Jean*0007       SUBROUTINE GAD_U3_ADV_X(
4a20c1c4ff Jean*0008      I           bi,bj,k,
f614d87886 Jean*0009      I           uTrans, maskLocW,
4a20c1c4ff Jean*0010      I           tracer,
                0011      O           uT,
                0012      I           myThid )
                0013 
71207ba845 Alis*0014 C !DESCRIPTION:
                0015 C Calculates the area integrated zonal 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^x_{adv} = U \overline{ \theta  - \frac{1}{6} \delta_{ii} \theta }^i
                0019 C                 + \frac{1}{12} |U| \delta_{iii} \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  uTrans       :: zonal volume transport
                0033 C  maskLocW     :: mask (either 0 or 1) at grid-cell western edge
                0034 C  tracer       :: tracer field
                0035 C  myThid       :: my thread Id number
4a20c1c4ff Jean*0036       INTEGER bi,bj,k
f614d87886 Jean*0037       _RL uTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0038       _RS maskLocW(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: ==================================================
f614d87886 Jean*0043 C  uT           :: zonal advective flux
                0044       _RL uT      (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 i-1,i,i+1
                0049 C  Rjjm,Rjjp            :: second differences at i-1,i
4a20c1c4ff Jean*0050       INTEGER i,j
                0051       _RL Rjm,Rj,Rjp,Rjjm,Rjjp
71207ba845 Alis*0052 CEOP
4a20c1c4ff Jean*0053 
                0054       DO j=1-Oly,sNy+Oly
                0055        uT(1-Olx,j)=0.
                0056        uT(2-Olx,j)=0.
                0057        uT(sNx+Olx,j)=0.
360ad14abb Mart*0058       ENDDO
                0059       DO j=1-Oly,sNy+Oly
4a20c1c4ff Jean*0060        DO i=1-Olx+2,sNx+Olx-1
f614d87886 Jean*0061         Rjp = (tracer(i+1,j)-tracer( i ,j))*maskLocW(i+1,j)
                0062         Rj  = (tracer( i ,j)-tracer(i-1,j))*maskLocW( i ,j)
                0063         Rjm = (tracer(i-1,j)-tracer(i-2,j))*maskLocW(i-1,j)
5cf0b3ba18 Jean*0064         Rjjp=Rjp-Rj
                0065         Rjjm=Rj-Rjm
f614d87886 Jean*0066         uT(i,j) =
4a20c1c4ff Jean*0067      &   uTrans(i,j)*(
                0068      &     Tracer(i,j)+Tracer(i-1,j)-oneSixth*( Rjjp+Rjjm )
                0069      &               )*0.5 _d 0
                0070      &  +ABS( uTrans(i,j) )*0.5 _d 0*oneSixth*( Rjjp-Rjjm )
                0071        ENDDO
                0072       ENDDO
                0073 
                0074       RETURN
                0075       END