/[MITgcm]/MITgcm/model/src/solve_for_pressure.F
ViewVC logotype

Diff of /MITgcm/model/src/solve_for_pressure.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.8 by adcroft, Wed Dec 9 16:11:54 1998 UTC revision 1.9 by adcroft, Mon Mar 22 15:54:05 1999 UTC
# Line 17  C     == Global variables Line 17  C     == Global variables
17  #include "PARAMS.h"  #include "PARAMS.h"
18  #include "DYNVARS.h"  #include "DYNVARS.h"
19  #include "CG2D.h"  #include "CG2D.h"
20    #ifdef ALLOW_NONHYDROSTATIC
21    #include "CG3D.h"
22    #include "GW.h"
23    #include "OBCS.h"
24    #include "GRID.h"
25    #endif
26    
27  C     == Routine arguments ==  C     == Routine arguments ==
28  C     myThid - Number of this instance of SOLVE_FOR_PRESSURE  C     myThid - Number of this instance of SOLVE_FOR_PRESSURE
# Line 25  CEndOfInterface Line 31  CEndOfInterface
31    
32  C     Local variables  C     Local variables
33        INTEGER i,j,k,bi,bj        INTEGER i,j,k,bi,bj
34    #ifdef ALLOW_NONHYDROSTATIC
35          _RS uf(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
36          _RS vf(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
37    #endif
38    
39  #ifdef INCLUDE_CD_CODE  #ifdef INCLUDE_CD_CODE
40  C--   Save previous solution.  C--   Save previous solution.
# Line 47  C     see CG2D.h for the interface to th Line 57  C     see CG2D.h for the interface to th
57       U           cg2d_x,       U           cg2d_x,
58       I           myThid )       I           myThid )
59    
60    #ifdef ALLOW_NONHYDROSTATIC
61          IF ( nonHydrostatic ) THEN
62    
63    C--   Solve for a three-dimensional pressure term (NH or IGW or both ).
64    C     see CG3D.h for the interface to this routine.
65           DO bj=myByLo(myThid),myByHi(myThid)
66            DO bi=myBxLo(myThid),myBxHi(myThid)
67             DO j=1,sNy+1
68              DO i=1,sNx+1
69               uf(i,j)=-gBaro*_recip_dxC(i,j,bi,bj)*
70         &         (cg2d_x(i,j,bi,bj)-cg2d_x(i-1,j,bi,bj))
71               vf(i,j)=-gBaro*_recip_dyC(i,j,bi,bj)*
72         &         (cg2d_x(i,j,bi,bj)-cg2d_x(i,j-1,bi,bj))
73              ENDDO
74             ENDDO
75    
76             IF (openBoundaries) THEN
77              DO i=1,sNx+1
78    C Northern boundary
79              IF (OB_Jn(I,bi,bj).NE.0) THEN
80               uf(I,OB_Jn(I,bi,bj))=0.
81               vf(I,OB_Jn(I,bi,bj))=0.
82              ENDIF
83    C Southern boundary
84              IF (OB_Js(I,bi,bj).NE.0) THEN
85               uf(I,OB_Js(I,bi,bj))=0.
86               vf(I,OB_Js(I,bi,bj)+1)=0.
87              ENDIF
88              ENDDO
89              DO j=1,sNy+1
90    C Eastern boundary
91              IF (OB_Ie(J,bi,bj).NE.0) THEN
92               uf(OB_Ie(J,bi,bj),J)=0.
93               vf(OB_Ie(J,bi,bj),J)=0.
94              ENDIF
95    C Western boundary
96              IF (OB_Iw(J,bi,bj).NE.0) THEN
97               uf(OB_Iw(J,bi,bj)+1,J)=0.
98               vf(OB_Iw(J,bi,bj),J)=0.
99              ENDIF
100              ENDDO
101             ENDIF
102    
103             DO K=1,Nr
104              DO j=1,sNy
105               DO i=1,sNx
106    c           cg3d_x(i,j,k,bi,bj) = 0.
107                cg3d_b(i,j,k,bi,bj) = cg3d_b(i,j,k,bi,bj)
108         &       +dRF(K)*dYG(i+1,j,bi,bj)*hFacW(i+1,j,k,bi,bj)*uf(i+1,j)
109         &       -dRF(K)*dYG( i ,j,bi,bj)*hFacW( i ,j,k,bi,bj)*uf( i ,j)
110         &       +dRF(K)*dXG(i,j+1,bi,bj)*hFacS(i,j+1,k,bi,bj)*vf(i,j+1)
111         &       -dRF(K)*dXG(i, j ,bi,bj)*hFacS(i, j ,k,bi,bj)*vf(i, j )
112               ENDDO
113              ENDDO
114             ENDDO
115    
116            ENDDO ! bi
117           ENDDO ! bj
118    
119           CALL CG3D( myThid )
120    
121          ENDIF
122    #endif
123    
124        RETURN        RETURN
125        END        END

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.22