| 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" |
| 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 |
|
|
| 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, |
| 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) |
| 376 |
|
|
| 377 |
|
|
| 378 |
|
|
| 379 |
#else |
#else /* ALLOW_PETSC */ |
| 380 |
|
|
| 381 |
|
|
| 382 |
iters = streamice_max_cg_iter |
iters = streamice_max_cg_iter |
| 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) |