18 |
#include "PARAMS.h" |
#include "PARAMS.h" |
19 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
20 |
#include "GRID.h" |
#include "GRID.h" |
21 |
#include "CG2D.h" |
#include "SURFACE.h" |
22 |
#ifdef ALLOW_NONHYDROSTATIC |
#ifdef ALLOW_NONHYDROSTATIC |
23 |
#include "CG3D.h" |
#include "CG3D.h" |
24 |
#include "GW.h" |
#include "GW.h" |
33 |
CEndOfInterface |
CEndOfInterface |
34 |
|
|
35 |
C Local variables |
C Local variables |
36 |
|
C cg2d_x - Conjugate Gradient 2-D solver : Solution vector |
37 |
|
C cg2d_b - Conjugate Gradient 2-D solver : Right-hand side vector |
38 |
INTEGER i,j,k,bi,bj |
INTEGER i,j,k,bi,bj |
39 |
_RS uf(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RS uf(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
40 |
_RS vf(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RS vf(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
41 |
|
_RL cg2d_x(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
42 |
|
_RL cg2d_b(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
43 |
|
|
44 |
|
C-- Save previous solution & Initialise Vector solution and source term : |
45 |
|
DO bj=myByLo(myThid),myByHi(myThid) |
46 |
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
47 |
|
DO j=1-OLy,sNy+OLy |
48 |
|
DO i=1-OLx,sNx+OLx |
49 |
|
#ifdef INCLUDE_CD_CODE |
50 |
|
etaNm1(i,j,bi,bj) = etaN(i,j,bi,bj) |
51 |
|
#endif |
52 |
|
cg2d_x(i,j,bi,bj) = etaN(i,j,bi,bj) |
53 |
|
cg2d_b(i,j,bi,bj) = 0. |
54 |
|
#ifdef USE_NATURAL_BCS |
55 |
|
& + freeSurfFac*_rA(i,j,bi,bj)*horiVertRatio* |
56 |
|
& EmPmR(I,J,bi,bj)/deltaTMom |
57 |
|
#endif |
58 |
|
ENDDO |
59 |
|
ENDDO |
60 |
|
ENDDO |
61 |
|
ENDDO |
62 |
|
|
63 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
64 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
74 |
CALL CALC_DIV_GHAT( |
CALL CALC_DIV_GHAT( |
75 |
I bi,bj,1,sNx,1,sNy,K, |
I bi,bj,1,sNx,1,sNy,K, |
76 |
I uf,vf, |
I uf,vf, |
77 |
|
U cg2d_b, |
78 |
I myThid) |
I myThid) |
79 |
ENDDO |
ENDDO |
80 |
ENDDO |
ENDDO |
81 |
ENDDO |
ENDDO |
82 |
|
|
|
#ifdef INCLUDE_CD_CODE |
|
|
C-- Save previous solution. |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
|
|
DO j=1-OLy,sNy+OLy |
|
|
DO i=1-OLx,sNx+OLx |
|
|
cg2d_xNM1(i,j,bi,bj) = cg2d_x(i,j,bi,bj) |
|
|
ENDDO |
|
|
ENDDO |
|
|
ENDDO |
|
|
ENDDO |
|
|
#endif |
|
|
|
|
83 |
C-- Add source term arising from w=d/dt (p_s + p_nh) |
C-- Add source term arising from w=d/dt (p_s + p_nh) |
84 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
85 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
139 |
|
|
140 |
C-- Find the surface pressure using a two-dimensional conjugate |
C-- Find the surface pressure using a two-dimensional conjugate |
141 |
C-- gradient solver. |
C-- gradient solver. |
142 |
C see CG2D.h for the interface to this routine. |
C see CG2D_INTERNAL.h for the interface to this routine. |
143 |
CALL CG2D( |
CALL CG2D( |
144 |
I cg2d_b, |
I cg2d_b, |
145 |
U cg2d_x, |
U cg2d_x, |
147 |
|
|
148 |
_EXCH_XY_R8(cg2d_x, myThid ) |
_EXCH_XY_R8(cg2d_x, myThid ) |
149 |
|
|
150 |
|
C-- Transfert the 2D-solution to "etaN" : |
151 |
|
DO bj=myByLo(myThid),myByHi(myThid) |
152 |
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
153 |
|
DO j=1-OLy,sNy+OLy |
154 |
|
DO i=1-OLx,sNx+OLx |
155 |
|
etaN(i,j,bi,bj) = cg2d_x(i,j,bi,bj) |
156 |
|
ENDDO |
157 |
|
ENDDO |
158 |
|
ENDDO |
159 |
|
ENDDO |
160 |
|
|
161 |
#ifdef ALLOW_NONHYDROSTATIC |
#ifdef ALLOW_NONHYDROSTATIC |
162 |
IF ( nonHydrostatic ) THEN |
IF ( nonHydrostatic ) THEN |
163 |
|
|