Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:42:11 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
6780674bfd Jean*0001 #include "MOM_COMMON_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C !ROUTINE: MOM_W_METRIC_NH
                0005 
                0006 C !INTERFACE: ==========================================================
                0007       SUBROUTINE MOM_W_METRIC_NH(
                0008      I               bi,bj,k,
                0009      I               uFld, vFld,
                0010      O               wMetricTerms,
                0011      I               myThid )
                0012 
                0013 C !DESCRIPTION:
                0014 C Calculates the vertical metric term due to non-hydrostaticity on the sphere:
                0015 C \begin{equation}
                0016 C + \frac{1}{a} \overline{ \overline{u^2}^{i} + \overline{v^2}^{j} }^{k}
                0017 C \end{equation}
                0018 
                0019 C !USES: ===============================================================
                0020       IMPLICIT NONE
                0021 #include "SIZE.h"
                0022 #include "EEPARAMS.h"
                0023 #include "PARAMS.h"
                0024 #include "GRID.h"
                0025 
                0026 C !INPUT PARAMETERS: ===================================================
                0027 C  bi,bj                :: tile indices
                0028 C  k                    :: vertical level
eaba2fd266 Jean*0029 C  uFld                 :: zonal flow
                0030 C  vFld                 :: meridional flow
6780674bfd Jean*0031 C  myThid               :: my Thread Id number
                0032       INTEGER bi,bj,k
                0033       _RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0034       _RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0035       INTEGER myThid
                0036 
                0037 C !OUTPUT PARAMETERS: ==================================================
                0038 C  wMetricTerms         :: metric term
                0039       _RL wMetricTerms(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0040 
                0041 #ifdef ALLOW_NONHYDROSTATIC
                0042 C !LOCAL VARIABLES: ====================================================
                0043 C  i,j                  :: loop indices
                0044       INTEGER i,j
                0045 CEOP
                0046 
8ecb2a8ef1 Jean*0047       IF ( k.GT.1 .AND. k.LE.Nr ) THEN
6780674bfd Jean*0048         DO j=1-Olx,sNy+Oly-1
                0049          DO i=1-Olx,sNx+Olx-1
8ecb2a8ef1 Jean*0050            wMetricTerms(i,j) = -gravitySign*wUnit2rVel(k)
eaba2fd266 Jean*0051      &      *recip_rSphere*recip_deepFacF(k)*(
6780674bfd Jean*0052      &          ( (uFld( i ,j,k-1,bi,bj)*uFld( i ,j,k-1,bi,bj)
                0053      &            +uFld(i+1,j,k-1,bi,bj)*uFld(i+1,j,k-1,bi,bj))
                0054      &          + (vFld(i, j ,k-1,bi,bj)*vFld(i, j ,k-1,bi,bj)
                0055      &            +vFld(i,j+1,k-1,bi,bj)*vFld(i,j+1,k-1,bi,bj))
                0056      &          )
                0057      &        + ( (uFld( i ,j, k ,bi,bj)*uFld( i ,j, k ,bi,bj)
                0058      &            +uFld(i+1,j, k ,bi,bj)*uFld(i+1,j, k ,bi,bj))
                0059      &          + (vFld(i, j , k ,bi,bj)*vFld(i, j , k ,bi,bj)
                0060      &            +vFld(i,j+1, k ,bi,bj)*vFld(i,j+1, k ,bi,bj))
eaba2fd266 Jean*0061      &          )                            )*0.25 _d 0
6780674bfd Jean*0062          ENDDO
                0063         ENDDO
                0064       ELSE
                0065         DO j=1-Olx,sNy+Oly-1
                0066          DO i=1-Olx,sNx+Olx-1
                0067            wMetricTerms(i,j) = 0. _d 0
                0068          ENDDO
                0069         ENDDO
                0070       ENDIF
                0071 
                0072 #endif /* ALLOW_NONHYDROSTATIC */
                0073 
                0074       RETURN
                0075       END