Skip to main content
`Ctrl`+`K`

# PetscViewerASCIISetFileUnit

sets the `PETSCVIEWERASCII` `PetscViewer` to write to a Fortran IO unit

## Synopsis

    #include <petscviewer.h>
    void PetscViewerASCIISetFileUnit(PetscViewer viewer, PetscInt unit, PetscErrorCode ierr)

## Input Parameters

- viewer - the viewer

- unit - the unit number

## Output Parameter

- ierr - the error code

## Note

`PetscViewerDestroy()` does not close the unit for this `PetscViewer`

## Fortran Notes

Only for Fortran, use `PetscViewerASCIISetFILE()` for C

## See Also

`PetscViewerASCIISetFILE()`, `PETSCVIEWERASCII`, `PetscViewerASCIIOpenWithFileUnit()`, `PetscViewerASCIIStdoutSetFileUnit()`

## Level

intermediate

## Location

src/sys/classes/viewer/impls/ascii/filev.c

Index of all Viewer routines
Table of Contents for all manual pages
Index of all manual pages