petsc-3.8.4 2018-03-24
Report Typos and Errors

UsingFortran

To use PETSc with Fortran you must use both PETSc include files and modules. At the beginning of every function and module definition you need something like

#include "petsc/finclude/petscXXX.h"
        use petscXXX

You can declare PETSc variables using either of the following.

   XXX variablename
   type(tXXX) variablename

For example,

#include "petsc/finclude/petscvec.h"
        use petscvec

   Vec b
   type(tVec) x

Level:beginner
Location:
include/petscsys.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/vec/vec/examples/tutorials/ex20f90.F90.html