/[MITgcm]/MITgcm/pkg/gmredi/gmredi_calc_tensor.F
ViewVC logotype

Diff of /MITgcm/pkg/gmredi/gmredi_calc_tensor.F

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

revision 1.7 by heimbach, Tue Aug 21 15:27:19 2001 UTC revision 1.8 by jmc, Tue Dec 4 15:09:34 2001 UTC
# Line 40  C     == Local variables == Line 40  C     == Local variables ==
40        _RL SlopeX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL SlopeX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
41        _RL SlopeY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL SlopeY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
42        _RL dSigmaDrReal(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL dSigmaDrReal(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
43        _RL dRdSigmaLtd(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL SlopeSqr(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
44        _RL Ssq        _RL taperFct(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
45    
46  #ifdef GM_VISBECK_VARIABLE_K  #ifdef GM_VISBECK_VARIABLE_K
47        _RS deltaH,zero_rs        _RS deltaH,zero_rs
48        PARAMETER(zero_rs=0.)        PARAMETER(zero_rs=0.)
49        _RL N2,SN        _RL N2,SN
50          _RL Ssq
51  #endif  #endif
52    
53    
# Line 66  C     == Local variables == Line 67  C     == Local variables ==
67  C      Gradient of Sigma at rVel points  C      Gradient of Sigma at rVel points
68          SlopeX(i,j)=0.25*( sigmaX(i+1, j ,km1) +sigmaX(i,j,km1)          SlopeX(i,j)=0.25*( sigmaX(i+1, j ,km1) +sigmaX(i,j,km1)
69       &                    +sigmaX(i+1, j , k ) +sigmaX(i,j, k ) )       &                    +sigmaX(i+1, j , k ) +sigmaX(i,j, k ) )
70         &                  *maskC(i,j,k,bi,bj)
71          SlopeY(i,j)=0.25*( sigmaY( i ,j+1,km1) +sigmaY(i,j,km1)          SlopeY(i,j)=0.25*( sigmaY( i ,j+1,km1) +sigmaY(i,j,km1)
72       &                    +sigmaY( i ,j+1, k ) +sigmaY(i,j, k ) )       &                    +sigmaY( i ,j+1, k ) +sigmaY(i,j, k ) )
73         &                  *maskC(i,j,k,bi,bj)
74          dSigmaDrReal(i,j)=sigmaR(i,j,k)          dSigmaDrReal(i,j)=sigmaR(i,j,k)
75    
         if (hFacC(i,j,k,bi,bj).eq.0.) then  
          SlopeX(i,j)=0.  
          SlopeY(i,j)=0.  
         endif  
   
76         ENDDO         ENDDO
77        ENDDO        ENDDO
78    
# Line 83  C     Calculate slopes for use in tensor Line 81  C     Calculate slopes for use in tensor
81       I             dSigmadRReal,       I             dSigmadRReal,
82       I             rF(K),       I             rF(K),
83       U             SlopeX, SlopeY,       U             SlopeX, SlopeY,
84       O             dRdSigmaLtd,       O             SlopeSqr, taperFct,
85       I             bi, bj, myThid )       I             bi, bj, myThid )
86    
87        DO j=1-Oly+1,sNy+Oly-1        DO j=1-Oly+1,sNy+Oly-1
88         DO i=1-Olx+1,sNx+Olx-1         DO i=1-Olx+1,sNx+Olx-1
89    
90  C       Mask Iso-neutral slopes  C       Mask Iso-neutral slopes
91          if (hFacC(i,j,k,bi,bj).eq.0.) then          SlopeX(i,j)=SlopeX(i,j)*maskC(i,j,k,bi,bj)
92           SlopeX(i,j)=0.          SlopeY(i,j)=SlopeY(i,j)*maskC(i,j,k,bi,bj)
93           SlopeY(i,j)=0.          SlopeSqr(i,j)=SlopeSqr(i,j)*maskC(i,j,k,bi,bj)
94          endif  c       Ssq=SlopeX(i,j)*SlopeX(i,j)+SlopeY(i,j)*SlopeY(i,j)
         Ssq=SlopeX(i,j)*SlopeX(i,j)+SlopeY(i,j)*SlopeY(i,j)  
95    
96  C       Components of Redi/GM tensor  C       Components of Redi/GM tensor
97          Kwx(i,j,k,bi,bj)=2.*SlopeX(i,j)          Kwx(i,j,k,bi,bj)=2.*SlopeX(i,j)*taperFct(i,j)
98          Kwy(i,j,k,bi,bj)=2.*SlopeY(i,j)          Kwy(i,j,k,bi,bj)=2.*SlopeY(i,j)*taperFct(i,j)
99          Kwz(i,j,k,bi,bj)=Ssq          Kwz(i,j,k,bi,bj)= SlopeSqr(i,j)*taperFct(i,j)
100    
101  #ifdef GM_VISBECK_VARIABLE_K  #ifdef GM_VISBECK_VARIABLE_K
102    
103    C- note (jmc) : moved here since only used in VISBECK_VARIABLE_K
104    C           but don't know if *taperFct (or **2 ?) is necessary
105            Ssq=SlopeSqr(i,j)*taperFct(i,j)
106    
107  C--     Depth average of M^2/N^2 * N  C--     Depth average of M^2/N^2 * N
108    
109  C       Calculate terms for mean Richardson number  C       Calculate terms for mean Richardson number
# Line 115  C       If negative then we are below th Line 117  C       If negative then we are below th
117  C       Now we convert deltaH to a non-dimensional fraction  C       Now we convert deltaH to a non-dimensional fraction
118          deltaH=deltaH/GM_Visbeck_depth          deltaH=deltaH/GM_Visbeck_depth
119    
120          if (K.eq.2) VisbeckK(i,j,bi,bj)=0.          IF (K.eq.2) VisbeckK(i,j,bi,bj)=0.
121  Calt?   if (dSigmaDrReal(i,j).NE.0.) then          IF (Ssq.NE.0.) THEN
122  Calt?    N2=(-Gravity*recip_Rhonil)*dSigmaDrReal(i,j)           N2= -Gravity*recip_Rhonil*dSigmaDrReal(i,j)
         if ( dRdSigmaLtd(i,j).NE.0. .AND. Ssq.NE.0. ) then  
          N2=(-Gravity*recip_Rhonil)/dRdSigmaLtd(i,j)  
123           SN=sqrt(Ssq*N2)           SN=sqrt(Ssq*N2)
124           VisbeckK(i,j,bi,bj)=VisbeckK(i,j,bi,bj)+deltaH           VisbeckK(i,j,bi,bj)=VisbeckK(i,j,bi,bj)+deltaH
125       &      *GM_Visbeck_alpha*GM_Visbeck_length*GM_Visbeck_length*SN       &      *GM_Visbeck_alpha*GM_Visbeck_length*GM_Visbeck_length*SN
126          endif          ENDIF
127    
128  C       Limit range that KapGM can take  C       Limit range that KapGM can take
129          VisbeckK(i,j,bi,bj)=          VisbeckK(i,j,bi,bj)=
# Line 174  C     Calculate slopes for use in tensor Line 174  C     Calculate slopes for use in tensor
174       I             dSigmadRReal,       I             dSigmadRReal,
175       I             rF(K),       I             rF(K),
176       U             SlopeX, SlopeY,       U             SlopeX, SlopeY,
177       O             dRdSigmaLtd,       O             SlopeSqr, taperFct,
178       I             bi, bj, myThid )       I             bi, bj, myThid )
179    
180        DO j=1-Oly+1,sNy+Oly-1        DO j=1-Oly+1,sNy+Oly-1
181         DO i=1-Olx+1,sNx+Olx-1         DO i=1-Olx+1,sNx+Olx-1
182          Kux(i,j,k,bi,bj)=(dSigmaDrReal(i,j)*dRdSigmaLtd(i,j))**2          Kux(i,j,k,bi,bj)=taperFct(i,j)
183         ENDDO         ENDDO
184        ENDDO        ENDDO
185    
# Line 202  C     Calculate slopes for use in tensor Line 202  C     Calculate slopes for use in tensor
202       I             dSigmadRReal,       I             dSigmadRReal,
203       I             rF(K),       I             rF(K),
204       U             SlopeX, SlopeY,       U             SlopeX, SlopeY,
205       O             dRdSigmaLtd,       O             SlopeSqr, taperFct,
206       I             bi, bj, myThid )       I             bi, bj, myThid )
207    
208        DO j=1-Oly+1,sNy+Oly-1        DO j=1-Oly+1,sNy+Oly-1
209         DO i=1-Olx+1,sNx+Olx-1         DO i=1-Olx+1,sNx+Olx-1
210          Kvy(i,j,k,bi,bj)=(dSigmaDrReal(i,j)*dRdSigmaLtd(i,j))**2          Kvy(i,j,k,bi,bj)=taperFct(i,j)
211         ENDDO         ENDDO
212        ENDDO        ENDDO
213    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.22