5 |
C /==========================================================\ |
C /==========================================================\ |
6 |
C | S/R CALC_DIV_GHAT | |
C | S/R CALC_DIV_GHAT | |
7 |
C | o Form the right hand-side of the surface pressure eqn. | |
C | o Form the right hand-side of the surface pressure eqn. | |
8 |
|
C |==========================================================| |
9 |
C \==========================================================/ |
C \==========================================================/ |
10 |
SUBROUTINE CALC_DIV_GHAT( |
SUBROUTINE CALC_DIV_GHAT( |
11 |
I bi,bj,iMin,iMax,jMin,jMax, |
I bi,bj,iMin,iMax,jMin,jMax, |
28 |
#endif |
#endif |
29 |
|
|
30 |
C == Routine arguments == |
C == Routine arguments == |
|
C pH - Hydrostatic pressure |
|
31 |
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 |
32 |
C results will be set. |
C results will be set. |
33 |
C kUp, kDown, kM1 - Index for upper and lower layers. |
C k - Index of layer. |
34 |
|
C xA, yA - Cell face areas |
35 |
C myThid - Instance number for this innvocation of CALC_MOM_RHS |
C myThid - Instance number for this innvocation of CALC_MOM_RHS |
36 |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
37 |
INTEGER K |
INTEGER K |
50 |
|
|
51 |
IF ( k .EQ. Nr ) THEN |
IF ( k .EQ. Nr ) THEN |
52 |
C Initialise source term on first pass |
C Initialise source term on first pass |
53 |
DO j=jMin,jMax |
DO j=1,sNy |
54 |
DO i=iMin,iMax |
DO i=1,sNx |
55 |
C cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj) |
C Note: The source term containing cg2d_x and cg3d_x (at k=1) |
56 |
C & -freeSurfFac*_rA(i,j,bi,bj)* |
C has been moved to solve_for_pressure.F for convenience. |
|
C & cg2d_x(I ,J ,bi,bj)/deltaTMom/deltaTMom |
|
57 |
cg2d_b(i,j,bi,bj) = |
cg2d_b(i,j,bi,bj) = |
58 |
& freeSurfFac*_rA(i,j,bi,bj)*horiVertRatio*( |
& freeSurfFac*_rA(i,j,bi,bj)*horiVertRatio*( 0. |
|
& -cg2d_x(I,J,bi,bj)/deltaTMom/deltaTMom |
|
59 |
#ifdef USE_NATURAL_BCS |
#ifdef USE_NATURAL_BCS |
60 |
& +EmPmR(I,J,bi,bj)/deltaTMom |
& +EmPmR(I,J,bi,bj)/deltaTMom |
61 |
#endif |
#endif |
64 |
ENDDO |
ENDDO |
65 |
ENDIF |
ENDIF |
66 |
|
|
67 |
DO j=jMin,jMax |
DO j=1,sNy |
68 |
DO i=iMin,iMax |
DO i=1,sNx+1 |
69 |
pf(i,j) = xA(i,j)*gUNm1(i,j,k,bi,bj) / deltaTmom |
pf(i,j) = xA(i,j)*gUNm1(i,j,k,bi,bj) / deltaTmom |
70 |
ENDDO |
ENDDO |
71 |
ENDDO |
ENDDO |
86 |
ENDIF |
ENDIF |
87 |
#endif |
#endif |
88 |
|
|
89 |
DO j=jMin,jMax |
DO j=1,sNy+1 |
90 |
DO i=iMin,iMax |
DO i=1,sNx |
91 |
pf(i,j) = yA(i,j)*gVNm1(i,j,k,bi,bj) / deltatmom |
pf(i,j) = yA(i,j)*gVNm1(i,j,k,bi,bj) / deltatmom |
92 |
ENDDO |
ENDDO |
93 |
ENDDO |
ENDDO |