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 
aba3ddc7b7 Alis*0003 CBOP
                0004 C !ROUTINE: GAD_C2_ADV_R
                0005 
                0006 C !INTERFACE: ==========================================================
e9de1d7682 Jean*0007       SUBROUTINE GAD_C2_ADV_R(
                0008      I           bi, bj, k,
31566b6684 Alis*0009      I           rTrans,
                0010      I           tracer,
                0011      O           wT,
                0012      I           myThid )
                0013 
aba3ddc7b7 Alis*0014 C !DESCRIPTION:
527a84022c Alis*0015 C Calculates the area integrated vertical flux due to advection of a tracer
                0016 C using centered second-order interpolation:
aba3ddc7b7 Alis*0017 C \begin{equation*}
527a84022c Alis*0018 C F^r_{adv} = W \overline{\theta}^k
aba3ddc7b7 Alis*0019 C \end{equation*}
                0020 
                0021 C !USES: ===============================================================
                0022       IMPLICIT NONE
31566b6684 Alis*0023 #include "SIZE.h"
                0024 #include "GRID.h"
                0025 #include "EEPARAMS.h"
                0026 #include "PARAMS.h"
                0027 
aba3ddc7b7 Alis*0028 C !INPUT PARAMETERS: ===================================================
                0029 C  bi,bj                :: tile indices
                0030 C  k                    :: vertical level
                0031 C  rTrans               :: vertical volume transport
                0032 C  tracer               :: tracer field
                0033 C  myThid               :: thread number
31566b6684 Alis*0034       INTEGER bi,bj,k
                0035       _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
e9de1d7682 Jean*0036       _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
31566b6684 Alis*0037       INTEGER myThid
                0038 
aba3ddc7b7 Alis*0039 C !OUTPUT PARAMETERS: ==================================================
                0040 C  wT                   :: vertical advective flux
                0041       _RL wT    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0042 
                0043 C !LOCAL VARIABLES: ====================================================
                0044 C  i,j                  :: loop indices
                0045 C  km1                  :: =k+1 for k<Nr, =Nr for k>=Nr
31566b6684 Alis*0046       INTEGER i,j,km1
aba3ddc7b7 Alis*0047 CEOP
31566b6684 Alis*0048 
                0049       km1=max(1,k-1)
                0050 
ab2f187c7d Jean*0051       IF ( k.EQ.1 .OR. k.GT.Nr) THEN
e9de1d7682 Jean*0052        DO j=1-OLy,sNy+OLy
                0053         DO i=1-OLx,sNx+OLx
31566b6684 Alis*0054          wT(i,j) = 0.
                0055         ENDDO
                0056        ENDDO
                0057       ELSE
e9de1d7682 Jean*0058        DO j=1-OLy,sNy+OLy
                0059         DO i=1-OLx,sNx+OLx
                0060          wT(i,j) = maskC(i,j,km1,bi,bj)*
ab2f187c7d Jean*0061      &     rTrans(i,j)*
e9de1d7682 Jean*0062      &        (tracer(i,j,k)+tracer(i,j,km1))*0.5 _d 0
31566b6684 Alis*0063         ENDDO
                0064        ENDDO
                0065       ENDIF
                0066 
                0067       RETURN
                0068       END