# PetscInitializeFortran
Routine that should be called soon AFTER the call to PetscInitialize() if one is using a C main program that calls Fortran routines that in turn call PETSc routines. 
## Synopsis
```
PetscErrorCode PetscInitializeFortran(void)
```
Collective on `PETSC_COMM_WORLD`




## Note
`PetscInitializeFortran()` initializes some of the default viewers,
communicators, etc. for use in the Fortran if a user's main program is
written in C.  `PetscInitializeFortran()` is NOT needed if a user's main
program is written in Fortran; in this case, just calling
`PetscInitialize()` in the main (Fortran) program is sufficient.


## See Also
  PetscInitialize()

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/ftn-custom/zstartf.c.html#PetscInitializeFortran">src/sys/objects/ftn-custom/zstartf.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex7.c.html">src/vec/vec/tutorials/ex7.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/ftn-custom/zstartf.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
