Skip to content

Commit

Permalink
updates petsc module usage
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeter committed Jun 4, 2024
1 parent fa0fb02 commit 68dfd57
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/specfem3D/SIEM_solver_petsc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,24 @@ module siem_solver_petsc
#ifdef USE_PETSC
! PETSc
! all of PETSc
!#include "petsc/finclude/petsc.h"
#include "petsc/finclude/petsc.h"
use petsc
! base types
!#include "petsc/finclude/petscsys.h"
#include "petsc/finclude/petscsys.h"
use petscsys
! Vec package
!#include "petsc/finclude/petscvec.h"
#include "petsc/finclude/petscvec.h"
use petscvec
! Mat package
!#include "petsc/finclude/petscmat.h"
#include "petsc/finclude/petscmat.h"
use petscmat
! IS (index set) package
#include "petsc/finclude/petscis.h"
use petscis
! Krylov subspace method package
#include "petsc/finclude/petscksp.h"
use petscksp

! preconditioner package
!#include "petsc/finclude/petscpc.h"

Expand All @@ -109,7 +118,6 @@ module siem_solver_petsc
!use petscpc, only: tPC
!use petscis, only: tIS

use petscksp
#endif

use constants, only: myrank,IMAIN,CUSTOM_REAL
Expand Down Expand Up @@ -2267,10 +2275,6 @@ end subroutine petsc_set_vector

subroutine petsc_solve(sdata,niter)

#ifdef USE_PETSC
use petscksp, only: KSPSolve, KSPView, KSPGetConvergedReason, KSPGetIterationNumber
#endif

implicit none
!PetscScalar :: sdata(:)
real(kind=CUSTOM_REAL) :: sdata(:)
Expand Down Expand Up @@ -2346,10 +2350,6 @@ end subroutine petsc_solve
subroutine petsc_finalize()

#ifdef USE_PETSC
use petscvec, only: VecDestroy
use petscmat, only: MatDestroy
use petscksp, only: KSPDestroy

implicit none

! Free work space. All PETSc objects should be destroyed when they
Expand Down

0 comments on commit 68dfd57

Please sign in to comment.