25 |
C stresses as well as internal viscous stresses. |
C stresses as well as internal viscous stresses. |
26 |
CEOI |
CEOI |
27 |
|
|
28 |
#include "CPP_OPTIONS.h" |
#include "MOM_FLUXFORM_OPTIONS.h" |
29 |
|
|
30 |
CBOP |
CBOP |
31 |
C !ROUTINE: MOM_FLUXFORM |
C !ROUTINE: MOM_FLUXFORM |
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 phi_hyd,dPhihydX,dPhiHydY,KappaRU,KappaRV, |
I dPhihydX,dPhiHydY,KappaRU,KappaRV, |
37 |
U fVerU, fVerV, |
U fVerU, fVerV, |
38 |
I myTime,myIter,myThid) |
I myTime,myIter,myThid) |
39 |
|
|
58 |
C k :: vertical level |
C k :: vertical level |
59 |
C kUp :: =1 or 2 for consecutive k |
C kUp :: =1 or 2 for consecutive k |
60 |
C kDown :: =2 or 1 for consecutive k |
C kDown :: =2 or 1 for consecutive k |
|
C phi_hyd :: hydrostatic pressure (perturbation) |
|
61 |
C dPhiHydX,Y :: Gradient (X & Y dir.) of Hydrostatic Potential |
C dPhiHydX,Y :: Gradient (X & Y dir.) of Hydrostatic Potential |
62 |
C KappaRU :: vertical viscosity |
C KappaRU :: vertical viscosity |
63 |
C KappaRV :: vertical viscosity |
C KappaRV :: vertical viscosity |
68 |
C myThid :: thread number |
C myThid :: thread number |
69 |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
70 |
INTEGER k,kUp,kDown |
INTEGER k,kUp,kDown |
|
_RL phi_hyd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
|
71 |
_RL dPhiHydX(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL dPhiHydX(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
72 |
_RL dPhiHydY(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL dPhiHydY(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
73 |
_RL KappaRU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL KappaRU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
179 |
fMer(i,j) = 0. |
fMer(i,j) = 0. |
180 |
rTransU(i,j) = 0. |
rTransU(i,j) = 0. |
181 |
rTransV(i,j) = 0. |
rTransV(i,j) = 0. |
182 |
|
fVerU(i,j,1) = 0. _d 0 |
183 |
|
fVerU(i,j,2) = 0. _d 0 |
184 |
|
fVerV(i,j,1) = 0. _d 0 |
185 |
|
fVerV(i,j,2) = 0. _d 0 |
186 |
ENDDO |
ENDDO |
187 |
ENDDO |
ENDDO |
188 |
|
|
297 |
C---- Zonal momentum equation starts here |
C---- Zonal momentum equation starts here |
298 |
|
|
299 |
C Bi-harmonic term del^2 U -> v4F |
C Bi-harmonic term del^2 U -> v4F |
300 |
IF (momViscosity) |
IF (momViscosity .AND. viscA4.NE.0. ) |
301 |
& CALL MOM_U_DEL2U(bi,bj,k,uFld,hFacZ,v4f,myThid) |
& CALL MOM_U_DEL2U(bi,bj,k,uFld,hFacZ,v4f,myThid) |
302 |
|
|
303 |
C--- Calculate mean and eddy fluxes between cells for zonal flow. |
C--- Calculate mean and eddy fluxes between cells for zonal flow. |
330 |
& CALL MOM_U_YVISCFLUX(bi,bj,k,uFld,v4F,hFacZ,vF,myThid) |
& CALL MOM_U_YVISCFLUX(bi,bj,k,uFld,v4F,hFacZ,vF,myThid) |
331 |
|
|
332 |
C Combine fluxes -> fMer |
C Combine fluxes -> fMer |
333 |
DO j=jMin,jMax |
DO j=jMin,jMax+1 |
334 |
DO i=iMin,iMax |
DO i=iMin,iMax |
335 |
fMer(i,j) = vDudyFac*aF(i,j) + AhDudyFac*vF(i,j) |
fMer(i,j) = vDudyFac*aF(i,j) + AhDudyFac*vF(i,j) |
336 |
ENDDO |
ENDDO |
413 |
ENDDO |
ENDDO |
414 |
ENDIF |
ENDIF |
415 |
|
|
416 |
C-- Forcing term |
C-- Forcing term (moved to timestep.F) |
417 |
IF (momForcing) |
c IF (momForcing) |
418 |
& CALL EXTERNAL_FORCING_U( |
c & CALL EXTERNAL_FORCING_U( |
419 |
I iMin,iMax,jMin,jMax,bi,bj,k, |
c I iMin,iMax,jMin,jMax,bi,bj,k, |
420 |
I myTime,myThid) |
c I myTime,myThid) |
421 |
|
|
422 |
C-- Metric terms for curvilinear grid systems |
C-- Metric terms for curvilinear grid systems |
423 |
IF (useNHMTerms) THEN |
IF (useNHMTerms) THEN |
449 |
C---- Meridional momentum equation starts here |
C---- Meridional momentum equation starts here |
450 |
|
|
451 |
C Bi-harmonic term del^2 V -> v4F |
C Bi-harmonic term del^2 V -> v4F |
452 |
IF (momViscosity) |
IF (momViscosity .AND. viscA4.NE.0. ) |
453 |
& CALL MOM_V_DEL2V(bi,bj,k,vFld,hFacZ,v4f,myThid) |
& CALL MOM_V_DEL2V(bi,bj,k,vFld,hFacZ,v4f,myThid) |
454 |
|
|
455 |
C--- Calculate mean and eddy fluxes between cells for meridional flow. |
C--- Calculate mean and eddy fluxes between cells for meridional flow. |
466 |
|
|
467 |
C Combine fluxes -> fZon |
C Combine fluxes -> fZon |
468 |
DO j=jMin,jMax |
DO j=jMin,jMax |
469 |
DO i=iMin,iMax |
DO i=iMin,iMax+1 |
470 |
fZon(i,j) = uDvdxFac*aF(i,j) + AhDvdxFac*vF(i,j) |
fZon(i,j) = uDvdxFac*aF(i,j) + AhDvdxFac*vF(i,j) |
471 |
ENDDO |
ENDDO |
472 |
ENDDO |
ENDDO |
565 |
ENDDO |
ENDDO |
566 |
ENDIF |
ENDIF |
567 |
|
|
568 |
C-- Forcing term |
C-- Forcing term (moved to timestep.F) |
569 |
IF (momForcing) |
c IF (momForcing) |
570 |
& CALL EXTERNAL_FORCING_V( |
c & CALL EXTERNAL_FORCING_V( |
571 |
I iMin,iMax,jMin,jMax,bi,bj,k, |
c I iMin,iMax,jMin,jMax,bi,bj,k, |
572 |
I myTime,myThid) |
c I myTime,myThid) |
573 |
|
|
574 |
C-- Metric terms for curvilinear grid systems |
C-- Metric terms for curvilinear grid systems |
575 |
IF (useNHMTerms) THEN |
IF (useNHMTerms) THEN |
599 |
|
|
600 |
C-- Coriolis term |
C-- Coriolis term |
601 |
C Note. As coded here, coriolis will not work with "thin walls" |
C Note. As coded here, coriolis will not work with "thin walls" |
602 |
#ifdef INCLUDE_CD_CODE |
c IF (useCDscheme) THEN |
603 |
CALL MOM_CDSCHEME(bi,bj,k,phi_hyd,dPhiHydX,dPhiHydY,myThid) |
c CALL MOM_CDSCHEME(bi,bj,k,dPhiHydX,dPhiHydY,myThid) |
604 |
#else |
c ELSE |
605 |
CALL MOM_U_CORIOLIS(bi,bj,k,vFld,cf,myThid) |
IF (.NOT.useCDscheme) THEN |
606 |
DO j=jMin,jMax |
CALL MOM_U_CORIOLIS(bi,bj,k,vFld,cf,myThid) |
607 |
DO i=iMin,iMax |
DO j=jMin,jMax |
608 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+fuFac*cf(i,j) |
DO i=iMin,iMax |
609 |
ENDDO |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+fuFac*cf(i,j) |
610 |
ENDDO |
ENDDO |
611 |
CALL MOM_V_CORIOLIS(bi,bj,k,uFld,cf,myThid) |
ENDDO |
612 |
DO j=jMin,jMax |
CALL MOM_V_CORIOLIS(bi,bj,k,uFld,cf,myThid) |
613 |
DO i=iMin,iMax |
DO j=jMin,jMax |
614 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+fvFac*cf(i,j) |
DO i=iMin,iMax |
615 |
ENDDO |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+fvFac*cf(i,j) |
616 |
ENDDO |
ENDDO |
617 |
#endif /* INCLUDE_CD_CODE */ |
ENDDO |
618 |
|
ENDIF |
619 |
|
|
620 |
IF (nonHydrostatic.OR.quasiHydrostatic) THEN |
IF (nonHydrostatic.OR.quasiHydrostatic) THEN |
621 |
CALL MOM_U_CORIOLIS_NH(bi,bj,k,wVel,cf,myThid) |
CALL MOM_U_CORIOLIS_NH(bi,bj,k,wVel,cf,myThid) |
622 |
DO j=jMin,jMax |
DO j=jMin,jMax |