54 |
_RL flx_EW(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL flx_EW(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
55 |
_RL flx_Dn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL flx_Dn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
56 |
_RL flx_Up(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL flx_Up(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
57 |
|
_RL fZon(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
58 |
|
_RL fMer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
59 |
|
_RL del2w(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
60 |
C I,J,K - Loop counters |
C I,J,K - Loop counters |
61 |
INTEGER i,j,k, kP1, kUp |
INTEGER i,j,k, kP1, kUp |
62 |
_RL wOverride |
_RL wOverride |
63 |
_RS hFacWtmp |
_RS hFacWtmp |
64 |
_RS hFacStmp |
_RS hFacStmp |
65 |
|
_RS hFacCtmp |
66 |
|
_RS recip_hFacCtmp |
67 |
_RL ab15,ab05 |
_RL ab15,ab05 |
68 |
_RL slipSideFac |
_RL slipSideFac |
69 |
_RL tmp_VbarZ, tmp_UbarZ, tmp_WbarZ |
_RL tmp_VbarZ, tmp_UbarZ, tmp_WbarZ |
89 |
ELSE |
ELSE |
90 |
slipSideFac = 1. _d 0 |
slipSideFac = 1. _d 0 |
91 |
ENDIF |
ENDIF |
92 |
CML half slip was used before ; keep it for now, but half slip is |
CML half slip was used before ; keep the line for now, but half slip is |
93 |
CML not used anywhere in the code as far as I can see |
CML not used anywhere in the code as far as I can see. |
94 |
C slipSideFac = 0. _d 0 |
C slipSideFac = 0. _d 0 |
95 |
|
|
96 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
128 |
Kp1=Nr |
Kp1=Nr |
129 |
wOverRide=0. |
wOverRide=0. |
130 |
endif |
endif |
131 |
|
C horizontal bi-harmonic dissipation |
132 |
|
IF (momViscosity .AND. viscA4W.NE.0. ) THEN |
133 |
|
C calculate the horizontal Laplacian of vertical flow |
134 |
|
C Zonal flux d/dx W |
135 |
|
DO j=1-Oly,sNy+Oly |
136 |
|
fZon(1-Olx,j)=0. |
137 |
|
DO i=1-Olx+1,sNx+Olx |
138 |
|
fZon(i,j) = drF(k)*_hFacC(i,j,k,bi,bj) |
139 |
|
& *_dyG(i,j,bi,bj) |
140 |
|
& *_recip_dxC(i,j,bi,bj) |
141 |
|
& *(wVel(i,j,k,bi,bj)-wVel(i-1,j,k,bi,bj)) |
142 |
|
#ifdef COSINEMETH_III |
143 |
|
& *sqcosFacU(J,bi,bj) |
144 |
|
#endif |
145 |
|
ENDDO |
146 |
|
ENDDO |
147 |
|
C Meridional flux d/dy W |
148 |
|
DO i=1-Olx,sNx+Olx |
149 |
|
fMer(I,1-Oly)=0. |
150 |
|
ENDDO |
151 |
|
DO j=1-Oly+1,sNy+Oly |
152 |
|
DO i=1-Olx,sNx+Olx |
153 |
|
fMer(i,j) = drF(k)*_hFacC(i,j,k,bi,bj) |
154 |
|
& *_dxG(i,j,bi,bj) |
155 |
|
& *_recip_dyC(i,j,bi,bj) |
156 |
|
& *(wVel(i,j,k,bi,bj)-wVel(i,j-1,k,bi,bj)) |
157 |
|
#ifdef ISOTROPIC_COS_SCALING |
158 |
|
#ifdef COSINEMETH_III |
159 |
|
& *sqCosFacV(j,bi,bj) |
160 |
|
#endif |
161 |
|
#endif |
162 |
|
ENDDO |
163 |
|
ENDDO |
164 |
|
|
165 |
|
C del^2 W |
166 |
|
C Difference of zonal fluxes ... |
167 |
|
DO j=1-Oly,sNy+Oly |
168 |
|
DO i=1-Olx,sNx+Olx-1 |
169 |
|
del2w(i,j)=fZon(i+1,j)-fZon(i,j) |
170 |
|
ENDDO |
171 |
|
del2w(sNx+Olx,j)=0. |
172 |
|
ENDDO |
173 |
|
|
174 |
|
C ... add difference of meridional fluxes and divide by volume |
175 |
|
DO j=1-Oly,sNy+Oly-1 |
176 |
|
DO i=1-Olx,sNx+Olx |
177 |
|
C First compute the fraction of open water for the w-control volume |
178 |
|
C at the southern face |
179 |
|
hFacCtmp=max(hFacC(I,J,K-1,bi,bj)-Half,0. _d 0) |
180 |
|
& + min(hFacC(I,J,K ,bi,bj),Half) |
181 |
|
recip_hFacCtmp = 0. _d 0 |
182 |
|
IF (hFacCtmp .GT. 0.) THEN |
183 |
|
recip_hFacCtmp = 1./hFacCtmp |
184 |
|
ELSE |
185 |
|
recip_hFacCtmp = 0. _d 0 |
186 |
|
ENDIF |
187 |
|
del2w(i,j)=recip_rA(i,j,bi,bj) |
188 |
|
& *recip_drC(k)*recip_hFacCtmp |
189 |
|
& *( |
190 |
|
& del2w(i,j) |
191 |
|
& +( fMer(i,j+1)-fMer(i,j) ) |
192 |
|
& ) |
193 |
|
ENDDO |
194 |
|
ENDDO |
195 |
|
C-- No-slip BCs impose a drag at walls... |
196 |
|
CML ************************************************************ |
197 |
|
CML No-slip Boundary conditions for bi-harmonic dissipation |
198 |
|
CML need to be implemented here! |
199 |
|
CML ************************************************************ |
200 |
|
ENDIF |
201 |
|
|
202 |
C Flux on Southern face |
C Flux on Southern face |
203 |
DO J=jMin,jMax+1 |
DO J=jMin,jMax+1 |
204 |
DO I=iMin,iMax |
DO I=iMin,iMax |
215 |
& *(hFacStmp*(wVel(I,J,K,bi,bj)-wVel(I,J-1,K,bi,bj)) |
& *(hFacStmp*(wVel(I,J,K,bi,bj)-wVel(I,J-1,K,bi,bj)) |
216 |
& +(1. _d 0 - hFacStmp)*(1. _d 0 - slipSideFac) |
& +(1. _d 0 - hFacStmp)*(1. _d 0 - slipSideFac) |
217 |
& *wVel(I,J,K,bi,bj)) |
& *wVel(I,J,K,bi,bj)) |
218 |
|
& +viscA4W*_recip_dyC(I,J,bi,bj)*(del2w(I,J)-del2w(I,J-1)) |
219 |
|
#ifdef ISOTROPIC_COS_SCALING |
220 |
|
#ifdef COSINEMETH_III |
221 |
|
& *sqCosFacV(j,bi,bj) |
222 |
|
#else |
223 |
|
& *CosFacV(j,bi,bj) |
224 |
|
#endif |
225 |
|
#endif |
226 |
C The last term is the weighted average of the viscous stress at the open |
C The last term is the weighted average of the viscous stress at the open |
227 |
C fraction of the w control volume and at the closed fraction of the |
C fraction of the w control volume and at the closed fraction of the |
228 |
C the control volume. A more compact but less intelligible version |
C the control volume. A more compact but less intelligible version |
247 |
& *(hFacWtmp*(wVel(I,J,K,bi,bj)-wVel(I-1,J,K,bi,bj)) |
& *(hFacWtmp*(wVel(I,J,K,bi,bj)-wVel(I-1,J,K,bi,bj)) |
248 |
& +(1 _d 0 - hFacWtmp)*(1 _d 0 - slipSideFac) |
& +(1 _d 0 - hFacWtmp)*(1 _d 0 - slipSideFac) |
249 |
& *wVel(I,J,K,bi,bj) ) |
& *wVel(I,J,K,bi,bj) ) |
250 |
|
& +viscA4W*_recip_dxC(I,J,bi,bj)*(del2w(I,J)-del2w(I-1,J)) |
251 |
|
#ifdef COSINEMETH_III |
252 |
|
& *sqCosFacU(j,bi,bj) |
253 |
|
#else |
254 |
|
& *CosFacU(j,bi,bj) |
255 |
|
#endif |
256 |
C The last term is the weighted average of the viscous stress at the open |
C The last term is the weighted average of the viscous stress at the open |
257 |
C fraction of the w control volume and at the closed fraction of the |
C fraction of the w control volume and at the closed fraction of the |
258 |
C the control volume. A more compact but less intelligible version |
C the control volume. A more compact but less intelligible version |