  type tPetscViewers
    PetscFortranAddr:: v = PETSC_FORTRAN_TYPE_INITIALIZE
  end type tPetscViewers
  PetscViewers, parameter :: PETSC_NULL_VIEWERS = tPetscViewers(0)
  PetscViewers, target :: PETSC_NULL_VIEWERS_ARRAY(1) = [tPetscViewers(0)]
  PetscViewers, pointer :: PETSC_NULL_VIEWERS_POINTER(:) => PETSC_NULL_VIEWERS_ARRAY
#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_VIEWERS
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_VIEWERS_ARRAY
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_VIEWERS_POINTER
#endif

  type, extends(tPetscObject) ::  tPetscViewer
  end type tPetscViewer
  PetscViewer, parameter :: PETSC_NULL_VIEWER = tPetscViewer(0)
  PetscViewer, target :: PETSC_NULL_VIEWER_ARRAY(1) = [tPetscViewer(0)]
  PetscViewer, pointer :: PETSC_NULL_VIEWER_POINTER(:) => PETSC_NULL_VIEWER_ARRAY
#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_VIEWER
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_VIEWER_ARRAY
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_VIEWER_POINTER
#endif

  type ePetscViewerGLVisType
    PetscEnum:: v = PETSC_FORTRAN_TYPE_INITIALIZE
  end type ePetscViewerGLVisType

  PetscViewerGLVisType, parameter :: PETSC_NULL_VIEWERGLVISTYPE = ePetscViewerGLVisType(-50)
#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_VIEWERGLVISTYPE
#endif
    PetscViewerGLVisType, parameter :: PETSC_VIEWER_GLVIS_DUMP = ePetscViewerGLVisType(0)
    PetscViewerGLVisType, parameter :: PETSC_VIEWER_GLVIS_SOCKET = ePetscViewerGLVisType(1)

#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_GLVIS_DUMP
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_GLVIS_SOCKET
#endif

  type ePetscViewerFormat
    PetscEnum:: v = PETSC_FORTRAN_TYPE_INITIALIZE
  end type ePetscViewerFormat

  PetscViewerFormat, parameter :: PETSC_NULL_VIEWERFORMAT = ePetscViewerFormat(-50)
#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_VIEWERFORMAT
#endif
    PetscViewerFormat, parameter :: PETSC_VIEWER_DEFAULT = ePetscViewerFormat(0)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_MATLAB = ePetscViewerFormat(1)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_MATHEMATICA = ePetscViewerFormat(2)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_IMPL = ePetscViewerFormat(3)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_INFO = ePetscViewerFormat(4)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_INFO_DETAIL = ePetscViewerFormat(5)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_COMMON = ePetscViewerFormat(6)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_SYMMODU = ePetscViewerFormat(7)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_INDEX = ePetscViewerFormat(8)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_DENSE = ePetscViewerFormat(9)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_MATRIXMARKET = ePetscViewerFormat(10)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_PCICE = ePetscViewerFormat(11)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_PYTHON = ePetscViewerFormat(12)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_FACTOR_INFO = ePetscViewerFormat(13)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_LATEX = ePetscViewerFormat(14)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_XML = ePetscViewerFormat(15)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_FLAMEGRAPH = ePetscViewerFormat(16)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_GLVIS = ePetscViewerFormat(17)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ASCII_CSV = ePetscViewerFormat(18)
    PetscViewerFormat, parameter :: PETSC_VIEWER_DRAW_BASIC = ePetscViewerFormat(19)
    PetscViewerFormat, parameter :: PETSC_VIEWER_DRAW_LG = ePetscViewerFormat(20)
    PetscViewerFormat, parameter :: PETSC_VIEWER_DRAW_LG_XRANGE = ePetscViewerFormat(21)
    PetscViewerFormat, parameter :: PETSC_VIEWER_DRAW_CONTOUR = ePetscViewerFormat(22)
    PetscViewerFormat, parameter :: PETSC_VIEWER_DRAW_PORTS = ePetscViewerFormat(23)
    PetscViewerFormat, parameter :: PETSC_VIEWER_VTK_VTS = ePetscViewerFormat(24)
    PetscViewerFormat, parameter :: PETSC_VIEWER_VTK_VTR = ePetscViewerFormat(25)
    PetscViewerFormat, parameter :: PETSC_VIEWER_VTK_VTU = ePetscViewerFormat(26)
    PetscViewerFormat, parameter :: PETSC_VIEWER_BINARY_MATLAB = ePetscViewerFormat(27)
    PetscViewerFormat, parameter :: PETSC_VIEWER_NATIVE = ePetscViewerFormat(28)
    PetscViewerFormat, parameter :: PETSC_VIEWER_HDF5_PETSC = ePetscViewerFormat(29)
    PetscViewerFormat, parameter :: PETSC_VIEWER_HDF5_VIZ = ePetscViewerFormat(30)
    PetscViewerFormat, parameter :: PETSC_VIEWER_HDF5_XDMF = ePetscViewerFormat(31)
    PetscViewerFormat, parameter :: PETSC_VIEWER_HDF5_MAT = ePetscViewerFormat(32)
    PetscViewerFormat, parameter :: PETSC_VIEWER_NOFORMAT = ePetscViewerFormat(33)
    PetscViewerFormat, parameter :: PETSC_VIEWER_LOAD_BALANCE = ePetscViewerFormat(34)
    PetscViewerFormat, parameter :: PETSC_VIEWER_FAILED = ePetscViewerFormat(35)
    PetscViewerFormat, parameter :: PETSC_VIEWER_ALL = ePetscViewerFormat(36)

#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_DEFAULT
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_MATLAB
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_MATHEMATICA
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_IMPL
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_INFO
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_INFO_DETAIL
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_COMMON
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_SYMMODU
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_INDEX
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_DENSE
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_MATRIXMARKET
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_PCICE
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_PYTHON
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_FACTOR_INFO
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_LATEX
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_XML
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_FLAMEGRAPH
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_GLVIS
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ASCII_CSV
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_DRAW_BASIC
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_DRAW_LG
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_DRAW_LG_XRANGE
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_DRAW_CONTOUR
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_DRAW_PORTS
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_VTK_VTS
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_VTK_VTR
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_VTK_VTU
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_BINARY_MATLAB
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_NATIVE
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_HDF5_PETSC
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_HDF5_VIZ
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_HDF5_XDMF
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_HDF5_MAT
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_NOFORMAT
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_LOAD_BALANCE
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_FAILED
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_ALL
#endif

  type ePetscViewerVTKFieldType
    PetscEnum:: v = PETSC_FORTRAN_TYPE_INITIALIZE
  end type ePetscViewerVTKFieldType

  PetscViewerVTKFieldType, parameter :: PETSC_NULL_VIEWERVTKFIELDTYPE = ePetscViewerVTKFieldType(-50)
#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_VIEWERVTKFIELDTYPE
#endif
    PetscViewerVTKFieldType, parameter :: PETSC_VTK_INVALID = ePetscViewerVTKFieldType(0)
    PetscViewerVTKFieldType, parameter :: PETSC_VTK_POINT_FIELD = ePetscViewerVTKFieldType(1)
    PetscViewerVTKFieldType, parameter :: PETSC_VTK_POINT_VECTOR_FIELD = ePetscViewerVTKFieldType(2)
    PetscViewerVTKFieldType, parameter :: PETSC_VTK_CELL_FIELD = ePetscViewerVTKFieldType(3)
    PetscViewerVTKFieldType, parameter :: PETSC_VTK_CELL_VECTOR_FIELD = ePetscViewerVTKFieldType(4)

#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VTK_INVALID
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VTK_POINT_FIELD
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VTK_POINT_VECTOR_FIELD
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VTK_CELL_FIELD
!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VTK_CELL_VECTOR_FIELD
#endif

  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERSOCKET = 'socket'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERASCII = 'ascii'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERBINARY = 'binary'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERSTRING = 'string'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERDRAW = 'draw'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERVU = 'vu'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERMATHEMATICA = 'mathematica'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERHDF5 = 'hdf5'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERVTK = 'vtk'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERMATLAB = 'matlab'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERSAWS = 'saws'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERGLVIS = 'glvis'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERADIOS = 'adios'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWEREXODUSII = 'exodusii'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERCGNS = 'cgns'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERPYTHON = 'python'
  CHARACTER(LEN=*), PARAMETER :: PETSCVIEWERPYVISTA = 'pyvista'

#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERSOCKET
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERASCII
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERBINARY
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERSTRING
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERDRAW
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERVU
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERMATHEMATICA
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERHDF5
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERVTK
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERMATLAB
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERSAWS
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERGLVIS
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERADIOS
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWEREXODUSII
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERCGNS
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERPYTHON
!DEC$ ATTRIBUTES DLLEXPORT::PETSCVIEWERPYVISTA
#endif

