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 |
|
|
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 |
|
|
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 |
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)= |
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 |
|
|
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 |
|
|