Back to home page

MITgcm

 
 

    


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

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
9c05b3873e Alis*0001 #include "MOM_COMMON_OPTIONS.h"
07cc642809 Alis*0002 
cf8506b548 Alis*0003 CBOP
                0004 C !ROUTINE: MOM_CALC_STRAIN
                0005 
                0006 C !INTERFACE: ==========================================================
220a9e88b5 Jean*0007       SUBROUTINE MOM_CALC_STRAIN(
07cc642809 Alis*0008      I        bi,bj,k,
                0009      I        uFld, vFld, hFacZ,
                0010      O        strain,
220a9e88b5 Jean*0011      I        myThid )
07cc642809 Alis*0012 
cf8506b548 Alis*0013 C !DESCRIPTION:
                0014 C Calculates the strain of the horizontal flow field (at vorticity points):
                0015 C \begin{equation*}
                0016 C D_S = \frac{\Delta y_u}{\Delta x_v} \delta_i \frac{v}{\Delta y_c}
e6cc0c97e0 Alis*0017 C     + \frac{\Delta x_v}{\Delta y_u} \delta_j \frac{u}{\Delta x_c}
cf8506b548 Alis*0018 C \end{equation*}
                0019 C assuming free-slip boundaries.
                0020 
                0021 C !USES: ===============================================================
                0022       IMPLICIT NONE
07cc642809 Alis*0023 #include "SIZE.h"
                0024 #include "EEPARAMS.h"
                0025 #include "PARAMS.h"
                0026 #include "GRID.h"
cf8506b548 Alis*0027 
                0028 C !INPUT PARAMETERS: ===================================================
                0029 C  bi,bj                :: tile indices
                0030 C  k                    :: vertical level
                0031 C  uFld                 :: zonal flow
                0032 C  vFld                 :: meridional flow
                0033 C  hFacZ                :: open-water thickness at vorticity points
                0034 C  myThid               :: thread number
07cc642809 Alis*0035       INTEGER bi,bj,k
                0036       _RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0037       _RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0038       _RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0039       INTEGER myThid
                0040 
cf8506b548 Alis*0041 C !OUTPUT PARAMETERS: ==================================================
                0042 C  strain               :: strain of horizontal flow
                0043       _RL strain(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0044 
                0045 C !LOCAL VARIABLES: ====================================================
                0046 C  i,j                  :: loop indices
07cc642809 Alis*0047       INTEGER i,j
cf8506b548 Alis*0048 CEOP
07cc642809 Alis*0049 
220a9e88b5 Jean*0050       DO j=2-OLy,sNy+OLy
                0051        DO i=2-OLx,sNx+OLx
07cc642809 Alis*0052 
cf8506b548 Alis*0053 C       Strain of horizontal flow field (ignoring lopping factors)
220a9e88b5 Jean*0054         strain(i,j)=
                0055      &    ( dyC( i , j ,bi,bj)*vFld( i , j )
                0056      &     -dyC(i-1, j ,bi,bj)*vFld(i-1, j )
                0057      &     +dxC( i , j ,bi,bj)*uFld( i , j )
                0058      &     -dxC( i ,j-1,bi,bj)*uFld( i ,j-1)
                0059      &    )*recip_rAz(i,j,bi,bj)*recip_deepFacC(k)
                0060 c       strain(i,j)=
                0061 c    &    dyU(i,j,bi,bj)*recip_dxV(i,j,bi,bj)*(
                0062 c    &              vFld( i , j )*recip_dyC( i , j ,bi,bj)
                0063 c    &             -vFld(i-1, j )*recip_dyC(i-1, j ,bi,bj) )
                0064 c    &   +dxV(i,j,bi,bj)*recip_dyU(i,j,bi,bj)*(
                0065 c    &             +uFld( i , j )*recip_dxC( i , j ,bi,bj)
                0066 c    &             -uFld( i ,j-1)*recip_dxC( i ,j-1,bi,bj) )
07cc642809 Alis*0067 
cf8506b548 Alis*0068 C       Set strain to zero on boundaries (free-slip)
602b37a090 Jean*0069 C       mask is now applied afterwards, outside this S/R.
                0070 c       IF (hFacZ(i,j).EQ.0.) THEN
220a9e88b5 Jean*0071 c        strain(i,j)=0.
602b37a090 Jean*0072 c       ENDIF
07cc642809 Alis*0073 
                0074        ENDDO
                0075       ENDDO
220a9e88b5 Jean*0076 
07cc642809 Alis*0077 C     Special stuff for Cubed Sphere
                0078       IF (useCubedSphereExchange) THEN
7c7b0b4a46 Alis*0079 c      STOP 'S/R MOM_CALC_STRAIN: We should not use strain on the cube!'
07cc642809 Alis*0080       ENDIF
                0081 
                0082       RETURN
                0083       END