/[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.24 by adcroft, Wed Jun 6 15:14:06 2001 UTC revision 1.25 by adcroft, Fri Jun 29 17:14:49 2001 UTC
# Line 20  C     == Global variables Line 20  C     == Global variables
20  #include "GRID.h"  #include "GRID.h"
21  #include "SURFACE.h"  #include "SURFACE.h"
22  #ifdef ALLOW_NONHYDROSTATIC  #ifdef ALLOW_NONHYDROSTATIC
23  #include "CG3D.h"  #include "SOLVE_FOR_PRESSURE3D.h"
24  #include "GW.h"  #include "GW.h"
25  #endif  #endif
26  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
# Line 39  C     == Local variables == Line 39  C     == Local variables ==
39        _RS vf(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RS vf(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
40        _RL firstResidual,lastResidual        _RL firstResidual,lastResidual
41        INTEGER numIters        INTEGER numIters
42          CHARACTER*(MAX_LEN_MBUF) msgBuf
43    
44  C--   Save previous solution & Initialise Vector solution and source term :  C--   Save previous solution & Initialise Vector solution and source term :
45        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
# Line 86  C--   Add source term arising from w=d/d Line 87  C--   Add source term arising from w=d/d
87            cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj)            cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj)
88       &      -freeSurfFac*_rA(i,j,bi,bj)/deltaTMom/deltaTMom       &      -freeSurfFac*_rA(i,j,bi,bj)/deltaTMom/deltaTMom
89       &        *( etaN(i,j,bi,bj)       &        *( etaN(i,j,bi,bj)
90       &          +cg3d_x(i,j,1,bi,bj)*horiVertRatio/gravity )       &          +phi_nh(i,j,1,bi,bj)*horiVertRatio/gravity )
91            cg3d_b(i,j,1,bi,bj) = cg3d_b(i,j,1,bi,bj)            cg3d_b(i,j,1,bi,bj) = cg3d_b(i,j,1,bi,bj)
92       &      -freeSurfFac*_rA(i,j,bi,bj)/deltaTMom/deltaTMom       &      -freeSurfFac*_rA(i,j,bi,bj)/deltaTMom/deltaTMom
93       &        *( etaN(i,j,bi,bj)       &        *( etaN(i,j,bi,bj)
94       &          +cg3d_x(i,j,1,bi,bj)*horiVertRatio/gravity )       &          +phi_nh(i,j,1,bi,bj)*horiVertRatio/gravity )
95  C-jmc  C-jmc
96  c    &      -freeSurfFac*_rA(i,j,bi,bj)*recip_Bo(i,j,bi,bj)  c    &      -freeSurfFac*_rA(i,j,bi,bj)*recip_Bo(i,j,bi,bj)
97  c    &        *( cg2d_x(i,j,bi,bj) + cg3d_x(i,j,1,bi,bj) )  c    &        *( cg2d_x(i,j,bi,bj) + phi_nh(i,j,1,bi,bj) )
98  c    &        /deltaTMom/deltaTMom  c    &        /deltaTMom/deltaTMom
99  C-jmc  C-jmc
100           ENDDO           ENDDO
# Line 165  C     see CG2D.h for the interface to th Line 166  C     see CG2D.h for the interface to th
166  #endif  #endif
167    
168        _BEGIN_MASTER( myThid )        _BEGIN_MASTER( myThid )
169         WRITE(*,'(A,I6,1PE30.14)') ' CG2D iters, err = ',        WRITE(msgBuf,'(A34,1PE24.14)') 'cg2d_init_res =',firstResidual
170       &                               0, firstResidual        CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
171         WRITE(*,'(A,I6,1PE30.14)') ' CG2D iters, err = ',        WRITE(msgBuf,'(A34,I6)') 'cg2d_iters =',numIters
172       &                         numIters, lastResidual        CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
173          WRITE(msgBuf,'(A34,1PE24.14)') 'cg2d_res =',lastResidual
174          CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
175        _END_MASTER( )        _END_MASTER( )
176    
177  C--   Transfert the 2D-solution to "etaN" :  C--   Transfert the 2D-solution to "etaN" :
# Line 295  C Western boundary Line 298  C Western boundary
298          ENDDO ! bi          ENDDO ! bi
299         ENDDO ! bj         ENDDO ! bj
300    
301         CALL CG3D( myThid )        firstResidual=0.
302         _EXCH_XYZ_R8(cg3d_x, myThid )        lastResidual=0.
303          numIters=cg2dMaxIters
304          CALL CG3D(
305         U           cg3d_b,
306         U           phi_nh,
307         O           firstResidual,
308         O           lastResidual,
309         U           numIters,
310         I           myThid )
311          _EXCH_XYZ_R8(phi_nh, myThid )
312    
313          _BEGIN_MASTER( myThid )
314          WRITE(msgBuf,'(A34,1PE24.14)') 'cg3d_init_res =',firstResidual
315          CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
316          WRITE(msgBuf,'(A34,I6)') 'cg3d_iters =',numIters
317          CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
318          WRITE(msgBuf,'(A34,1PE24.14)') 'cg3d_res =',lastResidual
319          CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
320          _END_MASTER( )
321    
322        ENDIF        ENDIF
323  #endif  #endif

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.22