2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
|
#undef ALLOW_ZONAL_FILT |
|
|
#undef ALLOW_SHAP_FILT |
|
5 |
|
|
6 |
C /==========================================================\ |
C /==========================================================\ |
7 |
C | S/R CALC_DIV_GHAT | |
C | S/R CALC_DIV_GHAT | |
48 |
C time tendency terms along with a relaxation term that |
C time tendency terms along with a relaxation term that |
49 |
C pulls div(U) + dh/dt back toward zero. |
C pulls div(U) + dh/dt back toward zero. |
50 |
|
|
51 |
IF (implicDiv2Dflow.EQ.1.) then |
IF (implicDiv2Dflow.EQ.1.) THEN |
52 |
C Fully Implicit treatment of the Barotropic Flow Divergence |
C Fully Implicit treatment of the Barotropic Flow Divergence |
53 |
DO j=1,sNy |
DO j=1,sNy |
54 |
DO i=1,sNx+1 |
DO i=1,sNx+1 |
55 |
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 |
56 |
ENDDO |
ENDDO |
57 |
ENDDO |
ENDDO |
58 |
|
ELSEIF (exactConserv) THEN |
59 |
|
c ELSEIF (nonlinFreeSurf.GT.0) THEN |
60 |
|
C Implicit treatment of the Barotropic Flow Divergence |
61 |
|
DO j=1,sNy |
62 |
|
DO i=1,sNx+1 |
63 |
|
pf(i,j) = implicDiv2Dflow |
64 |
|
& *xA(i,j)*gUNm1(i,j,k,bi,bj) / deltaTmom |
65 |
|
ENDDO |
66 |
|
ENDDO |
67 |
ELSE |
ELSE |
68 |
C Explicit+Implicit part of the Barotropic Flow Divergence |
C Explicit+Implicit part of the Barotropic Flow Divergence |
69 |
C => Filtering of uVel,vVel is necessary |
C => Filtering of uVel,vVel is necessary |
70 |
#ifdef ALLOW_ZONAL_FILT |
C-- Now the filter are applied in the_correction_step(). |
71 |
IF (zonal_filt_lat.LT.90.) THEN |
C We have left this code here to indicate where the filters used to be |
72 |
CALL ZONAL_FILTER( |
C in the algorithm before JMC moved them to after the pressure solver. |
73 |
& uVel, hFacW, 1-1, sNy+1, k, k, bi, bj, 1, myThid) |
C- |
74 |
CALL ZONAL_FILTER( |
C#ifdef ALLOW_ZONAL_FILT |
75 |
& vVel, hFacS, 1-1, sNy+1, k, k, bi, bj, 2, myThid) |
C IF (zonal_filt_lat.LT.90.) THEN |
76 |
ENDIF |
C CALL ZONAL_FILTER( |
77 |
#endif |
C & uVel, hFacW, 1-1, sNy+1, k, k, bi, bj, 1, myThid) |
78 |
|
C CALL ZONAL_FILTER( |
79 |
|
C & vVel, hFacS, 1-1, sNy+1, k, k, bi, bj, 2, myThid) |
80 |
|
C ENDIF |
81 |
|
C#endif |
82 |
DO j=1,sNy |
DO j=1,sNy |
83 |
DO i=1,sNx+1 |
DO i=1,sNx+1 |
84 |
pf(i,j) = ( implicDiv2Dflow * gUNm1(i,j,k,bi,bj) |
pf(i,j) = ( implicDiv2Dflow * gUNm1(i,j,k,bi,bj) |
104 |
ENDIF |
ENDIF |
105 |
#endif |
#endif |
106 |
|
|
107 |
IF (implicDiv2Dflow.EQ.1.) then |
IF (implicDiv2Dflow.EQ.1.) THEN |
108 |
C Fully Implicit treatment of the Barotropic Flow Divergence |
C Fully Implicit treatment of the Barotropic Flow Divergence |
109 |
DO j=1,sNy+1 |
DO j=1,sNy+1 |
110 |
DO i=1,sNx |
DO i=1,sNx |
111 |
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 |
112 |
ENDDO |
ENDDO |
113 |
ENDDO |
ENDDO |
114 |
|
ELSEIF (exactConserv) THEN |
115 |
|
c ELSEIF (nonlinFreeSurf.GT.0) THEN |
116 |
|
C Implicit treatment of the Barotropic Flow Divergence |
117 |
|
DO j=1,sNy+1 |
118 |
|
DO i=1,sNx |
119 |
|
pf(i,j) = implicDiv2Dflow |
120 |
|
& *yA(i,j)*gVNm1(i,j,k,bi,bj) / deltatmom |
121 |
|
ENDDO |
122 |
|
ENDDO |
123 |
ELSE |
ELSE |
124 |
C Explicit+Implicit part of the Barotropic Flow Divergence |
C Explicit+Implicit part of the Barotropic Flow Divergence |
125 |
DO j=1,sNy+1 |
DO j=1,sNy+1 |