35 |
I bi,bj,iMin,iMax,jMin,jMax,k,kUp,kDown, |
I bi,bj,iMin,iMax,jMin,jMax,k,kUp,kDown, |
36 |
I phi_hyd,KappaRU,KappaRV, |
I phi_hyd,KappaRU,KappaRV, |
37 |
U fVerU, fVerV, |
U fVerU, fVerV, |
38 |
I myCurrentTime,myIter,myThid) |
I myTime,myIter,myThid) |
39 |
|
|
40 |
C !DESCRIPTION: |
C !DESCRIPTION: |
41 |
C Calculates all the horizontal accelerations except for the implicit surface |
C Calculates all the horizontal accelerations except for the implicit surface |
63 |
C KappaRV :: vertical viscosity |
C KappaRV :: vertical viscosity |
64 |
C fVerU :: vertical flux of U, 2 1/2 dim for pipe-lining |
C fVerU :: vertical flux of U, 2 1/2 dim for pipe-lining |
65 |
C fVerV :: vertical flux of V, 2 1/2 dim for pipe-lining |
C fVerV :: vertical flux of V, 2 1/2 dim for pipe-lining |
66 |
C myCurrentTime :: current time |
C myTime :: current time |
67 |
C myIter :: current time-step number |
C myIter :: current time-step number |
68 |
C myThid :: thread number |
C myThid :: thread number |
69 |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
73 |
_RL KappaRV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL KappaRV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
74 |
_RL fVerU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
75 |
_RL fVerV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
76 |
_RL myCurrentTime |
_RL myTime |
77 |
INTEGER myIter |
INTEGER myIter |
78 |
INTEGER myThid |
INTEGER myThid |
79 |
|
|
119 |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
120 |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
121 |
_RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
122 |
|
_RL rTransU(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
123 |
|
_RL rTransV(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
124 |
C I,J,K - Loop counters |
C I,J,K - Loop counters |
125 |
C rVelMaskOverride - Factor for imposing special surface boundary conditions |
C rVelMaskOverride - Factor for imposing special surface boundary conditions |
126 |
C ( set according to free-surface condition ). |
C ( set according to free-surface condition ). |
176 |
pF(i,j) = 0. |
pF(i,j) = 0. |
177 |
fZon(i,j) = 0. |
fZon(i,j) = 0. |
178 |
fMer(i,j) = 0. |
fMer(i,j) = 0. |
179 |
|
rTransU(i,j) = 0. |
180 |
|
rTransV(i,j) = 0. |
181 |
ENDDO |
ENDDO |
182 |
ENDDO |
ENDDO |
183 |
|
|
254 |
|
|
255 |
CALL MOM_CALC_KE(bi,bj,k,uFld,vFld,KE,myThid) |
CALL MOM_CALC_KE(bi,bj,k,uFld,vFld,KE,myThid) |
256 |
|
|
257 |
|
C--- First call (k=1): compute vertical adv. flux fVerU(kUp) & fVerV(kUp) |
258 |
|
IF (momAdvection.AND.k.EQ.1) THEN |
259 |
|
|
260 |
|
C- Calculate vertical transports above U & V points (West & South face): |
261 |
|
CALL MOM_CALC_RTRANS( k, bi, bj, |
262 |
|
O rTransU, rTransV, |
263 |
|
I myTime, myIter, myThid) |
264 |
|
|
265 |
|
C- Free surface correction term (flux at k=1) |
266 |
|
CALL MOM_U_ADV_WU(bi,bj,k,uVel,wVel,rTransU,af,myThid) |
267 |
|
DO j=jMin,jMax |
268 |
|
DO i=iMin,iMax |
269 |
|
fVerU(i,j,kUp) = af(i,j) |
270 |
|
ENDDO |
271 |
|
ENDDO |
272 |
|
|
273 |
|
CALL MOM_V_ADV_WV(bi,bj,k,vVel,wVel,rTransV,af,myThid) |
274 |
|
DO j=jMin,jMax |
275 |
|
DO i=iMin,iMax |
276 |
|
fVerV(i,j,kUp) = af(i,j) |
277 |
|
ENDDO |
278 |
|
ENDDO |
279 |
|
|
280 |
|
C--- endif momAdvection & k=1 |
281 |
|
ENDIF |
282 |
|
|
283 |
|
|
284 |
|
C--- Calculate vertical transports (at k+1) below U & V points : |
285 |
|
IF (momAdvection) THEN |
286 |
|
CALL MOM_CALC_RTRANS( k+1, bi, bj, |
287 |
|
O rTransU, rTransV, |
288 |
|
I myTime, myIter, myThid) |
289 |
|
ENDIF |
290 |
|
|
291 |
|
|
292 |
C---- Zonal momentum equation starts here |
C---- Zonal momentum equation starts here |
293 |
|
|
294 |
C Bi-harmonic term del^2 U -> v4F |
C Bi-harmonic term del^2 U -> v4F |
333 |
|
|
334 |
C-- Vertical flux (fVer is at upper face of "u" cell) |
C-- Vertical flux (fVer is at upper face of "u" cell) |
335 |
|
|
|
C-- Free surface correction term (flux at k=1) |
|
|
IF (momAdvection.AND.k.EQ.1) THEN |
|
|
CALL MOM_U_ADV_WU(bi,bj,k,uVel,wVel,af,myThid) |
|
|
DO j=jMin,jMax |
|
|
DO i=iMin,iMax |
|
|
fVerU(i,j,kUp) = af(i,j) |
|
|
ENDDO |
|
|
ENDDO |
|
|
ENDIF |
|
336 |
C Mean flow component of vertical flux (at k+1) -> aF |
C Mean flow component of vertical flux (at k+1) -> aF |
337 |
IF (momAdvection) |
IF (momAdvection) |
338 |
& CALL MOM_U_ADV_WU(bi,bj,k+1,uVel,wVel,af,myThid) |
& CALL MOM_U_ADV_WU(bi,bj,k+1,uVel,wVel,rTransU,af,myThid) |
339 |
|
|
340 |
C Eddy component of vertical flux (interior component only) -> vrF |
C Eddy component of vertical flux (interior component only) -> vrF |
341 |
IF (momViscosity.AND..NOT.implicitViscosity) |
IF (momViscosity.AND..NOT.implicitViscosity) |
377 |
ENDDO |
ENDDO |
378 |
ENDDO |
ENDDO |
379 |
|
|
380 |
|
#ifdef NONLIN_FRSURF |
381 |
|
C-- account for 3.D divergence of the flow in rStar coordinate: |
382 |
|
IF ( momAdvection .AND. select_rStar.GT.0 ) THEN |
383 |
|
DO j=jMin,jMax |
384 |
|
DO i=iMin,iMax |
385 |
|
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj) |
386 |
|
& - (rStarExpW(i,j,bi,bj) - 1. _d 0)/deltaTfreesurf |
387 |
|
& *uVel(i,j,k,bi,bj) |
388 |
|
ENDDO |
389 |
|
ENDDO |
390 |
|
ENDIF |
391 |
|
IF ( momAdvection .AND. select_rStar.LT.0 ) THEN |
392 |
|
DO j=jMin,jMax |
393 |
|
DO i=iMin,iMax |
394 |
|
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj) |
395 |
|
& - rStarDhWDt(i,j,bi,bj)*uVel(i,j,k,bi,bj) |
396 |
|
ENDDO |
397 |
|
ENDDO |
398 |
|
ENDIF |
399 |
|
#endif /* NONLIN_FRSURF */ |
400 |
|
|
401 |
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 |
402 |
IF (momViscosity.AND.no_slip_sides) THEN |
IF (momViscosity.AND.no_slip_sides) THEN |
403 |
C- No-slip BCs impose a drag at walls... |
C- No-slip BCs impose a drag at walls... |
422 |
IF (momForcing) |
IF (momForcing) |
423 |
& CALL EXTERNAL_FORCING_U( |
& CALL EXTERNAL_FORCING_U( |
424 |
I iMin,iMax,jMin,jMax,bi,bj,k, |
I iMin,iMax,jMin,jMax,bi,bj,k, |
425 |
I myCurrentTime,myThid) |
I myTime,myThid) |
426 |
|
|
427 |
C-- Metric terms for curvilinear grid systems |
C-- Metric terms for curvilinear grid systems |
428 |
IF (useNHMTerms) THEN |
IF (useNHMTerms) THEN |
495 |
|
|
496 |
C-- Vertical flux (fVer is at upper face of "v" cell) |
C-- Vertical flux (fVer is at upper face of "v" cell) |
497 |
|
|
|
C-- Free surface correction term (flux at k=1) |
|
|
IF (momAdvection.AND.k.EQ.1) THEN |
|
|
CALL MOM_V_ADV_WV(bi,bj,k,vVel,wVel,af,myThid) |
|
|
DO j=jMin,jMax |
|
|
DO i=iMin,iMax |
|
|
fVerV(i,j,kUp) = af(i,j) |
|
|
ENDDO |
|
|
ENDDO |
|
|
ENDIF |
|
498 |
C o Mean flow component of vertical flux |
C o Mean flow component of vertical flux |
499 |
IF (momAdvection) |
IF (momAdvection) |
500 |
& CALL MOM_V_ADV_WV(bi,bj,k+1,vVel,wVel,af,myThid) |
& CALL MOM_V_ADV_WV(bi,bj,k+1,vVel,wVel,rTransV,af,myThid) |
501 |
|
|
502 |
C Eddy component of vertical flux (interior component only) -> vrF |
C Eddy component of vertical flux (interior component only) -> vrF |
503 |
IF (momViscosity.AND..NOT.implicitViscosity) |
IF (momViscosity.AND..NOT.implicitViscosity) |
539 |
ENDDO |
ENDDO |
540 |
ENDDO |
ENDDO |
541 |
|
|
542 |
|
#ifdef NONLIN_FRSURF |
543 |
|
C-- account for 3.D divergence of the flow in rStar coordinate: |
544 |
|
IF ( momAdvection .AND. select_rStar.GT.0 ) THEN |
545 |
|
DO j=jMin,jMax |
546 |
|
DO i=iMin,iMax |
547 |
|
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj) |
548 |
|
& - (rStarExpS(i,j,bi,bj) - 1. _d 0)/deltaTfreesurf |
549 |
|
& *vVel(i,j,k,bi,bj) |
550 |
|
ENDDO |
551 |
|
ENDDO |
552 |
|
ENDIF |
553 |
|
IF ( momAdvection .AND. select_rStar.LT.0 ) THEN |
554 |
|
DO j=jMin,jMax |
555 |
|
DO i=iMin,iMax |
556 |
|
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj) |
557 |
|
& - rStarDhSDt(i,j,bi,bj)*vVel(i,j,k,bi,bj) |
558 |
|
ENDDO |
559 |
|
ENDDO |
560 |
|
ENDIF |
561 |
|
#endif /* NONLIN_FRSURF */ |
562 |
|
|
563 |
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 |
564 |
IF (momViscosity.AND.no_slip_sides) THEN |
IF (momViscosity.AND.no_slip_sides) THEN |
565 |
C- No-slip BCs impose a drag at walls... |
C- No-slip BCs impose a drag at walls... |
584 |
IF (momForcing) |
IF (momForcing) |
585 |
& CALL EXTERNAL_FORCING_V( |
& CALL EXTERNAL_FORCING_V( |
586 |
I iMin,iMax,jMin,jMax,bi,bj,k, |
I iMin,iMax,jMin,jMax,bi,bj,k, |
587 |
I myCurrentTime,myThid) |
I myTime,myThid) |
588 |
|
|
589 |
C-- Metric terms for curvilinear grid systems |
C-- Metric terms for curvilinear grid systems |
590 |
IF (useNHMTerms) THEN |
IF (useNHMTerms) THEN |
630 |
ENDDO |
ENDDO |
631 |
ENDDO |
ENDDO |
632 |
#endif /* INCLUDE_CD_CODE */ |
#endif /* INCLUDE_CD_CODE */ |
633 |
IF (nonHydrostatic) THEN |
IF (nonHydrostatic.OR.quasiHydrostatic) THEN |
634 |
CALL MOM_U_CORIOLIS_NH(bi,bj,k,wVel,cf,myThid) |
CALL MOM_U_CORIOLIS_NH(bi,bj,k,wVel,cf,myThid) |
635 |
DO j=jMin,jMax |
DO j=jMin,jMax |
636 |
DO i=iMin,iMax |
DO i=iMin,iMax |