/[MITgcm]/MITgcm/pkg/mom_vecinv/mom_vi_u_coriolis.F
ViewVC logotype

Diff of /MITgcm/pkg/mom_vecinv/mom_vi_u_coriolis.F

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

revision 1.12 by jmc, Wed Apr 2 21:18:45 2008 UTC revision 1.13 by jmc, Mon May 5 22:45:00 2008 UTC
# Line 47  C     msgBuf :: Informational/error mees Line 47  C     msgBuf :: Informational/error mees
47        INTEGER i, j        INTEGER i, j
48        _RL     vBarXY, vBarXm, vBarXp        _RL     vBarXY, vBarXm, vBarXp
49        _RL     vort3u        _RL     vort3u
50          _RL     vort3mj, vort3ij, vort3mp, vort3ip
51          _RL     oneThird, tmpFac
52        _RS     epsil        _RS     epsil
53        PARAMETER( upwindVort3 = .FALSE. )        PARAMETER( upwindVort3 = .FALSE. )
54    
55        epsil = 1. _d -9        epsil = 1. _d -9
56          tmpFac = 1. _d 0
57    c     oneThird = 1. _d 0 / ( 1. _d 0 + 2.*tmpFac )
58          oneThird = 1. _d 0 / 3. _d 0
59    
60        IF ( selectVortScheme.EQ.0 ) THEN        IF ( selectVortScheme.EQ.0 ) THEN
61  C--   using enstrophy conserving scheme (Shallow-Water Eq.) by Sadourny, JAS 75  C--   using enstrophy conserving scheme (Shallow-Water Eq.) by Sadourny, JAS 75
# Line 81  C--   using enstrophy conserving scheme Line 86  C--   using enstrophy conserving scheme
86        ELSEIF ( selectVortScheme.EQ.1 ) THEN        ELSEIF ( selectVortScheme.EQ.1 ) THEN
87  C--   same as above, with different formulation (relatively to hFac)  C--   same as above, with different formulation (relatively to hFac)
88    
89         DO J=1-Oly,sNy+Oly-1         DO j=1-Oly,sNy+Oly-1
90          DO i=2-Olx,sNx+Olx          DO i=2-Olx,sNx+Olx
91           vBarXY= 0.5*(           vBarXY= 0.5*(
92       &      (vFld( i , j )*dxG( i , j ,bi,bj)*hFacZ(i, j )       &      (vFld( i , j )*dxG( i , j ,bi,bj)*hFacZ(i, j )
# Line 130  C--   using energy conserving scheme (us Line 135  C--   using energy conserving scheme (us
135          ENDDO          ENDDO
136         ENDDO         ENDDO
137    
138          ELSEIF ( selectVortScheme.EQ.3 ) THEN
139    C--   using energy & enstrophy conserving scheme
140    C     (from Sadourny, described by Burridge & Haseler, ECMWF Rep.4, 1977)
141    
142    C     domain where uCoriolisTerm is valid :
143    C     [ 3-Olx : sNx+Olx-1 ] x [ 2-Oly : sNy+Oly-1 ]
144    C     (=> might need overlap of 3 if using CD-scheme)
145           DO j=1-Oly,sNy+Oly-1
146            DO i=2-Olx,sNx+Olx-1
147             vort3mj= ( r_hFacZ(i, j )*omega3(i, j )
148         &            +(r_hFacZ(i,j+1)*omega3(i,j+1)
149         &             +r_hFacZ(i-1,j)*omega3(i-1,j)
150         &            ))*oneThird
151    c    &            )*tmpFac)*oneThird
152         &      *vFld(i-1, j )*dxG(i-1, j ,bi,bj)*_hFacS(i-1, j ,k,bi,bj)
153             vort3ij= ( r_hFacZ(i, j )*omega3(i, j )
154         &            +(r_hFacZ(i,j+1)*omega3(i,j+1)
155         &             +r_hFacZ(i+1,j)*omega3(i+1,j)
156         &            ))*oneThird
157    c    &            )*tmpFac)*oneThird
158         &      *vFld( i , j )*dxG( i , j ,bi,bj)*_hFacS( i , j ,k,bi,bj)
159             vort3mp= ( r_hFacZ(i,j+1)*omega3(i,j+1)
160         &            +(r_hFacZ(i, j )*omega3(i, j )
161         &             +r_hFacZ(i-1,j+1)*omega3(i-1,j+1)
162         &            ))*oneThird
163    c    &            )*tmpFac)*oneThird
164         &      *vFld(i-1,j+1)*dxG(i-1,j+1,bi,bj)*_hFacS(i-1,j+1,k,bi,bj)
165             vort3ip= ( r_hFacZ(i,j+1)*omega3(i,j+1)
166         &            +(r_hFacZ(i, j )*omega3(i, j )
167         &             +r_hFacZ(i+1,j+1)*omega3(i+1,j+1)
168         &            ))*oneThird
169    c    &            )*tmpFac)*oneThird
170         &      *vFld( i ,j+1)*dxG( i ,j+1,bi,bj)*_hFacS( i ,j+1,k,bi,bj)
171    C---
172             uCoriolisTerm(i,j)= +( (vort3mj+vort3ij)+(vort3mp+vort3ip) )
173         &                     *0.25 _d 0 *recip_dxC(i,j,bi,bj)
174         &                                * _maskW(i,j,k,bi,bj)
175            ENDDO
176           ENDDO
177    
178        ELSE        ELSE
179          WRITE(msgBuf,'(A,I5,A)')          WRITE(msgBuf,'(A,I5,A)')
180       &   'MOM_VI_U_CORIOLIS: selectVortScheme=', selectVortScheme,       &   'MOM_VI_U_CORIOLIS: selectVortScheme=', selectVortScheme,
# Line 141  C--   using energy conserving scheme (us Line 186  C--   using energy conserving scheme (us
186    
187        IF ( useJamartMomAdv ) THEN        IF ( useJamartMomAdv ) THEN
188         DO j=1-Oly,sNy+Oly-1         DO j=1-Oly,sNy+Oly-1
189          DO i=2-Olx,sNx+Olx          DO i=2-Olx,sNx+Olx-1
190           uCoriolisTerm(i,j) = uCoriolisTerm(i,j)           uCoriolisTerm(i,j) = uCoriolisTerm(i,j)
191       &           * 4. _d 0 * _hFacW(i,j,k,bi,bj)       &           * 4. _d 0 * _hFacW(i,j,k,bi,bj)
192       &           / MAX( epsil,       &           / MAX( epsil,

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.22