/[MITgcm]/MITgcm_contrib/dgoldberg/streamice/streamice_cg_solve.F
ViewVC logotype

Diff of /MITgcm_contrib/dgoldberg/streamice/streamice_cg_solve.F

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

revision 1.7 by dgoldberg, Sat Apr 6 17:43:41 2013 UTC revision 1.8 by dgoldberg, Tue May 28 22:32:39 2013 UTC
# Line 31  C     \================================= Line 31  C     \=================================
31  #include "PARAMS.h"  #include "PARAMS.h"
32  #include "STREAMICE.h"  #include "STREAMICE.h"
33  #include "STREAMICE_CG.h"  #include "STREAMICE_CG.h"
34    
35    
36    
37  #ifdef ALLOW_PETSC  #ifdef ALLOW_PETSC
38  #include "finclude/petsc.h"  #include "finclude/petsc.h"
39  !#include "finclude/petscvec.h"  #include "finclude/petscvec.h"
40  !#include "finclude/petscmat.h"  #include "finclude/petscmat.h"
41  !#include "finclude/petscksp.h"  #include "finclude/petscksp.h"
42  !#include "finclude/petscpc.h"  #include "finclude/petscpc.h"
43  #endif  #endif
44  C     === Global variables ===  C     === Global variables ===
45    
# Line 90  C     LOCAL VARIABLES Line 93  C     LOCAL VARIABLES
93    
94  #ifdef ALLOW_STREAMICE  #ifdef ALLOW_STREAMICE
95    
96    
97    
98        CALL TIMER_START ('STREAMICE_CG_SOLVE',myThid)        CALL TIMER_START ('STREAMICE_CG_SOLVE',myThid)
99    #ifndef STREAMICE_SERIAL_TRISOLVE
100    
101  #ifdef ALLOW_PETSC  #ifdef ALLOW_PETSC
102    
# Line 186  C     LOCAL VARIABLES Line 192  C     LOCAL VARIABLES
192        call VecAssemblyEnd(solution, ierr)        call VecAssemblyEnd(solution, ierr)
193    
194    
195        call MatCreateAIJ (PETSC_COMM_WORLD,        call MatCreateMPIAIJ (PETSC_COMM_WORLD,
196       &                      local_dofs, local_dofs,       &                      local_dofs, local_dofs,
197       &                      global_dofs, global_dofs,       &                      global_dofs, global_dofs,
198       &                      18, PETSC_NULL_INTEGER,       &                      18, PETSC_NULL_INTEGER,
199       &                      18, PETSC_NULL_INTEGER,       &                      18, PETSC_NULL_INTEGER,
200       &                      matrix, ierr)       &                      matrix, ierr)
201    
202    
203  ! populate petsc matrix  ! populate petsc matrix
204    
205        DO bj = myByLo(myThid), myByHi(myThid)        DO bj = myByLo(myThid), myByHi(myThid)
# Line 367  C     LOCAL VARIABLES Line 374  C     LOCAL VARIABLES
374    
375    
376    
377  #else  #else  /* ALLOW_PETSC */
378    
379    
380        iters = streamice_max_cg_iter        iters = streamice_max_cg_iter
# Line 759  c     if iters has reached max_iters the Line 766  c     if iters has reached max_iters the
766  !       _EXCH_XY_RL( cg_Uin, myThid )  !       _EXCH_XY_RL( cg_Uin, myThid )
767  !       _EXCH_XY_RL( cg_Vin, myThid )          !       _EXCH_XY_RL( cg_Vin, myThid )        
768    
769    #endif /* ifndef ALLOW_PETSC */
770    
771    #else /* STREAMICE_SERIAL_TRISOLVE */
772    
773          CALL STREAMICE_TRIDIAG_SOLVE(
774         U                               cg_Uin,     ! x-velocities
775         U                               cg_Vin,
776         U                               cg_Bu,      ! force in x dir
777         I                               A_uu,       ! section of matrix that multiplies u and projects on u
778         I                               STREAMICE_umask,
779         I                               myThid )
780    
781  #endif  #endif
782    
783        CALL TIMER_STOP ('STREAMICE_CG_SOLVE',myThid)        CALL TIMER_STOP ('STREAMICE_CG_SOLVE',myThid)

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

  ViewVC Help
Powered by ViewVC 1.1.22