Actual source code: ex95f90.F90
1: #include "petsc/finclude/petsc.h"
2: program ex95f90
3: use petsc
4: implicit none
5: #include "exodusII.inc"
7: PetscBool :: flg
8: integer :: nNodalVar = 4
9: integer :: nZonalVar = 3
10: integer :: i
12: PetscErrorCode :: ierr
13: type(tDM) :: dm, pdm
14: character(len=PETSC_MAX_PATH_LEN) :: ifilename, ofilename, IOBuffer
15: PetscInt, parameter :: order = 1
16: type(tPetscViewer) :: viewer
17: character(len=MXNAME), dimension(4) :: nodalVarName = ["U_x ", "U_y ", "Alpha", "Beta "]
18: character(len=MXNAME), dimension(3) :: zonalVarName = ["Sigma_11", "Sigma_12", "Sigma_22"]
19: character(len=MXNAME) :: varName
21: PetscCallA(PetscInitialize(PETSC_NULL_CHARACTER, ierr))
23: PetscCallA(PetscOptionsBegin(PETSC_COMM_WORLD, PETSC_NULL_CHARACTER, 'PetscViewer_ExodusII test', 'ex95f90', ierr))
24: PetscCallA(PetscOptionsString("-i", "Filename to read", "ex95f90", ifilename, ifilename, flg, ierr))
25: PetscCheckA(flg, PETSC_COMM_WORLD, PETSC_ERR_ARG_OUTOFRANGE, 'missing input file name -i ')
26: PetscCallA(PetscOptionsString("-o", "Filename to write", "ex95f90", ofilename, ofilename, flg, ierr))
27: PetscCheckA(flg, PETSC_COMM_WORLD, PETSC_ERR_ARG_OUTOFRANGE, 'missing output file name -o