31 |
C !ROUTINE: MOM_FLUXFORM |
C !ROUTINE: MOM_FLUXFORM |
32 |
|
|
33 |
C !INTERFACE: ========================================================== |
C !INTERFACE: ========================================================== |
34 |
SUBROUTINE MOM_FLUXFORM( |
SUBROUTINE MOM_FLUXFORM( |
35 |
I bi,bj,iMin,iMax,jMin,jMax,k,kUp,kDown, |
I bi,bj,iMin,iMax,jMin,jMax,k,kUp,kDown, |
36 |
I KappaRU, KappaRV, |
I KappaRU, KappaRV, |
37 |
U fVerU, fVerV, |
U fVerU, fVerV, |
40 |
|
|
41 |
C !DESCRIPTION: |
C !DESCRIPTION: |
42 |
C Calculates all the horizontal accelerations except for the implicit surface |
C Calculates all the horizontal accelerations except for the implicit surface |
43 |
C pressure gradient and implciit vertical viscosity. |
C pressure gradient and implicit vertical viscosity. |
44 |
|
|
45 |
C !USES: =============================================================== |
C !USES: =============================================================== |
46 |
C == Global variables == |
C == Global variables == |
52 |
#include "PARAMS.h" |
#include "PARAMS.h" |
53 |
#include "GRID.h" |
#include "GRID.h" |
54 |
#include "SURFACE.h" |
#include "SURFACE.h" |
55 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
56 |
|
# include "tamc.h" |
57 |
|
# include "tamc_keys.h" |
58 |
|
# include "MOM_FLUXFORM.h" |
59 |
|
#endif |
60 |
|
|
61 |
C !INPUT PARAMETERS: =================================================== |
C !INPUT PARAMETERS: =================================================== |
62 |
C bi,bj :: tile indices |
C bi,bj :: tile indices |
98 |
C fMer :: meridional fluxes |
C fMer :: meridional fluxes |
99 |
C fVrUp,fVrDw :: vertical viscous fluxes at interface k-1 & k |
C fVrUp,fVrDw :: vertical viscous fluxes at interface k-1 & k |
100 |
INTEGER i,j |
INTEGER i,j |
101 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
102 |
|
INTEGER imomkey |
103 |
|
#endif |
104 |
_RL vF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
105 |
_RL v4F(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL v4F(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
106 |
_RL cF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL cF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
109 |
_RL fMer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL fMer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
110 |
_RL fVrUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL fVrUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
111 |
_RL fVrDw(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL fVrDw(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
112 |
C afFacMom - Tracer parameters for turning terms |
C afFacMom :: Tracer parameters for turning terms on and off. |
113 |
C vfFacMom on and off. |
C vfFacMom |
114 |
C pfFacMom afFacMom - Advective terms |
C pfFacMom afFacMom - Advective terms |
115 |
C cfFacMom vfFacMom - Eddy viscosity terms |
C cfFacMom vfFacMom - Eddy viscosity terms |
116 |
C mTFacMom pfFacMom - Pressure terms |
C mtFacMom pfFacMom - Pressure terms |
117 |
C cfFacMom - Coriolis terms |
C cfFacMom - Coriolis terms |
118 |
C foFacMom - Forcing |
C foFacMom - Forcing |
119 |
C mTFacMom - Metric term |
C mtFacMom - Metric term |
120 |
C uDudxFac, AhDudxFac, etc ... individual term parameters for switching terms off |
C uDudxFac, AhDudxFac, etc ... individual term parameters for switching terms off |
121 |
_RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
122 |
_RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
129 |
_RL rTransU(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL rTransU(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
130 |
_RL rTransV(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL rTransV(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
131 |
_RL KE(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL KE(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
132 |
c _RL viscAh_D(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL viscAh_D(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
133 |
c _RL viscAh_Z(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL viscAh_Z(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
134 |
c _RL viscA4_D(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL viscA4_D(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
135 |
c _RL viscA4_Z(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL viscA4_Z(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
136 |
c _RL vort3(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vort3(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
137 |
c _RL hDiv(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL hDiv(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
138 |
_RL strain(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL strain(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
139 |
_RL tension(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL tension(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
140 |
_RL uDudxFac |
_RL uDudxFac |
145 |
_RL ArDudrFac |
_RL ArDudrFac |
146 |
_RL fuFac |
_RL fuFac |
147 |
_RL mtFacU |
_RL mtFacU |
148 |
|
_RL mtNHFacU |
149 |
_RL uDvdxFac |
_RL uDvdxFac |
150 |
_RL AhDvdxFac |
_RL AhDvdxFac |
151 |
_RL vDvdyFac |
_RL vDvdyFac |
154 |
_RL ArDvdrFac |
_RL ArDvdrFac |
155 |
_RL fvFac |
_RL fvFac |
156 |
_RL mtFacV |
_RL mtFacV |
157 |
LOGICAL bottomDragTerms |
_RL mtNHFacV |
158 |
|
_RL sideMaskFac |
159 |
|
LOGICAL bottomDragTerms,harmonic,biharmonic,useVariableViscosity |
160 |
CEOP |
CEOP |
161 |
|
#ifdef MOM_BOUNDARY_CONSERVE |
162 |
|
COMMON / MOM_FLUXFORM_LOCAL / uBnd, vBnd |
163 |
|
_RL uBnd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
164 |
|
_RL vBnd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
165 |
|
#endif /* MOM_BOUNDARY_CONSERVE */ |
166 |
|
|
167 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
168 |
|
act0 = k - 1 |
169 |
|
max0 = Nr |
170 |
|
act1 = bi - myBxLo(myThid) |
171 |
|
max1 = myBxHi(myThid) - myBxLo(myThid) + 1 |
172 |
|
act2 = bj - myByLo(myThid) |
173 |
|
max2 = myByHi(myThid) - myByLo(myThid) + 1 |
174 |
|
act3 = myThid - 1 |
175 |
|
max3 = nTx*nTy |
176 |
|
act4 = ikey_dynamics - 1 |
177 |
|
imomkey = (act0 + 1) |
178 |
|
& + act1*max0 |
179 |
|
& + act2*max0*max1 |
180 |
|
& + act3*max0*max1*max2 |
181 |
|
& + act4*max0*max1*max2*max3 |
182 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
183 |
|
|
184 |
C Initialise intermediate terms |
C Initialise intermediate terms |
185 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
194 |
fVrDw(i,j)= 0. |
fVrDw(i,j)= 0. |
195 |
rTransU(i,j)= 0. |
rTransU(i,j)= 0. |
196 |
rTransV(i,j)= 0. |
rTransV(i,j)= 0. |
197 |
|
c KE(i,j) = 0. |
198 |
|
hDiv(i,j) = 0. |
199 |
|
vort3(i,j) = 0. |
200 |
strain(i,j) = 0. |
strain(i,j) = 0. |
201 |
tension(i,j)= 0. |
tension(i,j)= 0. |
202 |
guDiss(i,j) = 0. |
guDiss(i,j) = 0. |
212 |
AhDudyFac = vfFacMom*1. |
AhDudyFac = vfFacMom*1. |
213 |
rVelDudrFac = afFacMom*1. |
rVelDudrFac = afFacMom*1. |
214 |
ArDudrFac = vfFacMom*1. |
ArDudrFac = vfFacMom*1. |
215 |
mTFacU = mtFacMom*1. |
mtFacU = mtFacMom*1. |
216 |
|
mtNHFacU = 1. |
217 |
fuFac = cfFacMom*1. |
fuFac = cfFacMom*1. |
218 |
C o V momentum equation |
C o V momentum equation |
219 |
uDvdxFac = afFacMom*1. |
uDvdxFac = afFacMom*1. |
222 |
AhDvdyFac = vfFacMom*1. |
AhDvdyFac = vfFacMom*1. |
223 |
rVelDvdrFac = afFacMom*1. |
rVelDvdrFac = afFacMom*1. |
224 |
ArDvdrFac = vfFacMom*1. |
ArDvdrFac = vfFacMom*1. |
225 |
mTFacV = mtFacMom*1. |
mtFacV = mtFacMom*1. |
226 |
|
mtNHFacV = 1. |
227 |
fvFac = cfFacMom*1. |
fvFac = cfFacMom*1. |
228 |
|
|
229 |
IF (implicitViscosity) THEN |
IF (implicitViscosity) THEN |
231 |
ArDvdrFac = 0. |
ArDvdrFac = 0. |
232 |
ENDIF |
ENDIF |
233 |
|
|
234 |
|
C note: using standard stencil (no mask) results in under-estimating |
235 |
|
C vorticity at a no-slip boundary by a factor of 2 = sideDragFactor |
236 |
|
IF ( no_slip_sides ) THEN |
237 |
|
sideMaskFac = sideDragFactor |
238 |
|
ELSE |
239 |
|
sideMaskFac = 0. _d 0 |
240 |
|
ENDIF |
241 |
|
|
242 |
IF ( no_slip_bottom |
IF ( no_slip_bottom |
243 |
& .OR. bottomDragQuadratic.NE.0. |
& .OR. bottomDragQuadratic.NE.0. |
244 |
& .OR. bottomDragLinear.NE.0.) THEN |
& .OR. bottomDragLinear.NE.0.) THEN |
254 |
C Calculate tracer cell face open areas |
C Calculate tracer cell face open areas |
255 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
256 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
257 |
xA(i,j) = _dyG(i,j,bi,bj) |
xA(i,j) = _dyG(i,j,bi,bj)*deepFacC(k) |
258 |
& *drF(k)*_hFacW(i,j,k,bi,bj) |
& *drF(k)*_hFacW(i,j,k,bi,bj) |
259 |
yA(i,j) = _dxG(i,j,bi,bj) |
yA(i,j) = _dxG(i,j,bi,bj)*deepFacC(k) |
260 |
& *drF(k)*_hFacS(i,j,k,bi,bj) |
& *drF(k)*_hFacS(i,j,k,bi,bj) |
261 |
ENDDO |
ENDDO |
262 |
ENDDO |
ENDDO |
263 |
|
|
270 |
ENDDO |
ENDDO |
271 |
|
|
272 |
C Calculate velocity field "volume transports" through tracer cell faces. |
C Calculate velocity field "volume transports" through tracer cell faces. |
273 |
|
C anelastic: transports are scaled by rhoFacC (~ mass transport) |
274 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
275 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
276 |
uTrans(i,j) = uFld(i,j)*xA(i,j) |
uTrans(i,j) = uFld(i,j)*xA(i,j)*rhoFacC(k) |
277 |
vTrans(i,j) = vFld(i,j)*yA(i,j) |
vTrans(i,j) = vFld(i,j)*yA(i,j)*rhoFacC(k) |
278 |
ENDDO |
ENDDO |
279 |
ENDDO |
ENDDO |
280 |
|
|
281 |
IF (bottomDragTerms) THEN |
CALL MOM_CALC_KE(bi,bj,k,2,uFld,vFld,KE,myThid) |
282 |
CALL MOM_CALC_KE(bi,bj,k,3,uFld,vFld,KE,myThid) |
IF ( momViscosity) THEN |
283 |
ENDIF |
CALL MOM_CALC_HDIV(bi,bj,k,2,uFld,vFld,hDiv,myThid) |
284 |
|
CALL MOM_CALC_RELVORT3(bi,bj,k,uFld,vFld,hFacZ,vort3,myThid) |
285 |
IF (viscAstrain.NE.0. .OR. viscAtension.NE.0.) THEN |
CALL MOM_CALC_TENSION(bi,bj,k,uFld,vFld,tension,myThid) |
286 |
CALL MOM_CALC_TENSION(bi,bj,k,uFld,vFld, |
CALL MOM_CALC_STRAIN(bi,bj,k,uFld,vFld,hFacZ,strain,myThid) |
287 |
O tension, |
DO j=1-OLy,sNy+OLy |
288 |
I myThid) |
DO i=1-OLx,sNx+OLx |
289 |
CALL MOM_CALC_STRAIN(bi,bj,k,uFld,vFld,hFacZ, |
IF ( hFacZ(i,j).EQ.0. ) THEN |
290 |
O strain, |
vort3(i,j) = sideMaskFac*vort3(i,j) |
291 |
I myThid) |
strain(i,j) = sideMaskFac*strain(i,j) |
292 |
|
ENDIF |
293 |
|
ENDDO |
294 |
|
ENDDO |
295 |
|
#ifdef ALLOW_DIAGNOSTICS |
296 |
|
IF ( useDiagnostics ) THEN |
297 |
|
CALL DIAGNOSTICS_FILL(hDiv, 'momHDiv ',k,1,2,bi,bj,myThid) |
298 |
|
CALL DIAGNOSTICS_FILL(vort3, 'momVort3',k,1,2,bi,bj,myThid) |
299 |
|
CALL DIAGNOSTICS_FILL(tension,'Tension ',k,1,2,bi,bj,myThid) |
300 |
|
CALL DIAGNOSTICS_FILL(strain, 'Strain ',k,1,2,bi,bj,myThid) |
301 |
|
ENDIF |
302 |
|
#endif |
303 |
ENDIF |
ENDIF |
304 |
|
|
305 |
C--- First call (k=1): compute vertical adv. flux fVerU(kUp) & fVerV(kUp) |
C--- First call (k=1): compute vertical adv. flux fVerU(kUp) & fVerV(kUp) |
306 |
IF (momAdvection.AND.k.EQ.1) THEN |
IF (momAdvection.AND.k.EQ.1) THEN |
307 |
|
|
308 |
|
#ifdef MOM_BOUNDARY_CONSERVE |
309 |
|
CALL MOM_UV_BOUNDARY( bi, bj, k, |
310 |
|
I uVel, vVel, |
311 |
|
O uBnd(1-OLx,1-OLy,k,bi,bj), |
312 |
|
O vBnd(1-OLx,1-OLy,k,bi,bj), |
313 |
|
I myTime, myIter, myThid ) |
314 |
|
#endif /* MOM_BOUNDARY_CONSERVE */ |
315 |
|
|
316 |
C- Calculate vertical transports above U & V points (West & South face): |
C- Calculate vertical transports above U & V points (West & South face): |
317 |
|
|
318 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
319 |
|
# ifdef NONLIN_FRSURF |
320 |
|
# ifndef DISABLE_RSTAR_CODE |
321 |
|
CADJ STORE dwtransc(:,:,bi,bj) = |
322 |
|
CADJ & comlev1_bibj_k, key = imomkey, byte = isbyte |
323 |
|
CADJ STORE dwtransu(:,:,bi,bj) = |
324 |
|
CADJ & comlev1_bibj_k, key = imomkey, byte = isbyte |
325 |
|
CADJ STORE dwtransv(:,:,bi,bj) = |
326 |
|
CADJ & comlev1_bibj_k, key = imomkey, byte = isbyte |
327 |
|
# endif |
328 |
|
# endif /* NONLIN_FRSURF */ |
329 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
330 |
CALL MOM_CALC_RTRANS( k, bi, bj, |
CALL MOM_CALC_RTRANS( k, bi, bj, |
331 |
O rTransU, rTransV, |
O rTransU, rTransV, |
332 |
I myTime, myIter, myThid) |
I myTime, myIter, myThid) |
349 |
I myTime, myIter, myThid) |
I myTime, myIter, myThid) |
350 |
ENDIF |
ENDIF |
351 |
|
|
352 |
c IF (momViscosity) THEN |
#ifdef MOM_BOUNDARY_CONSERVE |
353 |
c & CALL MOM_CALC_VISCOSITY(bi,bj,k, |
IF ( momAdvection .AND. k.LT.Nr ) THEN |
354 |
c I uFld,vFld, |
CALL MOM_UV_BOUNDARY( bi, bj, k+1, |
355 |
c O viscAh_D,viscAh_Z,myThid) |
I uVel, vVel, |
356 |
|
O uBnd(1-OLx,1-OLy,k+1,bi,bj), |
357 |
|
O vBnd(1-OLx,1-OLy,k+1,bi,bj), |
358 |
|
I myTime, myIter, myThid ) |
359 |
|
ENDIF |
360 |
|
#endif /* MOM_BOUNDARY_CONSERVE */ |
361 |
|
|
362 |
|
IF (momViscosity) THEN |
363 |
|
CALL MOM_CALC_VISC( |
364 |
|
I bi,bj,k, |
365 |
|
O viscAh_Z,viscAh_D,viscA4_Z,viscA4_D, |
366 |
|
O harmonic,biharmonic,useVariableViscosity, |
367 |
|
I hDiv,vort3,tension,strain,KE,hFacZ, |
368 |
|
I myThid) |
369 |
|
ENDIF |
370 |
|
|
371 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
372 |
|
|
375 |
IF (momAdvection) THEN |
IF (momAdvection) THEN |
376 |
C--- Calculate mean fluxes (advection) between cells for zonal flow. |
C--- Calculate mean fluxes (advection) between cells for zonal flow. |
377 |
|
|
378 |
|
#ifdef MOM_BOUNDARY_CONSERVE |
379 |
|
CALL MOM_U_ADV_UU( bi,bj,k,uTrans,uBnd(1-OLx,1-OLy,k,bi,bj), |
380 |
|
O fZon,myThid ) |
381 |
|
CALL MOM_U_ADV_VU( bi,bj,k,vTrans,uBnd(1-OLx,1-OLy,k,bi,bj), |
382 |
|
O fMer,myThid ) |
383 |
|
CALL MOM_U_ADV_WU( |
384 |
|
I bi,bj,k+1,uBnd,wVel,rTransU, |
385 |
|
O fVerU(1-OLx,1-OLy,kDown), myThid ) |
386 |
|
#else /* MOM_BOUNDARY_CONSERVE */ |
387 |
C-- Zonal flux (fZon is at east face of "u" cell) |
C-- Zonal flux (fZon is at east face of "u" cell) |
388 |
C Mean flow component of zonal flux -> fZon |
C Mean flow component of zonal flux -> fZon |
389 |
CALL MOM_U_ADV_UU(bi,bj,k,uTrans,uFld,fZon,myThid) |
CALL MOM_U_ADV_UU(bi,bj,k,uTrans,uFld,fZon,myThid) |
397 |
CALL MOM_U_ADV_WU( |
CALL MOM_U_ADV_WU( |
398 |
I bi,bj,k+1,uVel,wVel,rTransU, |
I bi,bj,k+1,uVel,wVel,rTransU, |
399 |
O fVerU(1-OLx,1-OLy,kDown), myThid ) |
O fVerU(1-OLx,1-OLy,kDown), myThid ) |
400 |
|
#endif /* MOM_BOUNDARY_CONSERVE */ |
401 |
|
|
402 |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
403 |
DO j=jMin,jMax |
DO j=jMin,jMax |
408 |
& ( 0.5 _d 0*(rA(i,j,bi,bj)+rA(i-1,j,bi,bj)) ) |
& ( 0.5 _d 0*(rA(i,j,bi,bj)+rA(i-1,j,bi,bj)) ) |
409 |
#else |
#else |
410 |
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k) |
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k) |
411 |
& *recip_rAw(i,j,bi,bj) |
& *recip_rAw(i,j,bi,bj)*recip_deepFac2C(k)*recip_rhoFacC(k) |
412 |
#endif |
#endif |
413 |
& *( ( fZon(i,j ) - fZon(i-1,j) )*uDudxFac |
& *( ( fZon(i,j ) - fZon(i-1,j) )*uDudxFac |
414 |
& +( fMer(i,j+1) - fMer(i, j) )*vDudyFac |
& +( fMer(i,j+1) - fMer(i, j) )*vDudyFac |
415 |
& +(fVerU(i,j,kDown) - fVerU(i,j,kUp))*rkSign*rVelDudrFac |
& +(fVerU(i,j,kDown) - fVerU(i,j,kUp))*rkSign*rVelDudrFac |
416 |
& ) |
& ) |
417 |
ENDDO |
ENDDO |
418 |
ENDDO |
ENDDO |
419 |
|
|
420 |
|
#ifdef ALLOW_DIAGNOSTICS |
421 |
|
IF ( useDiagnostics ) THEN |
422 |
|
CALL DIAGNOSTICS_FILL(fZon,'ADVx_Um ',k,1,2,bi,bj,myThid) |
423 |
|
CALL DIAGNOSTICS_FILL(fMer,'ADVy_Um ',k,1,2,bi,bj,myThid) |
424 |
|
CALL DIAGNOSTICS_FILL(fVerU(1-OLx,1-OLy,kUp), |
425 |
|
& 'ADVrE_Um',k,1,2,bi,bj,myThid) |
426 |
|
ENDIF |
427 |
|
#endif |
428 |
|
|
429 |
#ifdef NONLIN_FRSURF |
#ifdef NONLIN_FRSURF |
430 |
C-- account for 3.D divergence of the flow in rStar coordinate: |
C-- account for 3.D divergence of the flow in rStar coordinate: |
431 |
|
# ifndef DISABLE_RSTAR_CODE |
432 |
IF ( select_rStar.GT.0 ) THEN |
IF ( select_rStar.GT.0 ) THEN |
433 |
DO j=jMin,jMax |
DO j=jMin,jMax |
434 |
DO i=iMin,iMax |
DO i=iMin,iMax |
446 |
ENDDO |
ENDDO |
447 |
ENDDO |
ENDDO |
448 |
ENDIF |
ENDIF |
449 |
|
# endif /* DISABLE_RSTAR_CODE */ |
450 |
#endif /* NONLIN_FRSURF */ |
#endif /* NONLIN_FRSURF */ |
451 |
|
|
452 |
|
#ifdef ALLOW_ADDFLUID |
453 |
|
IF ( selectAddFluid.GE.1 ) THEN |
454 |
|
DO j=jMin,jMax |
455 |
|
DO i=iMin,iMax |
456 |
|
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj) |
457 |
|
& + uVel(i,j,k,bi,bj)*mass2rUnit*0.5 _d 0 |
458 |
|
& *( addMass(i-1,j,k,bi,bj) + addMass(i,j,k,bi,bj) ) |
459 |
|
& *_recip_hFacW(i,j,k,bi,bj)*recip_drF(k)*recip_rhoFacC(k) |
460 |
|
& * recip_rAw(i,j,bi,bj)*recip_deepFac2C(k) |
461 |
|
ENDDO |
462 |
|
ENDDO |
463 |
|
ENDIF |
464 |
|
#endif /* ALLOW_ADDFLUID */ |
465 |
|
|
466 |
ELSE |
ELSE |
467 |
C- if momAdvection / else |
C- if momAdvection / else |
468 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
478 |
C--- Calculate eddy fluxes (dissipation) between cells for zonal flow. |
C--- Calculate eddy fluxes (dissipation) between cells for zonal flow. |
479 |
|
|
480 |
C Bi-harmonic term del^2 U -> v4F |
C Bi-harmonic term del^2 U -> v4F |
481 |
IF ( viscA4.NE.0. ) |
IF (biharmonic) |
482 |
& CALL MOM_U_DEL2U(bi,bj,k,uFld,hFacZ,v4f,myThid) |
& CALL MOM_U_DEL2U(bi,bj,k,uFld,hFacZ,v4f,myThid) |
483 |
|
|
484 |
C Laplacian and bi-harmonic terms, Zonal Fluxes -> fZon |
C Laplacian and bi-harmonic terms, Zonal Fluxes -> fZon |
485 |
CALL MOM_U_XVISCFLUX(bi,bj,k,uFld,v4F,fZon,myThid) |
CALL MOM_U_XVISCFLUX(bi,bj,k,uFld,v4F,fZon, |
486 |
|
I viscAh_D,viscA4_D,myThid) |
487 |
|
|
488 |
C Laplacian and bi-harmonic termis, Merid Fluxes -> fMer |
C Laplacian and bi-harmonic termis, Merid Fluxes -> fMer |
489 |
CALL MOM_U_YVISCFLUX(bi,bj,k,uFld,v4F,hFacZ,fMer,myThid) |
CALL MOM_U_YVISCFLUX(bi,bj,k,uFld,v4F,hFacZ,fMer, |
490 |
|
I viscAh_Z,viscA4_Z,myThid) |
491 |
|
|
492 |
C Eddy component of vertical flux (interior component only) -> fVrUp & fVrDw |
C Eddy component of vertical flux (interior component only) -> fVrUp & fVrDw |
493 |
IF (.NOT.implicitViscosity) THEN |
IF (.NOT.implicitViscosity) THEN |
496 |
ENDIF |
ENDIF |
497 |
|
|
498 |
C-- Tendency is minus divergence of the fluxes |
C-- Tendency is minus divergence of the fluxes |
499 |
|
C anelastic: hor.visc.fluxes are not scaled by rhoFac (by vert.visc.flx is) |
500 |
DO j=jMin,jMax |
DO j=jMin,jMax |
501 |
DO i=iMin,iMax |
DO i=iMin,iMax |
502 |
guDiss(i,j) = |
guDiss(i,j) = |
505 |
& ( 0.5 _d 0*(rA(i,j,bi,bj)+rA(i-1,j,bi,bj)) ) |
& ( 0.5 _d 0*(rA(i,j,bi,bj)+rA(i-1,j,bi,bj)) ) |
506 |
#else |
#else |
507 |
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k) |
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k) |
508 |
& *recip_rAw(i,j,bi,bj) |
& *recip_rAw(i,j,bi,bj)*recip_deepFac2C(k) |
509 |
#endif |
#endif |
510 |
& *( ( fZon(i,j ) - fZon(i-1,j) )*AhDudxFac |
& *( ( fZon(i,j ) - fZon(i-1,j) )*AhDudxFac |
511 |
& +( fMer(i,j+1) - fMer(i, j) )*AhDudyFac |
& +( fMer(i,j+1) - fMer(i, j) )*AhDudyFac |
512 |
& +( fVrDw(i,j) - fVrUp(i,j) )*rkSign*ArDudrFac |
& +( fVrDw(i,j) - fVrUp(i,j) )*rkSign*ArDudrFac |
513 |
|
& *recip_rhoFacC(k) |
514 |
& ) |
& ) |
515 |
ENDDO |
ENDDO |
516 |
ENDDO |
ENDDO |
517 |
|
|
518 |
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
#ifdef ALLOW_DIAGNOSTICS |
519 |
|
IF ( useDiagnostics ) THEN |
520 |
|
CALL DIAGNOSTICS_FILL(fZon, 'VISCx_Um',k,1,2,bi,bj,myThid) |
521 |
|
CALL DIAGNOSTICS_FILL(fMer, 'VISCy_Um',k,1,2,bi,bj,myThid) |
522 |
|
IF (.NOT.implicitViscosity) |
523 |
|
& CALL DIAGNOSTICS_FILL(fVrUp,'VISrE_Um',k,1,2,bi,bj,myThid) |
524 |
|
ENDIF |
525 |
|
#endif |
526 |
|
|
527 |
|
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
528 |
IF (no_slip_sides) THEN |
IF (no_slip_sides) THEN |
529 |
C- No-slip BCs impose a drag at walls... |
C- No-slip BCs impose a drag at walls... |
530 |
CALL MOM_U_SIDEDRAG(bi,bj,k,uFld,v4F,hFacZ,vF,myThid) |
CALL MOM_U_SIDEDRAG( |
531 |
|
I bi,bj,k, |
532 |
|
I uFld, v4f, hFacZ, |
533 |
|
I viscAh_Z,viscA4_Z, |
534 |
|
I harmonic,biharmonic,useVariableViscosity, |
535 |
|
O vF, |
536 |
|
I myThid) |
537 |
DO j=jMin,jMax |
DO j=jMin,jMax |
538 |
DO i=iMin,iMax |
DO i=iMin,iMax |
539 |
gUdiss(i,j) = gUdiss(i,j) + vF(i,j) |
gUdiss(i,j) = gUdiss(i,j) + vF(i,j) |
550 |
ENDDO |
ENDDO |
551 |
ENDIF |
ENDIF |
552 |
|
|
553 |
|
#ifdef ALLOW_SHELFICE |
554 |
|
IF (useShelfIce) THEN |
555 |
|
CALL SHELFICE_U_DRAG(bi,bj,k,uFld,KE,KappaRU,vF,myThid) |
556 |
|
DO j=jMin,jMax |
557 |
|
DO i=iMin,iMax |
558 |
|
gUdiss(i,j) = gUdiss(i,j) + vF(i,j) |
559 |
|
ENDDO |
560 |
|
ENDDO |
561 |
|
ENDIF |
562 |
|
#endif /* ALLOW_SHELFICE */ |
563 |
|
|
564 |
C- endif momViscosity |
C- endif momViscosity |
565 |
ENDIF |
ENDIF |
566 |
|
|
572 |
|
|
573 |
C-- Metric terms for curvilinear grid systems |
C-- Metric terms for curvilinear grid systems |
574 |
IF (useNHMTerms) THEN |
IF (useNHMTerms) THEN |
575 |
C o Non-hydrosatic metric terms |
C o Non-Hydrostatic (spherical) metric terms |
576 |
CALL MOM_U_METRIC_NH(bi,bj,k,uFld,wVel,mT,myThid) |
CALL MOM_U_METRIC_NH(bi,bj,k,uFld,wVel,mT,myThid) |
577 |
DO j=jMin,jMax |
DO j=jMin,jMax |
578 |
DO i=iMin,iMax |
DO i=iMin,iMax |
579 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+mTFacU*mT(i,j) |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+mtNHFacU*mT(i,j) |
580 |
ENDDO |
ENDDO |
581 |
ENDDO |
ENDDO |
582 |
ENDIF |
ENDIF |
583 |
IF (usingSphericalPolarMTerms) THEN |
IF ( usingSphericalPolarGrid .AND. metricTerms ) THEN |
584 |
|
C o Spherical polar grid metric terms |
585 |
CALL MOM_U_METRIC_SPHERE(bi,bj,k,uFld,vFld,mT,myThid) |
CALL MOM_U_METRIC_SPHERE(bi,bj,k,uFld,vFld,mT,myThid) |
586 |
DO j=jMin,jMax |
DO j=jMin,jMax |
587 |
DO i=iMin,iMax |
DO i=iMin,iMax |
588 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+mTFacU*mT(i,j) |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+mtFacU*mT(i,j) |
589 |
ENDDO |
ENDDO |
590 |
ENDDO |
ENDDO |
591 |
ENDIF |
ENDIF |
592 |
IF (usingCylindricalGrid) THEN |
IF ( usingCylindricalGrid .AND. metricTerms ) THEN |
593 |
CALL MOM_U_METRIC_CYLINDER(bi,bj,k,uFld,vFld,mT,myThid) |
C o Cylindrical grid metric terms |
594 |
DO j=jMin,jMax |
CALL MOM_U_METRIC_CYLINDER(bi,bj,k,uFld,vFld,mT,myThid) |
595 |
DO i=iMin,iMax |
DO j=jMin,jMax |
596 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+mTFacU*mT(i,j) |
DO i=iMin,iMax |
597 |
ENDDO |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+mtFacU*mT(i,j) |
598 |
|
ENDDO |
599 |
ENDDO |
ENDDO |
600 |
ENDIF |
ENDIF |
601 |
|
|
604 |
C---- Meridional momentum equation starts here |
C---- Meridional momentum equation starts here |
605 |
|
|
606 |
IF (momAdvection) THEN |
IF (momAdvection) THEN |
607 |
|
|
608 |
|
#ifdef MOM_BOUNDARY_CONSERVE |
609 |
|
CALL MOM_V_ADV_UV( bi,bj,k,uTrans,vBnd(1-OLx,1-OLy,k,bi,bj), |
610 |
|
O fZon,myThid ) |
611 |
|
CALL MOM_V_ADV_VV( bi,bj,k,vTrans,vBnd(1-OLx,1-OLy,k,bi,bj), |
612 |
|
O fMer,myThid ) |
613 |
|
CALL MOM_V_ADV_WV( |
614 |
|
I bi,bj,k+1,vBnd,wVel,rTransV, |
615 |
|
O fVerV(1-OLx,1-OLy,kDown), myThid ) |
616 |
|
#else /* MOM_BOUNDARY_CONSERVE */ |
617 |
C--- Calculate mean fluxes (advection) between cells for meridional flow. |
C--- Calculate mean fluxes (advection) between cells for meridional flow. |
618 |
C Mean flow component of zonal flux -> fZon |
C Mean flow component of zonal flux -> fZon |
619 |
CALL MOM_V_ADV_UV(bi,bj,k,uTrans,vFld,fZon,myThid) |
CALL MOM_V_ADV_UV(bi,bj,k,uTrans,vFld,fZon,myThid) |
627 |
CALL MOM_V_ADV_WV( |
CALL MOM_V_ADV_WV( |
628 |
I bi,bj,k+1,vVel,wVel,rTransV, |
I bi,bj,k+1,vVel,wVel,rTransV, |
629 |
O fVerV(1-OLx,1-OLy,kDown), myThid ) |
O fVerV(1-OLx,1-OLy,kDown), myThid ) |
630 |
|
#endif /* MOM_BOUNDARY_CONSERVE */ |
631 |
|
|
632 |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
633 |
DO j=jMin,jMax |
DO j=jMin,jMax |
638 |
& ( 0.5 _d 0*(_rA(i,j,bi,bj)+_rA(i,j-1,bi,bj)) ) |
& ( 0.5 _d 0*(_rA(i,j,bi,bj)+_rA(i,j-1,bi,bj)) ) |
639 |
#else |
#else |
640 |
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k) |
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k) |
641 |
& *recip_rAs(i,j,bi,bj) |
& *recip_rAs(i,j,bi,bj)*recip_deepFac2C(k)*recip_rhoFacC(k) |
642 |
#endif |
#endif |
643 |
& *( ( fZon(i+1,j) - fZon(i,j ) )*uDvdxFac |
& *( ( fZon(i+1,j) - fZon(i,j ) )*uDvdxFac |
644 |
& +( fMer(i, j) - fMer(i,j-1) )*vDvdyFac |
& +( fMer(i, j) - fMer(i,j-1) )*vDvdyFac |
645 |
& +(fVerV(i,j,kDown) - fVerV(i,j,kUp))*rkSign*rVelDvdrFac |
& +(fVerV(i,j,kDown) - fVerV(i,j,kUp))*rkSign*rVelDvdrFac |
646 |
& ) |
& ) |
647 |
ENDDO |
ENDDO |
648 |
ENDDO |
ENDDO |
649 |
|
|
650 |
|
#ifdef ALLOW_DIAGNOSTICS |
651 |
|
IF ( useDiagnostics ) THEN |
652 |
|
CALL DIAGNOSTICS_FILL(fZon,'ADVx_Vm ',k,1,2,bi,bj,myThid) |
653 |
|
CALL DIAGNOSTICS_FILL(fMer,'ADVy_Vm ',k,1,2,bi,bj,myThid) |
654 |
|
CALL DIAGNOSTICS_FILL(fVerV(1-OLx,1-OLy,kUp), |
655 |
|
& 'ADVrE_Vm',k,1,2,bi,bj,myThid) |
656 |
|
ENDIF |
657 |
|
#endif |
658 |
|
|
659 |
#ifdef NONLIN_FRSURF |
#ifdef NONLIN_FRSURF |
660 |
C-- account for 3.D divergence of the flow in rStar coordinate: |
C-- account for 3.D divergence of the flow in rStar coordinate: |
661 |
|
# ifndef DISABLE_RSTAR_CODE |
662 |
IF ( select_rStar.GT.0 ) THEN |
IF ( select_rStar.GT.0 ) THEN |
663 |
DO j=jMin,jMax |
DO j=jMin,jMax |
664 |
DO i=iMin,iMax |
DO i=iMin,iMax |
676 |
ENDDO |
ENDDO |
677 |
ENDDO |
ENDDO |
678 |
ENDIF |
ENDIF |
679 |
|
# endif /* DISABLE_RSTAR_CODE */ |
680 |
#endif /* NONLIN_FRSURF */ |
#endif /* NONLIN_FRSURF */ |
681 |
|
|
682 |
|
#ifdef ALLOW_ADDFLUID |
683 |
|
IF ( selectAddFluid.GE.1 ) THEN |
684 |
|
DO j=jMin,jMax |
685 |
|
DO i=iMin,iMax |
686 |
|
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj) |
687 |
|
& + vVel(i,j,k,bi,bj)*mass2rUnit*0.5 _d 0 |
688 |
|
& *( addMass(i,j-1,k,bi,bj) + addMass(i,j,k,bi,bj) ) |
689 |
|
& *_recip_hFacS(i,j,k,bi,bj)*recip_drF(k)*recip_rhoFacC(k) |
690 |
|
& * recip_rAs(i,j,bi,bj)*recip_deepFac2C(k) |
691 |
|
ENDDO |
692 |
|
ENDDO |
693 |
|
ENDIF |
694 |
|
#endif /* ALLOW_ADDFLUID */ |
695 |
|
|
696 |
ELSE |
ELSE |
697 |
C- if momAdvection / else |
C- if momAdvection / else |
698 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
707 |
IF (momViscosity) THEN |
IF (momViscosity) THEN |
708 |
C--- Calculate eddy fluxes (dissipation) between cells for meridional flow. |
C--- Calculate eddy fluxes (dissipation) between cells for meridional flow. |
709 |
C Bi-harmonic term del^2 V -> v4F |
C Bi-harmonic term del^2 V -> v4F |
710 |
IF ( viscA4.NE.0. ) |
IF (biharmonic) |
711 |
& CALL MOM_V_DEL2V(bi,bj,k,vFld,hFacZ,v4f,myThid) |
& CALL MOM_V_DEL2V(bi,bj,k,vFld,hFacZ,v4f,myThid) |
712 |
|
|
713 |
C Laplacian and bi-harmonic terms, Zonal Fluxes -> fZon |
C Laplacian and bi-harmonic terms, Zonal Fluxes -> fZon |
714 |
CALL MOM_V_XVISCFLUX(bi,bj,k,vFld,v4f,hFacZ,fZon,myThid) |
CALL MOM_V_XVISCFLUX(bi,bj,k,vFld,v4f,hFacZ,fZon, |
715 |
|
I viscAh_Z,viscA4_Z,myThid) |
716 |
|
|
717 |
C Laplacian and bi-harmonic termis, Merid Fluxes -> fMer |
C Laplacian and bi-harmonic termis, Merid Fluxes -> fMer |
718 |
CALL MOM_V_YVISCFLUX(bi,bj,k,vFld,v4f,fMer,myThid) |
CALL MOM_V_YVISCFLUX(bi,bj,k,vFld,v4f,fMer, |
719 |
|
I viscAh_D,viscA4_D,myThid) |
720 |
|
|
721 |
C Eddy component of vertical flux (interior component only) -> fVrUp & fVrDw |
C Eddy component of vertical flux (interior component only) -> fVrUp & fVrDw |
722 |
IF (.NOT.implicitViscosity) THEN |
IF (.NOT.implicitViscosity) THEN |
725 |
ENDIF |
ENDIF |
726 |
|
|
727 |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
728 |
|
C anelastic: hor.visc.fluxes are not scaled by rhoFac (by vert.visc.flx is) |
729 |
DO j=jMin,jMax |
DO j=jMin,jMax |
730 |
DO i=iMin,iMax |
DO i=iMin,iMax |
731 |
gvDiss(i,j) = |
gvDiss(i,j) = |
734 |
& ( 0.5 _d 0*(_rA(i,j,bi,bj)+_rA(i,j-1,bi,bj)) ) |
& ( 0.5 _d 0*(_rA(i,j,bi,bj)+_rA(i,j-1,bi,bj)) ) |
735 |
#else |
#else |
736 |
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k) |
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k) |
737 |
& *recip_rAs(i,j,bi,bj) |
& *recip_rAs(i,j,bi,bj)*recip_deepFac2C(k) |
738 |
#endif |
#endif |
739 |
& *( ( fZon(i+1,j) - fZon(i,j ) )*AhDvdxFac |
& *( ( fZon(i+1,j) - fZon(i,j ) )*AhDvdxFac |
740 |
& +( fMer(i, j) - fMer(i,j-1) )*AhDvdyFac |
& +( fMer(i, j) - fMer(i,j-1) )*AhDvdyFac |
741 |
& +( fVrDw(i,j) - fVrUp(i,j) )*rkSign*ArDvdrFac |
& +( fVrDw(i,j) - fVrUp(i,j) )*rkSign*ArDvdrFac |
742 |
|
& *recip_rhoFacC(k) |
743 |
& ) |
& ) |
744 |
ENDDO |
ENDDO |
745 |
ENDDO |
ENDDO |
746 |
|
|
747 |
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
#ifdef ALLOW_DIAGNOSTICS |
748 |
IF (no_slip_sides) THEN |
IF ( useDiagnostics ) THEN |
749 |
|
CALL DIAGNOSTICS_FILL(fZon, 'VISCx_Vm',k,1,2,bi,bj,myThid) |
750 |
|
CALL DIAGNOSTICS_FILL(fMer, 'VISCy_Vm',k,1,2,bi,bj,myThid) |
751 |
|
IF (.NOT.implicitViscosity) |
752 |
|
& CALL DIAGNOSTICS_FILL(fVrUp,'VISrE_Vm',k,1,2,bi,bj,myThid) |
753 |
|
ENDIF |
754 |
|
#endif |
755 |
|
|
756 |
|
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
757 |
|
IF (no_slip_sides) THEN |
758 |
C- No-slip BCs impose a drag at walls... |
C- No-slip BCs impose a drag at walls... |
759 |
CALL MOM_V_SIDEDRAG(bi,bj,k,vFld,v4F,hFacZ,vF,myThid) |
CALL MOM_V_SIDEDRAG( |
760 |
|
I bi,bj,k, |
761 |
|
I vFld, v4f, hFacZ, |
762 |
|
I viscAh_Z,viscA4_Z, |
763 |
|
I harmonic,biharmonic,useVariableViscosity, |
764 |
|
O vF, |
765 |
|
I myThid) |
766 |
DO j=jMin,jMax |
DO j=jMin,jMax |
767 |
DO i=iMin,iMax |
DO i=iMin,iMax |
768 |
gvDiss(i,j) = gvDiss(i,j) + vF(i,j) |
gvDiss(i,j) = gvDiss(i,j) + vF(i,j) |
779 |
ENDDO |
ENDDO |
780 |
ENDIF |
ENDIF |
781 |
|
|
782 |
|
#ifdef ALLOW_SHELFICE |
783 |
|
IF (useShelfIce) THEN |
784 |
|
CALL SHELFICE_V_DRAG(bi,bj,k,vFld,KE,KappaRU,vF,myThid) |
785 |
|
DO j=jMin,jMax |
786 |
|
DO i=iMin,iMax |
787 |
|
gvDiss(i,j) = gvDiss(i,j) + vF(i,j) |
788 |
|
ENDDO |
789 |
|
ENDDO |
790 |
|
ENDIF |
791 |
|
#endif /* ALLOW_SHELFICE */ |
792 |
|
|
793 |
C- endif momViscosity |
C- endif momViscosity |
794 |
ENDIF |
ENDIF |
795 |
|
|
801 |
|
|
802 |
C-- Metric terms for curvilinear grid systems |
C-- Metric terms for curvilinear grid systems |
803 |
IF (useNHMTerms) THEN |
IF (useNHMTerms) THEN |
804 |
C o Spherical polar grid metric terms |
C o Non-Hydrostatic (spherical) metric terms |
805 |
CALL MOM_V_METRIC_NH(bi,bj,k,vFld,wVel,mT,myThid) |
CALL MOM_V_METRIC_NH(bi,bj,k,vFld,wVel,mT,myThid) |
806 |
DO j=jMin,jMax |
DO j=jMin,jMax |
807 |
DO i=iMin,iMax |
DO i=iMin,iMax |
808 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+mTFacV*mT(i,j) |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+mtNHFacV*mT(i,j) |
809 |
ENDDO |
ENDDO |
810 |
ENDDO |
ENDDO |
811 |
ENDIF |
ENDIF |
812 |
IF (usingSphericalPolarMTerms) THEN |
IF ( usingSphericalPolarGrid .AND. metricTerms ) THEN |
813 |
|
C o Spherical polar grid metric terms |
814 |
CALL MOM_V_METRIC_SPHERE(bi,bj,k,uFld,mT,myThid) |
CALL MOM_V_METRIC_SPHERE(bi,bj,k,uFld,mT,myThid) |
815 |
DO j=jMin,jMax |
DO j=jMin,jMax |
816 |
DO i=iMin,iMax |
DO i=iMin,iMax |
817 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+mTFacV*mT(i,j) |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+mtFacV*mT(i,j) |
818 |
ENDDO |
ENDDO |
819 |
ENDDO |
ENDDO |
820 |
ENDIF |
ENDIF |
821 |
IF (usingCylindricalGrid) THEN |
IF ( usingCylindricalGrid .AND. metricTerms ) THEN |
822 |
CALL MOM_V_METRIC_CYLINDER(bi,bj,k,uFld,vFld,mT,myThid) |
C o Cylindrical grid metric terms |
823 |
DO j=jMin,jMax |
CALL MOM_V_METRIC_CYLINDER(bi,bj,k,uFld,vFld,mT,myThid) |
824 |
DO i=iMin,iMax |
DO j=jMin,jMax |
825 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+mTFacV*mT(i,j) |
DO i=iMin,iMax |
826 |
ENDDO |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+mtFacV*mT(i,j) |
827 |
ENDDO |
ENDDO |
828 |
|
ENDDO |
829 |
ENDIF |
ENDIF |
830 |
|
|
831 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
842 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+fuFac*cf(i,j) |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+fuFac*cf(i,j) |
843 |
ENDDO |
ENDDO |
844 |
ENDDO |
ENDDO |
845 |
|
#ifdef ALLOW_DIAGNOSTICS |
846 |
|
IF ( useDiagnostics ) |
847 |
|
& CALL DIAGNOSTICS_FILL(cf,'Um_Cori ',k,1,2,bi,bj,myThid) |
848 |
|
#endif |
849 |
CALL MOM_V_CORIOLIS(bi,bj,k,uFld,cf,myThid) |
CALL MOM_V_CORIOLIS(bi,bj,k,uFld,cf,myThid) |
850 |
DO j=jMin,jMax |
DO j=jMin,jMax |
851 |
DO i=iMin,iMax |
DO i=iMin,iMax |
852 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+fvFac*cf(i,j) |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+fvFac*cf(i,j) |
853 |
ENDDO |
ENDDO |
854 |
ENDDO |
ENDDO |
855 |
|
#ifdef ALLOW_DIAGNOSTICS |
856 |
|
IF ( useDiagnostics ) |
857 |
|
& CALL DIAGNOSTICS_FILL(cf,'Vm_Cori ',k,1,2,bi,bj,myThid) |
858 |
|
#endif |
859 |
ENDIF |
ENDIF |
860 |
|
|
861 |
IF (nonHydrostatic.OR.quasiHydrostatic) THEN |
C-- 3.D Coriolis term (horizontal momentum, Eastward component: -fprime*w) |
862 |
CALL MOM_U_CORIOLIS_NH(bi,bj,k,wVel,cf,myThid) |
IF ( use3dCoriolis ) THEN |
863 |
DO j=jMin,jMax |
CALL MOM_U_CORIOLIS_NH(bi,bj,k,wVel,cf,myThid) |
864 |
DO i=iMin,iMax |
DO j=jMin,jMax |
865 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+fuFac*cf(i,j) |
DO i=iMin,iMax |
866 |
|
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+fuFac*cf(i,j) |
867 |
|
ENDDO |
868 |
ENDDO |
ENDDO |
869 |
ENDDO |
IF ( usingCurvilinearGrid ) THEN |
870 |
|
C- presently, non zero angleSinC array only supported with Curvilinear-Grid |
871 |
|
CALL MOM_V_CORIOLIS_NH(bi,bj,k,wVel,cf,myThid) |
872 |
|
DO j=jMin,jMax |
873 |
|
DO i=iMin,iMax |
874 |
|
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+fvFac*cf(i,j) |
875 |
|
ENDDO |
876 |
|
ENDDO |
877 |
|
ENDIF |
878 |
ENDIF |
ENDIF |
879 |
|
|
880 |
C-- Set du/dt & dv/dt on boundaries to zero |
C-- Set du/dt & dv/dt on boundaries to zero |
887 |
ENDDO |
ENDDO |
888 |
ENDDO |
ENDDO |
889 |
|
|
890 |
|
#ifdef ALLOW_DIAGNOSTICS |
891 |
|
IF ( useDiagnostics ) THEN |
892 |
|
CALL DIAGNOSTICS_FILL(KE, 'momKE ',k,1,2,bi,bj,myThid) |
893 |
|
CALL DIAGNOSTICS_FILL(gU(1-OLx,1-OLy,k,bi,bj), |
894 |
|
& 'Um_Advec',k,1,2,bi,bj,myThid) |
895 |
|
CALL DIAGNOSTICS_FILL(gV(1-OLx,1-OLy,k,bi,bj), |
896 |
|
& 'Vm_Advec',k,1,2,bi,bj,myThid) |
897 |
|
IF (momViscosity) THEN |
898 |
|
CALL DIAGNOSTICS_FILL(guDiss,'Um_Diss ',k,1,2,bi,bj,myThid) |
899 |
|
CALL DIAGNOSTICS_FILL(gvDiss,'Vm_Diss ',k,1,2,bi,bj,myThid) |
900 |
|
ENDIF |
901 |
|
ENDIF |
902 |
|
#endif /* ALLOW_DIAGNOSTICS */ |
903 |
|
|
904 |
RETURN |
RETURN |
905 |
END |
END |