55 |
DO i=1,sNx |
DO i=1,sNx |
56 |
C Note: The source term containing cg2d_x and cg3d_x (at k=1) |
C Note: The source term containing cg2d_x and cg3d_x (at k=1) |
57 |
C has been moved to solve_for_pressure.F for convenience. |
C has been moved to solve_for_pressure.F for convenience. |
58 |
cg2d_b(i,j,bi,bj) = |
cg2d_b(i,j,bi,bj) = 0. |
|
& freeSurfFac*_rA(i,j,bi,bj)*horiVertRatio*( 0. |
|
59 |
#ifdef USE_NATURAL_BCS |
#ifdef USE_NATURAL_BCS |
60 |
& +EmPmR(I,J,bi,bj)/deltaTMom |
& + freeSurfFac*_rA(i,j,bi,bj)*horiVertRatio* |
61 |
|
& EmPmR(I,J,bi,bj)/deltaTMom |
62 |
#endif |
#endif |
|
& ) |
|
63 |
ENDDO |
ENDDO |
64 |
ENDDO |
ENDDO |
65 |
ENDIF |
ENDIF |
66 |
|
|
67 |
DO j=1,sNy |
IF (implicDiv2Dflow.EQ.1.) then |
68 |
DO i=1,sNx+1 |
C Fully Implicit treatment of the Barotropic Flow Divergence |
69 |
pf(i,j) = xA(i,j)*gUNm1(i,j,k,bi,bj) / deltaTmom |
DO j=1,sNy |
70 |
ENDDO |
DO i=1,sNx+1 |
71 |
ENDDO |
pf(i,j) = xA(i,j)*gUNm1(i,j,k,bi,bj) / deltaTmom |
72 |
|
ENDDO |
73 |
|
ENDDO |
74 |
|
ELSE |
75 |
|
C Explicit+Implicit part of the Barotropic Flow Divergence |
76 |
|
C => Filtering of uVel,vVel is necessary |
77 |
|
#ifdef ALLOW_ZONAL_FILT |
78 |
|
IF (zonal_filt_lat.LT.90.) THEN |
79 |
|
CALL ZONAL_FILTER( |
80 |
|
& uVel, hFacW, 1-1, sNy+1, k, k, bi, bj, 1, myThid) |
81 |
|
CALL ZONAL_FILTER( |
82 |
|
& vVel, hFacS, 1-1, sNy+1, k, k, bi, bj, 2, myThid) |
83 |
|
ENDIF |
84 |
|
#endif |
85 |
|
DO j=1,sNy |
86 |
|
DO i=1,sNx+1 |
87 |
|
pf(i,j) = ( implicDiv2Dflow * gUNm1(i,j,k,bi,bj) |
88 |
|
& + (1.-implicDiv2Dflow) * uVel(i,j,k,bi,bj) |
89 |
|
& ) * xA(i,j) / deltaTmom |
90 |
|
ENDDO |
91 |
|
ENDDO |
92 |
|
ENDIF |
93 |
DO j=1,sNy |
DO j=1,sNy |
94 |
DO i=1,sNx |
DO i=1,sNx |
95 |
cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj) + |
cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj) + |
107 |
ENDIF |
ENDIF |
108 |
#endif |
#endif |
109 |
|
|
110 |
DO j=1,sNy+1 |
IF (implicDiv2Dflow.EQ.1.) then |
111 |
DO i=1,sNx |
C Fully Implicit treatment of the Barotropic Flow Divergence |
112 |
pf(i,j) = yA(i,j)*gVNm1(i,j,k,bi,bj) / deltatmom |
DO j=1,sNy+1 |
113 |
ENDDO |
DO i=1,sNx |
114 |
ENDDO |
pf(i,j) = yA(i,j)*gVNm1(i,j,k,bi,bj) / deltatmom |
115 |
|
ENDDO |
116 |
|
ENDDO |
117 |
|
ELSE |
118 |
|
C Explicit+Implicit part of the Barotropic Flow Divergence |
119 |
|
DO j=1,sNy+1 |
120 |
|
DO i=1,sNx |
121 |
|
pf(i,j) = ( implicDiv2Dflow * gVNm1(i,j,k,bi,bj) |
122 |
|
& + (1.-implicDiv2Dflow) * vVel(i,j,k,bi,bj) |
123 |
|
& ) * yA(i,j) / deltaTmom |
124 |
|
ENDDO |
125 |
|
ENDDO |
126 |
|
ENDIF |
127 |
DO j=1,sNy |
DO j=1,sNy |
128 |
DO i=1,sNx |
DO i=1,sNx |
129 |
cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj) + |
cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj) + |