module modTsTest implicit none contains subroutine PostTimeStep(ts,ierr) #include "finclude/petsc.h" #include "finclude/petscts.h" TS :: ts PetscErrorCode :: ierr end subroutine PostTimeStep end module modTsTest program TsTest use modTSTest implicit none #include "finclude/petsc.h" #include "finclude/petscts.h" MPI_Comm :: comm TS :: ts Mat :: A Vec :: solx PetscErrorCode :: ierr call PetscInitialize(PETSC_NULL_CHARACTER, ierr) comm = PETSC_COMM_SELF call TSCreate(comm,ts,ierr) call TSSetProblemType(ts, TS_LINEAR,ierr) call TSSetMatrices(ts,A,PETSC_NULL_FUNCTION,PETSC_NULL_INTEGER,PETSC_NULL_FUNCTION,DIFFERENT_NONZERO_PATTERN,PETSC_NULL_INTEGER,ierr) call TSSetSolution(ts,solx,ierr) call TSSetType(ts,TSCRANK_NICHOLSON,ierr) call TSSetPostStep(ts,PostTimeStep,ierr) call TSSetFromOptions(ts,ierr) call PetscFinalize(ierr) end program TsTest