program ex95f90
#include "petsc/finclude/petsc.h"
use petsc
implicit none
#include "exodusII.inc"
! Get the Fortran kind associated with PetscInt and PetscReal so that we can use literal constants.
PetscInt :: dummyPetscInt
PetscReal :: dummyPetscreal
PetscBool :: flg
integer,parameter :: kPI = kind(dummyPetscInt)
integer,parameter :: kPR = kind(dummyPetscReal)
integer :: nNodalVar = 4
integer :: nZonalVar = 3
integer :: i
PetscErrorCode :: ierr
type(tDM) :: dm, pdm
character(len=PETSC_MAX_PATH_LEN) :: ifilename,ofilename,IOBuffer
PetscInt :: order = 1
type(tPetscViewer) :: viewer
character(len = MXNAME),dimension(4) :: nodalVarName = ["U_x ", &
"U_y ", &
"Alpha", &
"Beta "]
character(len = MXNAME),dimension(3) :: zonalVarName = ["Sigma_11", &
"Sigma_12", &
"Sigma_22"]
character(len = MXNAME) :: varName
PetscCallA(PetscInitialize(PETSC_NULL_CHARACTER,ierr))
if (ierr /= 0) then
print*,'Unable to initialize PETSc'
stop
endif
PetscCallA(PetscOptionsBegin(PETSC_COMM_WORLD,PETSC_NULL_CHARACTER,'PetscViewer_ExodusII test','ex95f90',ierr))
PetscCallA(PetscOptionsString("-i", "Filename to read", "ex95f90", ifilename, ifilename, flg, ierr));
PetscCheckA(flg,PETSC_COMM_WORLD,PETSC_ERR_ARG_OUTOFRANGE,'missing input file name -i ')
PetscCallA(PetscOptionsString("-o", "Filename to write", "ex95f90", ofilename, ofilename, flg, ierr));
PetscCheckA(flg,PETSC_COMM_WORLD,PETSC_ERR_ARG_OUTOFRANGE,'missing output file name -o