/[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.9 by dgoldberg, Sat Jun 8 22:15:33 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    ! UNCOMMENT IF V3.0
40  !#include "finclude/petscvec.h"  !#include "finclude/petscvec.h"
41  !#include "finclude/petscmat.h"  !#include "finclude/petscmat.h"
42  !#include "finclude/petscksp.h"  !#include "finclude/petscksp.h"
# Line 90  C     LOCAL VARIABLES Line 94  C     LOCAL VARIABLES
94    
95  #ifdef ALLOW_STREAMICE  #ifdef ALLOW_STREAMICE
96    
97    
98    
99        CALL TIMER_START ('STREAMICE_CG_SOLVE',myThid)        CALL TIMER_START ('STREAMICE_CG_SOLVE',myThid)
100    #ifndef STREAMICE_SERIAL_TRISOLVE
101    
102  #ifdef ALLOW_PETSC  #ifdef ALLOW_PETSC
103    
# Line 185  C     LOCAL VARIABLES Line 192  C     LOCAL VARIABLES
192        call VecAssemblyBegin(solution, ierr)        call VecAssemblyBegin(solution, ierr)
193        call VecAssemblyEnd(solution, ierr)        call VecAssemblyEnd(solution, ierr)
194    
195    !     IF USING v3.0 THEN
196    !     call MatCreateMPIAIJ (PETSC_COMM_WORLD,
197        call MatCreateAIJ (PETSC_COMM_WORLD,        call MatCreateAIJ (PETSC_COMM_WORLD,
198       &                      local_dofs, local_dofs,       &                      local_dofs, local_dofs,
199       &                      global_dofs, global_dofs,       &                      global_dofs, global_dofs,
# Line 193  C     LOCAL VARIABLES Line 201  C     LOCAL VARIABLES
201       &                      18, PETSC_NULL_INTEGER,       &                      18, PETSC_NULL_INTEGER,
202       &                      matrix, ierr)       &                      matrix, ierr)
203    
204    
205  ! populate petsc matrix  ! populate petsc matrix
206    
207        DO bj = myByLo(myThid), myByHi(myThid)        DO bj = myByLo(myThid), myByHi(myThid)
# Line 367  C     LOCAL VARIABLES Line 376  C     LOCAL VARIABLES
376    
377    
378    
379  #else  #else  /* ALLOW_PETSC */
380    
381    
382        iters = streamice_max_cg_iter        iters = streamice_max_cg_iter
# Line 759  c     if iters has reached max_iters the Line 768  c     if iters has reached max_iters the
768  !       _EXCH_XY_RL( cg_Uin, myThid )  !       _EXCH_XY_RL( cg_Uin, myThid )
769  !       _EXCH_XY_RL( cg_Vin, myThid )          !       _EXCH_XY_RL( cg_Vin, myThid )        
770    
771    #endif /* ifndef ALLOW_PETSC */
772    
773    #else /* STREAMICE_SERIAL_TRISOLVE */
774    
775          CALL STREAMICE_TRIDIAG_SOLVE(
776         U                               cg_Uin,     ! x-velocities
777         U                               cg_Vin,
778         U                               cg_Bu,      ! force in x dir
779         I                               A_uu,       ! section of matrix that multiplies u and projects on u
780         I                               STREAMICE_umask,
781         I                               myThid )
782    
783  #endif  #endif
784    
785        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.9

  ViewVC Help
Powered by ViewVC 1.1.22