/[MITgcm]/MITgcm/model/src/calc_gw.F
ViewVC logotype

Diff of /MITgcm/model/src/calc_gw.F

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

revision 1.14 by mlosch, Wed May 19 08:42:00 2004 UTC revision 1.15 by mlosch, Tue May 25 07:48:22 2004 UTC
# Line 57  C     flx_Dn       :: Temp. used for fVo Line 57  C     flx_Dn       :: Temp. used for fVo
57  C     I,J,K - Loop counters  C     I,J,K - Loop counters
58        INTEGER i,j,k, kP1, kUp        INTEGER i,j,k, kP1, kUp
59        _RL  wOverride        _RL  wOverride
60        _RS  hFacROpen        _RS  hFacWtmp
61        _RS  hFacRClosed        _RS  hFacStmp
62        _RL ab15,ab05        _RL ab15,ab05
63        _RL slipSideFac        _RL slipSideFac
64        _RL tmp_VbarZ, tmp_UbarZ, tmp_WbarZ        _RL tmp_VbarZ, tmp_UbarZ, tmp_WbarZ
65    
66        _RL  Half        _RL  Half
       _RL  One  
67        PARAMETER(Half=0.5D0)        PARAMETER(Half=0.5D0)
       PARAMETER(One=0.5D0)  
68  CEOP  CEOP
69    
70  ceh3 needs an IF ( useNONHYDROSTATIC ) THEN  ceh3 needs an IF ( useNONHYDROSTATIC ) THEN
# Line 82  C     Adams-Bashforth timestepping weigh Line 80  C     Adams-Bashforth timestepping weigh
80    
81  C     Lateral friction (no-slip, free slip, or half slip):  C     Lateral friction (no-slip, free slip, or half slip):
82        IF ( no_slip_sides ) THEN        IF ( no_slip_sides ) THEN
83          slipSideFac = -One          slipSideFac = -1. _d 0
84        ELSE        ELSE
85          slipSideFac =  One          slipSideFac =  1. _d 0
86        ENDIF        ENDIF
87  C-    half slip was used before ; keep it for now.  CML   half slip was used before ; keep it for now, but half slip is
88    CML   not used anywhere in the code as far as I can see
89  C        slipSideFac = 0. _d 0  C        slipSideFac = 0. _d 0
90    
91        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
# Line 127  C Sweep down column Line 126  C Sweep down column
126  C Flux on Southern face  C Flux on Southern face
127           DO J=jMin,jMax+1           DO J=jMin,jMax+1
128            DO I=iMin,iMax            DO I=iMin,iMax
129    C     First compute the fraction of open water for the w-control volume
130    C     at the southern face
131               hFacStmp=max(hFacS(I,J,K-1,bi,bj)-Half,0)
132         &         +    min(hFacS(I,J,K  ,bi,bj),Half)
133             tmp_VbarZ=Half*(             tmp_VbarZ=Half*(
134       &          _hFacS(I,J,K-1,bi,bj)*vVel( I ,J,K-1,bi,bj)       &          _hFacS(I,J,K-1,bi,bj)*vVel( I ,J,K-1,bi,bj)
135       &         +_hFacS(I,J, K ,bi,bj)*vVel( I ,J, K ,bi,bj))       &         +_hFacS(I,J, K ,bi,bj)*vVel( I ,J, K ,bi,bj))
136             Flx_NS(I,J,bi,bj)=             Flx_NS(I,J,bi,bj)=
137       &     tmp_VbarZ*Half*(wVel(I,J,K,bi,bj)+wVel(I,J-1,K,bi,bj))       &     tmp_VbarZ*Half*(wVel(I,J,K,bi,bj)+wVel(I,J-1,K,bi,bj))
138       &    -viscAh*_recip_dyC(I,J,bi,bj)         &    -viscAh*_recip_dyC(I,J,bi,bj)  
139       &      *(1. _d 0 + slipSideFac*       &       *(hFacStmp*(wVel(I,J,K,bi,bj)-wVel(I,J-1,K,bi,bj))
140       &         (maskS(I,J,K-1,bi,bj)*maskS(I,J,K,bi,bj)-2. _d 0))       &        +(1. _d 0 - hFacStmp)*(1. _d 0 - slipSideFac)
141       &        *(max(hFacS(I,J,K-1,bi,bj)-Half,0)       &         *wVel(I,J,K,bi,bj))
142       &         +min(hFacS(I,J,K,bi,bj),Half))  C     The last term is the weighted average of the viscous stress at the open
143       &                   *(wVel(I,J,K,bi,bj)-wVel(I,J-1,K,bi,bj))  C     fraction of the w control volume and at the closed fraction of the
144    C     the control volume. A more compact but less intelligible version
145    C     of the last three lines is:
146    CML     &       *( (1 _d 0 - slipSideFac*(1 _d 0 - hFacStmp))
147    CML     &       *wVel(I,J,K,bi,bi) + hFacStmp*wVel(I,J-1,K,bi,bj) )
148            ENDDO            ENDDO
149           ENDDO           ENDDO
150  C Flux on Western face  C Flux on Western face
151           DO J=jMin,jMax           DO J=jMin,jMax
152            DO I=iMin,iMax+1            DO I=iMin,iMax+1
153             tmp_UbarZ=Half*(  C     First compute the fraction of open water for the w-control volume
154    C     at the western face
155               hFacWtmp=max(hFacW(I,J,K-1,bi,bj)-Half,0)
156         &         +    min(hFacW(I,J,K  ,bi,bj),Half)
157                     tmp_UbarZ=Half*(
158       &         _hFacW(I,J,K-1,bi,bj)*uVel( I ,J,K-1,bi,bj)       &         _hFacW(I,J,K-1,bi,bj)*uVel( I ,J,K-1,bi,bj)
159       &        +_hFacW(I,J, K ,bi,bj)*uVel( I ,J, K ,bi,bj))       &        +_hFacW(I,J, K ,bi,bj)*uVel( I ,J, K ,bi,bj))
160             Flx_EW(I,J,bi,bj)=             Flx_EW(I,J,bi,bj)=
161       &     tmp_UbarZ*Half*(wVel(I,J,K,bi,bj)+wVel(I-1,J,K,bi,bj))       &     tmp_UbarZ*Half*(wVel(I,J,K,bi,bj)+wVel(I-1,J,K,bi,bj))
162       &    -viscAh*_recip_dxC(I,J,bi,bj)       &    -viscAh*_recip_dxC(I,J,bi,bj)
163       &      *(1. _d 0 + slipSideFac*       &      *(hFacWtmp*(wVel(I,J,K,bi,bj)-wVel(I-1,J,K,bi,bj))
164       &         (maskW(I,J,K-1,bi,bj)*maskW(I,J,K,bi,bj)-1. _d 0))       &       +(1 _d 0 - hFacWtmp)*(1 _d 0 - slipSideFac)
165       &        *(max(hFacW(I,J,K-1,bi,bj)-Half,0)       &        *wVel(I,J,K,bi,bj) )
166       &         +min(hFacW(I,J,K,bi,bj),Half))  C     The last term is the weighted average of the viscous stress at the open
167       &                   *(wVel(I,J,K,bi,bj)-wVel(I-1,J,K,bi,bj))  C     fraction of the w control volume and at the closed fraction of the
168    C     the control volume. A more compact but less intelligible version
169    C     of the last three lines is:
170    CML     &       *( (1 _d 0 - slipSideFac*(1 _d 0 - hFacWtmp))
171    CML     &       *wVel(I,J,K,bi,bi) + hFacWtmp*wVel(I-1,J,K,bi,bj) )
172            ENDDO            ENDDO
173           ENDDO           ENDDO
174  C Flux on Lower face  C Flux on Lower face

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22