7 |
I bi,bj,iMin,iMax,jMin,jMax,k,kUp,kDown, |
I bi,bj,iMin,iMax,jMin,jMax,k,kUp,kDown, |
8 |
I dPhiHydX,dPhiHydY,KappaRU,KappaRV, |
I dPhiHydX,dPhiHydY,KappaRU,KappaRV, |
9 |
U fVerU, fVerV, |
U fVerU, fVerV, |
10 |
|
O guDiss, gvDiss, |
11 |
I myTime, myIter, myThid) |
I myTime, myIter, myThid) |
12 |
C /==========================================================\ |
C /==========================================================\ |
13 |
C | S/R MOM_VECINV | |
C | S/R MOM_VECINV | |
40 |
#endif |
#endif |
41 |
|
|
42 |
C == Routine arguments == |
C == Routine arguments == |
43 |
C fVerU - Flux of momentum in the vertical |
C fVerU :: Flux of momentum in the vertical direction, out of the upper |
44 |
C fVerV direction out of the upper face of a cell K |
C fVerV :: face of a cell K ( flux into the cell above ). |
|
C ( flux into the cell above ). |
|
45 |
C dPhiHydX,Y :: Gradient (X & Y dir.) of Hydrostatic Potential |
C dPhiHydX,Y :: Gradient (X & Y dir.) of Hydrostatic Potential |
46 |
|
C guDiss :: dissipation tendency (all explicit terms), u component |
47 |
|
C gvDiss :: dissipation tendency (all explicit terms), v component |
48 |
C bi, bj, iMin, iMax, jMin, jMax - Range of points for which calculation |
C bi, bj, iMin, iMax, jMin, jMax - Range of points for which calculation |
49 |
C results will be set. |
C results will be set. |
50 |
C kUp, kDown - Index for upper and lower layers. |
C kUp, kDown - Index for upper and lower layers. |
55 |
_RL KappaRV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL KappaRV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
56 |
_RL fVerU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
57 |
_RL fVerV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
58 |
|
_RL guDiss(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
59 |
|
_RL gvDiss(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
60 |
INTEGER kUp,kDown |
INTEGER kUp,kDown |
61 |
_RL myTime |
_RL myTime |
62 |
INTEGER myIter |
INTEGER myIter |
70 |
EXTERNAL DIFFERENT_MULTIPLE |
EXTERNAL DIFFERENT_MULTIPLE |
71 |
|
|
72 |
C == Local variables == |
C == Local variables == |
|
_RL aF (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
73 |
_RL vF (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vF (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
74 |
_RL vrF (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vrF (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
75 |
_RL uCf (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL uCf (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
76 |
_RL vCf (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vCf (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
77 |
_RL mT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
c _RL mT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
_RL pF (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
78 |
_RL del2u(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL del2u(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
79 |
_RL del2v(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL del2v(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
80 |
_RL tension(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL tension(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
81 |
_RL strain(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL strain(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
82 |
_RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
83 |
_RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
_RS xA(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
|
_RS yA(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
84 |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
85 |
_RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
86 |
_RL dStar(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL dStar(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
87 |
_RL zStar(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL zStar(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
_RL uDiss(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
|
_RL vDiss(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
88 |
C I,J,K - Loop counters |
C I,J,K - Loop counters |
89 |
INTEGER i,j,k |
INTEGER i,j,k |
|
C rVelMaskOverride - Factor for imposing special surface boundary conditions |
|
|
C ( set according to free-surface condition ). |
|
|
C hFacROpen - Lopped cell factos used tohold fraction of open |
|
|
C hFacRClosed and closed cell wall. |
|
|
_RL rVelMaskOverride |
|
90 |
C xxxFac - On-off tracer parameters used for switching terms off. |
C xxxFac - On-off tracer parameters used for switching terms off. |
|
_RL uDudxFac |
|
|
_RL AhDudxFac |
|
|
_RL A4DuxxdxFac |
|
|
_RL vDudyFac |
|
|
_RL AhDudyFac |
|
|
_RL A4DuyydyFac |
|
|
_RL rVelDudrFac |
|
91 |
_RL ArDudrFac |
_RL ArDudrFac |
|
_RL fuFac |
|
92 |
_RL phxFac |
_RL phxFac |
93 |
_RL mtFacU |
c _RL mtFacU |
|
_RL uDvdxFac |
|
|
_RL AhDvdxFac |
|
|
_RL A4DvxxdxFac |
|
|
_RL vDvdyFac |
|
|
_RL AhDvdyFac |
|
|
_RL A4DvyydyFac |
|
|
_RL rVelDvdrFac |
|
94 |
_RL ArDvdrFac |
_RL ArDvdrFac |
|
_RL fvFac |
|
95 |
_RL phyFac |
_RL phyFac |
96 |
_RL vForcFac |
c _RL mtFacV |
|
_RL mtFacV |
|
|
_RL wVelBottomOverride |
|
97 |
LOGICAL bottomDragTerms |
LOGICAL bottomDragTerms |
98 |
LOGICAL writeDiag |
LOGICAL writeDiag |
99 |
_RL KE(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL KE(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
114 |
fVerV(1,1,kUp) = fVerV(1,1,kUp) |
fVerV(1,1,kUp) = fVerV(1,1,kUp) |
115 |
#endif |
#endif |
116 |
|
|
|
rVelMaskOverride=1. |
|
|
IF ( k .EQ. 1 ) rVelMaskOverride=freeSurfFac |
|
|
wVelBottomOverride=1. |
|
|
IF (k.EQ.Nr) wVelBottomOverride=0. |
|
117 |
writeDiag = DIFFERENT_MULTIPLE(diagFreq, myTime, |
writeDiag = DIFFERENT_MULTIPLE(diagFreq, myTime, |
118 |
& myTime-deltaTClock) |
& myTime-deltaTClock) |
119 |
|
|
121 |
IF (useMNC .AND. snapshot_mnc .AND. writeDiag) THEN |
IF (useMNC .AND. snapshot_mnc .AND. writeDiag) THEN |
122 |
IF ((bi .EQ. 1).AND.(bj .EQ. 1).AND.(k .EQ. 1)) THEN |
IF ((bi .EQ. 1).AND.(bj .EQ. 1).AND.(k .EQ. 1)) THEN |
123 |
CALL MNC_CW_SET_UDIM('mom_vi', -1, myThid) |
CALL MNC_CW_SET_UDIM('mom_vi', -1, myThid) |
124 |
CALL MNC_CW_I_W_S('I','mom_vi',0,0,'iter',myIter,myThid) |
CALL MNC_CW_I_W_S('I','mom_vi',0,0,'T',myIter,myThid) |
125 |
CALL MNC_CW_SET_UDIM('mom_vi', 0, myThid) |
CALL MNC_CW_SET_UDIM('mom_vi', 0, myThid) |
126 |
ENDIF |
ENDIF |
127 |
DO i = 1,9 |
DO i = 1,9 |
135 |
C Initialise intermediate terms |
C Initialise intermediate terms |
136 |
DO J=1-OLy,sNy+OLy |
DO J=1-OLy,sNy+OLy |
137 |
DO I=1-OLx,sNx+OLx |
DO I=1-OLx,sNx+OLx |
138 |
aF(i,j) = 0. |
vF(i,j) = 0. |
139 |
vF(i,j) = 0. |
vrF(i,j) = 0. |
|
vrF(i,j) = 0. |
|
140 |
uCf(i,j) = 0. |
uCf(i,j) = 0. |
141 |
vCf(i,j) = 0. |
vCf(i,j) = 0. |
142 |
mT(i,j) = 0. |
c mT(i,j) = 0. |
|
pF(i,j) = 0. |
|
143 |
del2u(i,j) = 0. |
del2u(i,j) = 0. |
144 |
del2v(i,j) = 0. |
del2v(i,j) = 0. |
145 |
dStar(i,j) = 0. |
dStar(i,j) = 0. |
146 |
zStar(i,j) = 0. |
zStar(i,j) = 0. |
147 |
uDiss(i,j) = 0. |
guDiss(i,j)= 0. |
148 |
vDiss(i,j) = 0. |
gvDiss(i,j)= 0. |
149 |
vort3(i,j) = 0. |
vort3(i,j) = 0. |
150 |
omega3(i,j) = 0. |
omega3(i,j)= 0. |
151 |
ke(i,j) = 0. |
ke(i,j) = 0. |
152 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
153 |
strain(i,j) = 0. _d 0 |
strain(i,j) = 0. _d 0 |
154 |
tension(i,j) = 0. _d 0 |
tension(i,j) = 0. _d 0 |
158 |
|
|
159 |
C-- Term by term tracer parmeters |
C-- Term by term tracer parmeters |
160 |
C o U momentum equation |
C o U momentum equation |
|
uDudxFac = afFacMom*1. |
|
|
AhDudxFac = vfFacMom*1. |
|
|
A4DuxxdxFac = vfFacMom*1. |
|
|
vDudyFac = afFacMom*1. |
|
|
AhDudyFac = vfFacMom*1. |
|
|
A4DuyydyFac = vfFacMom*1. |
|
|
rVelDudrFac = afFacMom*1. |
|
161 |
ArDudrFac = vfFacMom*1. |
ArDudrFac = vfFacMom*1. |
162 |
mTFacU = mtFacMom*1. |
c mTFacU = mtFacMom*1. |
|
fuFac = cfFacMom*1. |
|
163 |
phxFac = pfFacMom*1. |
phxFac = pfFacMom*1. |
164 |
C o V momentum equation |
C o V momentum equation |
|
uDvdxFac = afFacMom*1. |
|
|
AhDvdxFac = vfFacMom*1. |
|
|
A4DvxxdxFac = vfFacMom*1. |
|
|
vDvdyFac = afFacMom*1. |
|
|
AhDvdyFac = vfFacMom*1. |
|
|
A4DvyydyFac = vfFacMom*1. |
|
|
rVelDvdrFac = afFacMom*1. |
|
165 |
ArDvdrFac = vfFacMom*1. |
ArDvdrFac = vfFacMom*1. |
166 |
mTFacV = mtFacMom*1. |
c mTFacV = mtFacMom*1. |
|
fvFac = cfFacMom*1. |
|
167 |
phyFac = pfFacMom*1. |
phyFac = pfFacMom*1. |
|
vForcFac = foFacMom*1. |
|
168 |
|
|
169 |
IF ( no_slip_bottom |
IF ( no_slip_bottom |
170 |
& .OR. bottomDragQuadratic.NE.0. |
& .OR. bottomDragQuadratic.NE.0. |
183 |
C-- Calculate open water fraction at vorticity points |
C-- Calculate open water fraction at vorticity points |
184 |
CALL MOM_CALC_HFACZ(bi,bj,k,hFacZ,r_hFacZ,myThid) |
CALL MOM_CALC_HFACZ(bi,bj,k,hFacZ,r_hFacZ,myThid) |
185 |
|
|
|
C---- Calculate common quantities used in both U and V equations |
|
|
C Calculate tracer cell face open areas |
|
|
DO j=1-OLy,sNy+OLy |
|
|
DO i=1-OLx,sNx+OLx |
|
|
xA(i,j) = _dyG(i,j,bi,bj) |
|
|
& *drF(k)*_hFacW(i,j,k,bi,bj) |
|
|
yA(i,j) = _dxG(i,j,bi,bj) |
|
|
& *drF(k)*_hFacS(i,j,k,bi,bj) |
|
|
ENDDO |
|
|
ENDDO |
|
|
|
|
186 |
C Make local copies of horizontal flow field |
C Make local copies of horizontal flow field |
187 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
188 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
206 |
|
|
207 |
IF (momViscosity) THEN |
IF (momViscosity) THEN |
208 |
C Calculate del^2 u and del^2 v for bi-harmonic term |
C Calculate del^2 u and del^2 v for bi-harmonic term |
209 |
IF (viscA4.NE.0. |
IF ( (viscA4.NE.0. .AND. no_slip_sides) |
210 |
|
& .OR. viscA4D.NE.0. .OR. viscA4Z.NE.0. |
211 |
& .OR. viscA4Grid.NE.0. |
& .OR. viscA4Grid.NE.0. |
212 |
& .OR. viscC4leith.NE.0. |
& .OR. viscC4leith.NE.0. |
213 |
& ) THEN |
& ) THEN |
220 |
ENDIF |
ENDIF |
221 |
C Calculate dissipation terms for U and V equations |
C Calculate dissipation terms for U and V equations |
222 |
C in terms of vorticity and divergence |
C in terms of vorticity and divergence |
223 |
IF (viscAh.NE.0. .OR. viscA4.NE.0. |
IF ( viscAhD.NE.0. .OR. viscAhZ.NE.0. |
224 |
& .OR. viscAhGrid.NE.0. .OR. viscA4Grid.NE.0. |
& .OR. viscA4D.NE.0. .OR. viscA4Z.NE.0. |
225 |
& .OR. viscC2leith.NE.0. .OR. viscC4leith.NE.0. |
& .OR. viscAhGrid.NE.0. .OR. viscA4Grid.NE.0. |
226 |
|
& .OR. viscC2leith.NE.0. .OR. viscC4leith.NE.0. |
227 |
& ) THEN |
& ) THEN |
228 |
CALL MOM_VI_HDISSIP(bi,bj,k,hDiv,vort3,hFacZ,dStar,zStar, |
CALL MOM_VI_HDISSIP(bi,bj,k,hDiv,vort3,hFacZ,dStar,zStar, |
229 |
O uDiss,vDiss, |
O guDiss,gvDiss, |
230 |
& myThid) |
& myThid) |
231 |
ENDIF |
ENDIF |
232 |
C or in terms of tension and strain |
C or in terms of tension and strain |
239 |
I myThid) |
I myThid) |
240 |
CALL MOM_HDISSIP(bi,bj,k, |
CALL MOM_HDISSIP(bi,bj,k, |
241 |
I tension,strain,hFacZ,viscAtension,viscAstrain, |
I tension,strain,hFacZ,viscAtension,viscAstrain, |
242 |
O uDiss,vDiss, |
O guDiss,gvDiss, |
243 |
I myThid) |
I myThid) |
244 |
ENDIF |
ENDIF |
245 |
ENDIF |
ENDIF |
252 |
C-- Vertical flux (fVer is at upper face of "u" cell) |
C-- Vertical flux (fVer is at upper face of "u" cell) |
253 |
|
|
254 |
C Eddy component of vertical flux (interior component only) -> vrF |
C Eddy component of vertical flux (interior component only) -> vrF |
255 |
IF (momViscosity.AND..NOT.implicitViscosity) |
IF (momViscosity.AND..NOT.implicitViscosity) THEN |
256 |
& CALL MOM_U_RVISCFLUX(bi,bj,k,uVel,KappaRU,vrF,myThid) |
CALL MOM_U_RVISCFLUX(bi,bj,k,uVel,KappaRU,vrF,myThid) |
257 |
|
|
258 |
C Combine fluxes |
C Combine fluxes |
259 |
DO j=jMin,jMax |
DO j=jMin,jMax |
260 |
DO i=iMin,iMax |
DO i=iMin,iMax |
261 |
fVerU(i,j,kDown) = ArDudrFac*vrF(i,j) |
fVerU(i,j,kDown) = ArDudrFac*vrF(i,j) |
262 |
|
ENDDO |
263 |
ENDDO |
ENDDO |
|
ENDDO |
|
264 |
|
|
265 |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
C-- Tendency is minus divergence of the fluxes |
266 |
DO j=2-Oly,sNy+Oly-1 |
DO j=2-Oly,sNy+Oly-1 |
267 |
DO i=2-Olx,sNx+Olx-1 |
DO i=2-Olx,sNx+Olx-1 |
268 |
gU(i,j,k,bi,bj) = uDiss(i,j) |
guDiss(i,j) = guDiss(i,j) |
269 |
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k) |
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k) |
270 |
& *recip_rAw(i,j,bi,bj) |
& *recip_rAw(i,j,bi,bj) |
271 |
& *( |
& *( |
272 |
& +fVerU(i,j,kUp)*rkFac - fVerU(i,j,kDown)*rkFac |
& +fVerU(i,j,kUp)*rkFac - fVerU(i,j,kDown)*rkFac |
273 |
& ) |
& ) |
274 |
& - phxFac*dPhiHydX(i,j) |
ENDDO |
275 |
ENDDO |
ENDDO |
276 |
ENDDO |
ENDIF |
277 |
|
|
278 |
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
279 |
IF (momViscosity.AND.no_slip_sides) THEN |
IF (momViscosity.AND.no_slip_sides) THEN |
281 |
CALL MOM_U_SIDEDRAG(bi,bj,k,uFld,del2u,hFacZ,vF,myThid) |
CALL MOM_U_SIDEDRAG(bi,bj,k,uFld,del2u,hFacZ,vF,myThid) |
282 |
DO j=jMin,jMax |
DO j=jMin,jMax |
283 |
DO i=iMin,iMax |
DO i=iMin,iMax |
284 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+vF(i,j) |
guDiss(i,j) = guDiss(i,j)+vF(i,j) |
285 |
ENDDO |
ENDDO |
286 |
ENDDO |
ENDDO |
287 |
ENDIF |
ENDIF |
291 |
CALL MOM_U_BOTTOMDRAG(bi,bj,k,uFld,KE,KappaRU,vF,myThid) |
CALL MOM_U_BOTTOMDRAG(bi,bj,k,uFld,KE,KappaRU,vF,myThid) |
292 |
DO j=jMin,jMax |
DO j=jMin,jMax |
293 |
DO i=iMin,iMax |
DO i=iMin,iMax |
294 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+vF(i,j) |
guDiss(i,j) = guDiss(i,j)+vF(i,j) |
295 |
ENDDO |
ENDDO |
296 |
ENDDO |
ENDDO |
297 |
ENDIF |
ENDIF |
312 |
C-- Vertical flux (fVer is at upper face of "v" cell) |
C-- Vertical flux (fVer is at upper face of "v" cell) |
313 |
|
|
314 |
C Eddy component of vertical flux (interior component only) -> vrF |
C Eddy component of vertical flux (interior component only) -> vrF |
315 |
IF (momViscosity.AND..NOT.implicitViscosity) |
IF (momViscosity.AND..NOT.implicitViscosity) THEN |
316 |
& CALL MOM_V_RVISCFLUX(bi,bj,k,vVel,KappaRV,vrf,myThid) |
CALL MOM_V_RVISCFLUX(bi,bj,k,vVel,KappaRV,vrf,myThid) |
317 |
|
|
318 |
C Combine fluxes -> fVerV |
C Combine fluxes -> fVerV |
319 |
DO j=jMin,jMax |
DO j=jMin,jMax |
320 |
DO i=iMin,iMax |
DO i=iMin,iMax |
321 |
fVerV(i,j,kDown) = ArDvdrFac*vrF(i,j) |
fVerV(i,j,kDown) = ArDvdrFac*vrF(i,j) |
322 |
|
ENDDO |
323 |
ENDDO |
ENDDO |
|
ENDDO |
|
324 |
|
|
325 |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
C-- Tendency is minus divergence of the fluxes |
326 |
DO j=jMin,jMax |
DO j=jMin,jMax |
327 |
DO i=iMin,iMax |
DO i=iMin,iMax |
328 |
gV(i,j,k,bi,bj) = vDiss(i,j) |
gvDiss(i,j) = gvDiss(i,j) |
329 |
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k) |
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k) |
330 |
& *recip_rAs(i,j,bi,bj) |
& *recip_rAs(i,j,bi,bj) |
331 |
& *( |
& *( |
332 |
& +fVerV(i,j,kUp)*rkFac - fVerV(i,j,kDown)*rkFac |
& +fVerV(i,j,kUp)*rkFac - fVerV(i,j,kDown)*rkFac |
333 |
& ) |
& ) |
334 |
& - phyFac*dPhiHydY(i,j) |
ENDDO |
335 |
ENDDO |
ENDDO |
336 |
ENDDO |
ENDIF |
337 |
|
|
338 |
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
339 |
IF (momViscosity.AND.no_slip_sides) THEN |
IF (momViscosity.AND.no_slip_sides) THEN |
341 |
CALL MOM_V_SIDEDRAG(bi,bj,k,vFld,del2v,hFacZ,vF,myThid) |
CALL MOM_V_SIDEDRAG(bi,bj,k,vFld,del2v,hFacZ,vF,myThid) |
342 |
DO j=jMin,jMax |
DO j=jMin,jMax |
343 |
DO i=iMin,iMax |
DO i=iMin,iMax |
344 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+vF(i,j) |
gvDiss(i,j) = gvDiss(i,j)+vF(i,j) |
345 |
ENDDO |
ENDDO |
346 |
ENDDO |
ENDDO |
347 |
ENDIF |
ENDIF |
350 |
CALL MOM_V_BOTTOMDRAG(bi,bj,k,vFld,KE,KappaRV,vF,myThid) |
CALL MOM_V_BOTTOMDRAG(bi,bj,k,vFld,KE,KappaRV,vF,myThid) |
351 |
DO j=jMin,jMax |
DO j=jMin,jMax |
352 |
DO i=iMin,iMax |
DO i=iMin,iMax |
353 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+vF(i,j) |
gvDiss(i,j) = gvDiss(i,j)+vF(i,j) |
354 |
ENDDO |
ENDDO |
355 |
ENDDO |
ENDDO |
356 |
ENDIF |
ENDIF |
373 |
& uCf,vCf,myThid) |
& uCf,vCf,myThid) |
374 |
DO j=jMin,jMax |
DO j=jMin,jMax |
375 |
DO i=iMin,iMax |
DO i=iMin,iMax |
376 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+uCf(i,j) |
gU(i,j,k,bi,bj) = uCf(i,j) - phxFac*dPhiHydX(i,j) |
377 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+vCf(i,j) |
gV(i,j,k,bi,bj) = vCf(i,j) - phyFac*dPhiHydY(i,j) |
378 |
ENDDO |
ENDDO |
379 |
ENDDO |
ENDDO |
380 |
IF ( writeDiag ) THEN |
IF ( writeDiag ) THEN |
391 |
ENDIF |
ENDIF |
392 |
#endif /* ALLOW_MNC */ |
#endif /* ALLOW_MNC */ |
393 |
ENDIF |
ENDIF |
394 |
|
ELSE |
395 |
|
DO j=jMin,jMax |
396 |
|
DO i=iMin,iMax |
397 |
|
gU(i,j,k,bi,bj) = -phxFac*dPhiHydX(i,j) |
398 |
|
gV(i,j,k,bi,bj) = -phyFac*dPhiHydY(i,j) |
399 |
|
ENDDO |
400 |
|
ENDDO |
401 |
ENDIF |
ENDIF |
402 |
|
|
403 |
IF (momAdvection) THEN |
IF (momAdvection) THEN |
445 |
ENDIF |
ENDIF |
446 |
|
|
447 |
#ifdef ALLOW_TIMEAVE |
#ifdef ALLOW_TIMEAVE |
448 |
#ifndef HRCUBE |
#ifndef MINIMAL_TAVE_OUTPUT |
449 |
IF (taveFreq.GT.0.) THEN |
IF (taveFreq.GT.0.) THEN |
450 |
CALL TIMEAVE_CUMUL_1K1T(uZetatave,vCf,deltaTClock, |
CALL TIMEAVE_CUMUL_1K1T(uZetatave,vCf,deltaTClock, |
451 |
& Nr, k, bi, bj, myThid) |
& Nr, k, bi, bj, myThid) |
452 |
CALL TIMEAVE_CUMUL_1K1T(vZetatave,uCf,deltaTClock, |
CALL TIMEAVE_CUMUL_1K1T(vZetatave,uCf,deltaTClock, |
453 |
& Nr, k, bi, bj, myThid) |
& Nr, k, bi, bj, myThid) |
454 |
ENDIF |
ENDIF |
455 |
#endif /* ndef HRCUBE */ |
#endif /* ndef MINIMAL_TAVE_OUTPUT */ |
456 |
#endif /* ALLOW_TIMEAVE */ |
#endif /* ALLOW_TIMEAVE */ |
457 |
|
|
458 |
C-- Vertical shear terms (-w*du/dr & -w*dv/dr) |
C-- Vertical shear terms (-w*du/dr & -w*dv/dr) |
516 |
& .AND. nPx.EQ.1 .AND. nPy.EQ.1 |
& .AND. nPx.EQ.1 .AND. nPy.EQ.1 |
517 |
& .AND. useCubedSphereExchange ) THEN |
& .AND. useCubedSphereExchange ) THEN |
518 |
CALL DEBUG_CS_CORNER_UV( ' uDiss,vDiss from MOM_VECINV', |
CALL DEBUG_CS_CORNER_UV( ' uDiss,vDiss from MOM_VECINV', |
519 |
& uDiss,vDiss, k, standardMessageUnit,bi,bj,myThid ) |
& guDiss,gvDiss, k, standardMessageUnit,bi,bj,myThid ) |
520 |
ENDIF |
ENDIF |
521 |
#endif /* ALLOW_DEBUG */ |
#endif /* ALLOW_DEBUG */ |
522 |
|
|
525 |
CALL WRITE_LOCAL_RL('Ds','I10',1,strain,bi,bj,k,myIter,myThid) |
CALL WRITE_LOCAL_RL('Ds','I10',1,strain,bi,bj,k,myIter,myThid) |
526 |
CALL WRITE_LOCAL_RL('Dt','I10',1,tension,bi,bj,k,myIter, |
CALL WRITE_LOCAL_RL('Dt','I10',1,tension,bi,bj,k,myIter, |
527 |
& myThid) |
& myThid) |
528 |
CALL WRITE_LOCAL_RL('Du','I10',1,uDiss,bi,bj,k,myIter,myThid) |
CALL WRITE_LOCAL_RL('Du','I10',1,guDiss,bi,bj,k,myIter,myThid) |
529 |
CALL WRITE_LOCAL_RL('Dv','I10',1,vDiss,bi,bj,k,myIter,myThid) |
CALL WRITE_LOCAL_RL('Dv','I10',1,gvDiss,bi,bj,k,myIter,myThid) |
530 |
CALL WRITE_LOCAL_RL('Z3','I10',1,vort3,bi,bj,k,myIter,myThid) |
CALL WRITE_LOCAL_RL('Z3','I10',1,vort3,bi,bj,k,myIter,myThid) |
531 |
CALL WRITE_LOCAL_RL('W3','I10',1,omega3,bi,bj,k,myIter,myThid) |
CALL WRITE_LOCAL_RL('W3','I10',1,omega3,bi,bj,k,myIter,myThid) |
532 |
CALL WRITE_LOCAL_RL('KE','I10',1,KE,bi,bj,k,myIter,myThid) |
CALL WRITE_LOCAL_RL('KE','I10',1,KE,bi,bj,k,myIter,myThid) |
538 |
& offsets, myThid) |
& offsets, myThid) |
539 |
CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Dt',tension, |
CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Dt',tension, |
540 |
& offsets, myThid) |
& offsets, myThid) |
541 |
CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Du',uDiss, |
CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Du',guDiss, |
542 |
& offsets, myThid) |
& offsets, myThid) |
543 |
CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Dv',vDiss, |
CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Dv',gvDiss, |
544 |
& offsets, myThid) |
& offsets, myThid) |
545 |
CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Z3',vort3, |
CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Z3',vort3, |
546 |
& offsets, myThid) |
& offsets, myThid) |