/[MITgcm]/MITgcm/pkg/seaice/seaice_calc_strainrates.F
ViewVC logotype

Diff of /MITgcm/pkg/seaice/seaice_calc_strainrates.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.22 by mlosch, Fri May 26 09:08:32 2017 UTC revision 1.23 by mlosch, Thu Jun 8 15:10:05 2017 UTC
# Line 75  C     i,j,bi,bj :: Loop counters Line 75  C     i,j,bi,bj :: Loop counters
75  C     hFacU, hFacV :: determine the no-slip boundary condition  C     hFacU, hFacV :: determine the no-slip boundary condition
76        INTEGER k        INTEGER k
77        _RS hFacU, hFacV, noSlipFac        _RS hFacU, hFacV, noSlipFac
78          _RL third
79          PARAMETER ( third = 0.333333333333333333333333333 _d 0 )
80  C     auxillary variables that help writing code that  C     auxillary variables that help writing code that
81  C     vectorizes even after TAFization  C     vectorizes even after TAFization
82        _RL dudx (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL dudx (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
# Line 165  c$$$     &         - hFacV * k1AtZ(i,j,b Line 167  c$$$     &         - hFacV * k1AtZ(i,j,b
167  c$$$     &         - hFacU * k2AtZ(i,j,bi,bj) * uave(i,j)  c$$$     &         - hFacU * k2AtZ(i,j,bi,bj) * uave(i,j)
168           ENDDO           ENDDO
169          ENDDO          ENDDO
170            IF ( SEAICE_no_slip .AND. SEAICE_2ndOrderBC ) THEN
171             DO j=1-OLy+2,sNy+OLy-1
172              DO i=1-OLx+2,sNx+OLx-1
173               hFacU = (_maskW(i,j,k,bi,bj) - _maskW(i,j-1,k,bi,bj))*third
174               hFacV = (_maskS(i,j,k,bi,bj) - _maskS(i-1,j,k,bi,bj))*third
175               hFacU = hFacU*( _maskW(i,j-2,k,bi,bj)*_maskW(i,j-1,k,bi,bj)
176         &                   + _maskW(i,j+1,k,bi,bj)*_maskW(i,j,  k,bi,bj) )
177               hFacV = hFacV*( _maskS(i-2,j,k,bi,bj)*_maskS(i-1,j,k,bi,bj)
178         &                   + _maskS(i+1,j,k,bi,bj)*_maskS(i  ,j,k,bi,bj) )
179    C     right hand sided dv/dx = (9*v(i,j)-v(i+1,j))/(4*dxv(i,j)-dxv(i+1,j))
180    C     according to a Taylor expansion to 2nd order. We assume that dxv
181    C     varies very slowly, so that the denominator simplifies to 3*dxv(i,j),
182    C     then dv/dx = (6*v(i,j)+3*v(i,j)-v(i+1,j))/(3*dxv(i,j))
183    C                = 2*v(i,j)/dxv(i,j) + (3*v(i,j)-v(i+1,j))/(3*dxv(i,j))
184    C     the left hand sided dv/dx is analogously
185    C                = - 2*v(i-1,j)/dxv(i,j) - (3*v(i-1,j)-v(i-2,j))/(3*dxv(i,j))
186    C     the first term is the first order part, which is already added.
187    C     For e12 we only need 0.5 of this gradient and vave = is either
188    C     0.5*v(i,j) or 0.5*v(i-1,j) near the boundary so that we need an
189    C     extra factor of 2. This explains the six. du/dy is analogous.
190    C     The masking is ugly, but hopefully effective.
191               e12Loc(i,j,bi,bj) = e12Loc(i,j,bi,bj) + 0.5 _d 0 * (
192         &            _recip_dyU(i,j,bi,bj) * ( 6.0 _d 0 * uave(i,j)
193         &          - uFld(i,j-2,bi,bj)*_maskW(i,j-1,k,bi,bj)
194         &          - uFld(i,j+1,bi,bj)*_maskW(i,j  ,k,bi,bj) ) * hFacU
195         &          + _recip_dxV(i,j,bi,bj) * ( 6.0 _d 0 * vave(i,j)
196         &          - vFld(i-2,j,bi,bj)*_maskS(i-1,j,k,bi,bj)
197         &          - vFld(i+1,j,bi,bj)*_maskS(i  ,j,k,bi,bj) ) * hFacV
198         &          )
199              ENDDO
200             ENDDO
201            ENDIF
202         ENDDO         ENDDO
203        ENDDO        ENDDO
204    

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.22