xref: /petsc/src/sys/ftn-mod/petscsysmod.F90 (revision fe66ebcc023cb303106674d426ee542bea707d38)
16dd63270SBarry Smith        module petscmpi
2*fe66ebccSMartin Diehluse, intrinsic :: ISO_C_binding
36dd63270SBarry Smith#include <petscconf.h>
46dd63270SBarry Smith#include "petsc/finclude/petscsys.h"
56dd63270SBarry Smith#if defined(PETSC_HAVE_MPIUNI)
66dd63270SBarry Smith        use mpiuni
76dd63270SBarry Smith#else
86dd63270SBarry Smith#if defined(PETSC_HAVE_MPI_F90MODULE)
96dd63270SBarry Smith        use mpi
106dd63270SBarry Smith#else
116dd63270SBarry Smith#include "mpif.h"
126dd63270SBarry Smith#endif
136dd63270SBarry Smith#endif
146dd63270SBarry Smith
156dd63270SBarry Smith        public:: MPIU_REAL, MPIU_SUM, MPIU_SCALAR, MPIU_INTEGER
166dd63270SBarry Smith        public:: PETSC_COMM_WORLD, PETSC_COMM_SELF
176dd63270SBarry Smith
186dd63270SBarry Smith!   These values are for __float128 are handled in the common block (below)
196dd63270SBarry Smith!   and transmitted from the C code
206dd63270SBarry Smith
216dd63270SBarry Smith      integer4 :: MPIU_REAL
226dd63270SBarry Smith      integer4 :: MPIU_SUM
236dd63270SBarry Smith      integer4 :: MPIU_SCALAR
246dd63270SBarry Smith      integer4 :: MPIU_INTEGER
256dd63270SBarry Smith
266dd63270SBarry Smith      MPI_Comm::PETSC_COMM_WORLD = 0
276dd63270SBarry Smith      MPI_Comm::PETSC_COMM_SELF = 0
286dd63270SBarry Smith
296dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
306dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::MPIU_REAL
316dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::MPIU_SUM
326dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::MPIU_SCALAR
336dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::MPIU_INTEGER
346dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_COMM_SELF
356dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_COMM_WORLD
366dd63270SBarry Smith#endif
376dd63270SBarry Smith      end module
386dd63270SBarry Smith
396dd63270SBarry Smith! ------------------------------------------------------------------------
406dd63270SBarry Smith
416dd63270SBarry Smith      module petscsysdef
42*fe66ebccSMartin Diehl        use, intrinsic :: ISO_C_binding
436dd63270SBarry Smith#if defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY)
446dd63270SBarry Smith        use petscmpi
456dd63270SBarry Smith#else
466dd63270SBarry Smith        use petscmpi, only: MPIU_REAL,MPIU_SUM,MPIU_SCALAR,MPIU_INTEGER,PETSC_COMM_WORLD,PETSC_COMM_SELF
476dd63270SBarry Smith#endif
486dd63270SBarry Smith      PetscReal,Parameter :: PetscReal_Private = 1.0
496dd63270SBarry Smith      Integer,Parameter   :: PETSC_REAL_KIND = Selected_Real_Kind(Precision(PetscReal_Private))
506dd63270SBarry Smith
516dd63270SBarry Smith      PetscBool, parameter :: PETSC_TRUE = .true.
526dd63270SBarry Smith      PetscBool, parameter :: PETSC_FALSE = .false.
536dd63270SBarry Smith
546dd63270SBarry Smith      PetscInt, parameter :: PETSC_DECIDE = -1
556dd63270SBarry Smith      PetscInt, parameter :: PETSC_DECIDE_INTEGER = -1
566dd63270SBarry Smith      PetscReal, parameter :: PETSC_DECIDE_REAL = -1.0d0
576dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
586dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_DECIDE
596dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_DECIDE_INTEGER
606dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_DECIDE_REAL
616dd63270SBarry Smith#endif
626dd63270SBarry Smith
636dd63270SBarry Smith      PetscInt, parameter :: PETSC_DETERMINE = -1
646dd63270SBarry Smith      PetscInt, parameter :: PETSC_DETERMINE_INTEGER = -1
656dd63270SBarry Smith      PetscReal, parameter :: PETSC_DETERMINE_REAL = -1.0d0
666dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
676dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_DETERMINE
686dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_DETERMINE_INTEGER
696dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_DETERMINE_REAL
706dd63270SBarry Smith#endif
716dd63270SBarry Smith
726dd63270SBarry Smith      PetscInt, parameter :: PETSC_CURRENT = -2
736dd63270SBarry Smith      PetscInt, parameter :: PETSC_CURRENT_INTEGER = -2
746dd63270SBarry Smith      PetscReal, parameter :: PETSC_CURRENT_REAL = -2.0d0
756dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
766dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_CURRENT
776dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_CURRENT_INTEGER
786dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_CURRENT_REAL
796dd63270SBarry Smith#endif
806dd63270SBarry Smith
816dd63270SBarry Smith      PetscInt, parameter :: PETSC_DEFAULT = -2
826dd63270SBarry Smith      PetscInt, parameter :: PETSC_DEFAULT_INTEGER = -2
836dd63270SBarry Smith      PetscReal, parameter :: PETSC_DEFAULT_REAL = -2.0d0
846dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
856dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_DEFAULT
866dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_DEFAULT_INTEGER
876dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_DEFAULT_REAL
886dd63270SBarry Smith#endif
896dd63270SBarry Smith     PetscFortranAddr, parameter :: PETSC_STDOUT = 0
906dd63270SBarry Smith!
916dd63270SBarry Smith!     PETSc DataTypes
926dd63270SBarry Smith!
936dd63270SBarry Smith#if defined(PETSC_USE_REAL_SINGLE)
946dd63270SBarry Smith#define PETSC_REAL PETSC_FLOAT
956dd63270SBarry Smith#elif defined(PETSC_USE_REAL___FLOAT128)
966dd63270SBarry Smith#define PETSC_REAL PETSC___FLOAT128
976dd63270SBarry Smith#else
986dd63270SBarry Smith#define PETSC_REAL PETSC_DOUBLE
996dd63270SBarry Smith#endif
1006dd63270SBarry Smith#define PETSC_FORTRANADDR PETSC_LONG
1016dd63270SBarry Smith
1026dd63270SBarry Smith!     PETSc mathematics include file. Defines certain basic mathematical
1036dd63270SBarry Smith!    constants and functions for working with single and double precision
1046dd63270SBarry Smith!    floating point numbers as well as complex and integers.
1056dd63270SBarry Smith!
1066dd63270SBarry Smith!     Representation of complex i
1076dd63270SBarry Smith!
1086dd63270SBarry Smith#if defined(PETSC_USE_REAL_SINGLE)
1096dd63270SBarry Smith      PetscComplex, parameter :: PETSC_i = (0.0e0,1.0e0)
1106dd63270SBarry Smith#else
1116dd63270SBarry Smith      PetscComplex, parameter :: PETSC_i = (0.0d0,1.0d0)
1126dd63270SBarry Smith#endif
1136dd63270SBarry Smith
1146dd63270SBarry Smith!      A PETSC_NULL_FUNCTION pointer
1156dd63270SBarry Smith!
1166dd63270SBarry Smith      external PETSC_NULL_FUNCTION
1176dd63270SBarry Smith!
1186dd63270SBarry Smith!     Possible arguments to PetscPushErrorHandler()
1196dd63270SBarry Smith!
1206dd63270SBarry Smith      external PETSCTRACEBACKERRORHANDLER
1216dd63270SBarry Smith      external PETSCABORTERRORHANDLER
1226dd63270SBarry Smith      external PETSCEMACSCLIENTERRORHANDLER
1236dd63270SBarry Smith      external PETSCATTACHDEBUGGERERRORHANDLER
1246dd63270SBarry Smith      external PETSCIGNOREERRORHANDLER
1256dd63270SBarry Smith!
1266dd63270SBarry Smith      external  PetscIsInfOrNanScalar
1276dd63270SBarry Smith      external  PetscIsInfOrNanReal
1286dd63270SBarry Smith      PetscBool PetscIsInfOrNanScalar
1296dd63270SBarry Smith      PetscBool PetscIsInfOrNanReal
1306dd63270SBarry Smith
1316dd63270SBarry Smith#include <../ftn/sys/petscall.h>
1326dd63270SBarry Smith
1336dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_STDOUT_SELF  = tPetscViewer(9)
1346dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_DRAW_WORLD   = tPetscViewer(4)
1356dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_DRAW_SELF    = tPetscViewer(5)
1366dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_SOCKET_WORLD = tPetscViewer(6)
1376dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_SOCKET_SELF  = tPetscViewer(7)
1386dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_STDOUT_WORLD = tPetscViewer(8)
1396dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_STDERR_WORLD = tPetscViewer(10)
1406dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_STDERR_SELF  = tPetscViewer(11)
1416dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_BINARY_WORLD = tPetscViewer(12)
1426dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_BINARY_SELF  = tPetscViewer(13)
1436dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_MATLAB_WORLD = tPetscViewer(14)
1446dd63270SBarry Smith      PetscViewer, parameter :: PETSC_VIEWER_MATLAB_SELF  = tPetscViewer(15)
1456dd63270SBarry Smith
1466dd63270SBarry Smith      PetscViewer PETSC_VIEWER_STDOUT_
1476dd63270SBarry Smith      PetscViewer PETSC_VIEWER_DRAW_
1486dd63270SBarry Smith      external PETSC_VIEWER_STDOUT_
1496dd63270SBarry Smith      external PETSC_VIEWER_DRAW_
1506dd63270SBarry Smith      external PetscViewerAndFormatDestroy
1516dd63270SBarry Smith
1526dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
1536dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_STDOUT_SELF
1546dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_DRAW_WORLD
1556dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_DRAW_SELF
1566dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_SOCKET_WORLD
1576dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_SOCKET_SELF
1586dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_STDOUT_WORLD
1596dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_STDERR_WORLD
1606dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_STDERR_SELF
1616dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_BINARY_WORLD
1626dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_BINARY_SELF
1636dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_MATLAB_WORLD
1646dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_VIEWER_MATLAB_SELF
1656dd63270SBarry Smith#endif
1666dd63270SBarry Smith
1676dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_MEM              = 55
1686dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_SUP              = 56
1696dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_SUP_SYS          = 57
1706dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ORDER            = 58
1716dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_SIG              = 59
1726dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_FP               = 72
1736dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_COR              = 74
1746dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_LIB              = 76
1756dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_PLIB             = 77
1766dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_MEMC             = 78
1776dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_CONV_FAILED      = 82
1786dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_USER             = 83
1796dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_SYS              = 88
1806dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_POINTER          = 70
1816dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_MPI_LIB_INCOMP   = 87
1826dd63270SBarry Smith
1836dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_SIZ          = 60
1846dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_IDN          = 61
1856dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_WRONG        = 62
1866dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_CORRUPT      = 64
1876dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_OUTOFRANGE   = 63
1886dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_BADPTR       = 68
1896dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_NOTSAMETYPE  = 69
1906dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_NOTSAMECOMM  = 80
1916dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_WRONGSTATE   = 73
1926dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_TYPENOTSET   = 89
1936dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_INCOMP       = 75
1946dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_NULL         = 85
1956dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_ARG_UNKNOWN_TYPE = 86
1966dd63270SBarry Smith
1976dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_FILE_OPEN        = 65
1986dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_FILE_READ        = 66
1996dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_FILE_WRITE       = 67
2006dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_FILE_UNEXPECTED  = 79
2016dd63270SBarry Smith
2026dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_MAT_LU_ZRPVT     = 71
2036dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_MAT_CH_ZRPVT     = 81
2046dd63270SBarry Smith
2056dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_INT_OVERFLOW     = 84
2066dd63270SBarry Smith
2076dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_FLOP_COUNT       = 90
2086dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_NOT_CONVERGED    = 91
2096dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_MISSING_FACTOR   = 92
2106dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_OPT_OVERWRITE    = 93
2116dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_WRONG_MPI_SIZE   = 94
2126dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_USER_INPUT       = 95
2136dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_GPU_RESOURCE     = 96
2146dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_GPU              = 97
2156dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_MPI              = 98
2166dd63270SBarry Smith      PetscErrorCode, parameter :: PETSC_ERR_RETURN           = 99
2176dd63270SBarry Smith
2186dd63270SBarry Smith        character(len = 80) :: PETSC_NULL_CHARACTER = ''
2196dd63270SBarry Smith        PetscInt PETSC_NULL_INTEGER, PETSC_NULL_INTEGER_ARRAY(1)
2206dd63270SBarry Smith        PetscInt, pointer :: PETSC_NULL_INTEGER_POINTER(:)
2216dd63270SBarry Smith        PetscScalar, pointer :: PETSC_NULL_SCALAR_POINTER(:)
2226dd63270SBarry Smith        PetscFortranDouble PETSC_NULL_DOUBLE
2236dd63270SBarry Smith        PetscScalar PETSC_NULL_SCALAR, PETSC_NULL_SCALAR_ARRAY(1)
2246dd63270SBarry Smith        PetscReal PETSC_NULL_REAL, PETSC_NULL_REAL_ARRAY(1)
2256dd63270SBarry Smith        PetscReal, pointer :: PETSC_NULL_REAL_POINTER(:)
2266dd63270SBarry Smith        PetscBool PETSC_NULL_BOOL
2276dd63270SBarry Smith        PetscEnum PETSC_NULL_ENUM
2286dd63270SBarry Smith        MPI_Comm  PETSC_NULL_MPI_COMM
2296dd63270SBarry Smith!
2306dd63270SBarry Smith!     Basic math constants
2316dd63270SBarry Smith!
2326dd63270SBarry Smith        PetscReal PETSC_PI
2336dd63270SBarry Smith        PetscReal PETSC_MAX_REAL
2346dd63270SBarry Smith        PetscReal PETSC_MIN_REAL
2356dd63270SBarry Smith        PetscReal PETSC_MACHINE_EPSILON
2366dd63270SBarry Smith        PetscReal PETSC_SQRT_MACHINE_EPSILON
2376dd63270SBarry Smith        PetscReal PETSC_SMALL
2386dd63270SBarry Smith        PetscReal PETSC_INFINITY
2396dd63270SBarry Smith        PetscReal PETSC_NINFINITY
2406dd63270SBarry Smith
2416dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
2426dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_CHARACTER
2436dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_INTEGER
2446dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_INTEGER_ARRAY
2456dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_INTEGER_POINTER
2466dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_SCALAR_POINTER
2476dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_REAL_POINTER
2486dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_DOUBLE
2496dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_SCALAR
2506dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_SCALAR_ARRAY
2516dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_REAL
2526dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_REAL_ARRAY
2536dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_BOOL
2546dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_ENUM
2556dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_MPI_COMM
2566dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_PI
2576dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_MAX_REAL
2586dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_MIN_REAL
2596dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_MACHINE_EPSILON
2606dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_SQRT_MACHINE_EPSILON
2616dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_SMALL
2626dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_INFINITY
2636dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PETSC_NINFINITY
2646dd63270SBarry Smith#endif
2656dd63270SBarry Smith
2666dd63270SBarry Smith      type tPetscReal2d
2676dd63270SBarry Smith        sequence
2686dd63270SBarry Smith        PetscReal, dimension(:), pointer :: ptr
2696dd63270SBarry Smith      end type tPetscReal2D
2706dd63270SBarry Smith
2716dd63270SBarry Smith       end module
2726dd63270SBarry Smith
2736dd63270SBarry Smith!     ------------------------------------------------------------------------
2746dd63270SBarry Smith
2756dd63270SBarry Smith        module petscsys
2766dd63270SBarry Smith        use,intrinsic :: iso_c_binding
2776dd63270SBarry Smith        use petscsysdef
2786dd63270SBarry Smith
2796dd63270SBarry Smith#include <../src/sys/ftn-mod/petscsys.h90>
2806dd63270SBarry Smith#include <../src/sys/ftn-mod/petscviewer.h90>
2816dd63270SBarry Smith#include <../ftn/sys/petscall.h90>
2826dd63270SBarry Smith
2836dd63270SBarry Smith        interface PetscInitialize
2846dd63270SBarry Smith          module procedure PetscInitializeWithHelp, PetscInitializeNoHelp, PetscInitializeNoArguments
2856dd63270SBarry Smith        end interface
2866dd63270SBarry Smith
2876dd63270SBarry Smith      interface PetscSetFortranBasePointers
2886dd63270SBarry Smith         subroutine PetscSetFortranBasePointers(                        &
2896dd63270SBarry Smith     &     PETSC_NULL_CHARACTER,          &
2906dd63270SBarry Smith     &     PETSC_NULL_INTEGER,PETSC_NULL_SCALAR,                        &
2916dd63270SBarry Smith     &     PETSC_NULL_DOUBLE,PETSC_NULL_REAL,                           &
2926dd63270SBarry Smith     &     PETSC_NULL_BOOL,PETSC_NULL_ENUM,PETSC_NULL_FUNCTION,         &
2936dd63270SBarry Smith     &     PETSC_NULL_MPI_COMM,                                         &
2946dd63270SBarry Smith     &     PETSC_NULL_INTEGER_ARRAY,PETSC_NULL_SCALAR_ARRAY,            &
2956dd63270SBarry Smith     &     PETSC_NULL_REAL_ARRAY, APETSC_NULL_INTEGER_POINTER,           &
2966dd63270SBarry Smith     &     PETSC_NULL_SCALAR_POINTER, PETSC_NULL_REAL_POINTER)
297*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
2986dd63270SBarry Smith          character(*) PETSC_NULL_CHARACTER
2996dd63270SBarry Smith          PetscInt PETSC_NULL_INTEGER
3006dd63270SBarry Smith          PetscScalar PETSC_NULL_SCALAR
3016dd63270SBarry Smith          PetscFortranDouble PETSC_NULL_DOUBLE
3026dd63270SBarry Smith          PetscReal PETSC_NULL_REAL
3036dd63270SBarry Smith          PetscBool PETSC_NULL_BOOL
3046dd63270SBarry Smith          PetscEnum PETSC_NULL_ENUM
3056dd63270SBarry Smith          external PETSC_NULL_FUNCTION
3066dd63270SBarry Smith          MPI_Comm PETSC_NULL_MPI_COMM
3076dd63270SBarry Smith          PetscInt PETSC_NULL_INTEGER_ARRAY(*)
3086dd63270SBarry Smith          PetscScalar PETSC_NULL_SCALAR_ARRAY(*)
3096dd63270SBarry Smith          PetscReal PETSC_NULL_REAL_ARRAY(*)
3106dd63270SBarry Smith          PetscInt, pointer :: APETSC_NULL_INTEGER_POINTER(:)
3116dd63270SBarry Smith          PetscScalar, pointer :: PETSC_NULL_SCALAR_POINTER(:)
3126dd63270SBarry Smith          PetscReal, pointer :: PETSC_NULL_REAL_POINTER(:)
3136dd63270SBarry Smith         end subroutine PetscSetFortranBasePointers
3146dd63270SBarry Smith      end interface
3156dd63270SBarry Smith
3166dd63270SBarry Smith      interface PetscOptionsString
3176dd63270SBarry Smith      subroutine PetscOptionsString(string, text, man, default, value, flg, ierr)
318*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
3196dd63270SBarry Smith        character(*) string, text, man, default, value
3206dd63270SBarry Smith        PetscBool flg
3216dd63270SBarry Smith        PetscErrorCode ierr
3226dd63270SBarry Smith      end subroutine PetscOptionsString
3236dd63270SBarry Smith      end interface
3246dd63270SBarry Smith
3256dd63270SBarry Smith        Interface petscbinaryread
3266dd63270SBarry Smith        subroutine petscbinaryreadcomplex(fd,data,num,count,type,z)
327*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
3286dd63270SBarry Smith          import ePetscDataType
3296dd63270SBarry Smith          integer4 fd
3306dd63270SBarry Smith          PetscComplex data(*)
3316dd63270SBarry Smith          PetscInt num
3326dd63270SBarry Smith          PetscInt count
3336dd63270SBarry Smith          PetscDataType type
3346dd63270SBarry Smith          PetscErrorCode z
3356dd63270SBarry Smith        end subroutine
3366dd63270SBarry Smith        subroutine petscbinaryreadreal(fd,data,num,count,type,z)
337*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
3386dd63270SBarry Smith          import ePetscDataType
3396dd63270SBarry Smith          integer4 fd
3406dd63270SBarry Smith          PetscReal data(*)
3416dd63270SBarry Smith          PetscInt num
3426dd63270SBarry Smith          PetscInt count
3436dd63270SBarry Smith          PetscDataType type
3446dd63270SBarry Smith          PetscErrorCode z
3456dd63270SBarry Smith        end subroutine
3466dd63270SBarry Smith        subroutine petscbinaryreadint(fd,data,num,count,type,z)
347*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
3486dd63270SBarry Smith          import ePetscDataType
3496dd63270SBarry Smith          integer4 fd
3506dd63270SBarry Smith          PetscInt data(*)
3516dd63270SBarry Smith          PetscInt num
3526dd63270SBarry Smith          PetscInt count
3536dd63270SBarry Smith          PetscDataType type
3546dd63270SBarry Smith          PetscErrorCode z
3556dd63270SBarry Smith        end subroutine
3566dd63270SBarry Smith        subroutine petscbinaryreadcomplex1(fd,data,num,count,type,z)
357*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
3586dd63270SBarry Smith          import ePetscDataType
3596dd63270SBarry Smith          integer4 fd
3606dd63270SBarry Smith          PetscComplex data
3616dd63270SBarry Smith          PetscInt num
3626dd63270SBarry Smith          PetscInt count
3636dd63270SBarry Smith          PetscDataType type
3646dd63270SBarry Smith          PetscErrorCode z
3656dd63270SBarry Smith        end subroutine
3666dd63270SBarry Smith        subroutine petscbinaryreadreal1(fd,data,num,count,type,z)
367*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
3686dd63270SBarry Smith          import ePetscDataType
3696dd63270SBarry Smith          integer4 fd
3706dd63270SBarry Smith          PetscReal data
3716dd63270SBarry Smith          PetscInt num
3726dd63270SBarry Smith          PetscInt count
3736dd63270SBarry Smith          PetscDataType type
3746dd63270SBarry Smith          PetscErrorCode z
3756dd63270SBarry Smith        end subroutine
3766dd63270SBarry Smith        subroutine petscbinaryreadint1(fd,data,num,count,type,z)
377*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
3786dd63270SBarry Smith          import ePetscDataType
3796dd63270SBarry Smith          integer4 fd
3806dd63270SBarry Smith          PetscInt data
3816dd63270SBarry Smith          PetscInt num
3826dd63270SBarry Smith          PetscInt count
3836dd63270SBarry Smith          PetscDataType type
3846dd63270SBarry Smith          PetscErrorCode z
3856dd63270SBarry Smith        end subroutine
3866dd63270SBarry Smith        subroutine petscbinaryreadcomplexcnt(fd,data,num,count,type,z)
387*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
3886dd63270SBarry Smith          import ePetscDataType
3896dd63270SBarry Smith          integer4 fd
3906dd63270SBarry Smith          PetscComplex data(*)
3916dd63270SBarry Smith          PetscInt num
3926dd63270SBarry Smith          PetscInt count(1)
3936dd63270SBarry Smith          PetscDataType type
3946dd63270SBarry Smith          PetscErrorCode z
3956dd63270SBarry Smith        end subroutine
3966dd63270SBarry Smith        subroutine petscbinaryreadrealcnt(fd,data,num,count,type,z)
397*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
3986dd63270SBarry Smith          import ePetscDataType
3996dd63270SBarry Smith          integer4 fd
4006dd63270SBarry Smith          PetscReal data(*)
4016dd63270SBarry Smith          PetscInt num
4026dd63270SBarry Smith          PetscInt count(1)
4036dd63270SBarry Smith          PetscDataType type
4046dd63270SBarry Smith          PetscErrorCode z
4056dd63270SBarry Smith        end subroutine
4066dd63270SBarry Smith        subroutine petscbinaryreadintcnt(fd,data,num,count,type,z)
407*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
4086dd63270SBarry Smith          import ePetscDataType
4096dd63270SBarry Smith          integer4 fd
4106dd63270SBarry Smith          PetscInt data(*)
4116dd63270SBarry Smith          PetscInt num
4126dd63270SBarry Smith          PetscInt count(1)
4136dd63270SBarry Smith          PetscDataType type
4146dd63270SBarry Smith          PetscErrorCode z
4156dd63270SBarry Smith        end subroutine
4166dd63270SBarry Smith        subroutine petscbinaryreadcomplex1cnt(fd,data,num,count,type,z)
417*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
4186dd63270SBarry Smith          import ePetscDataType
4196dd63270SBarry Smith          integer4 fd
4206dd63270SBarry Smith          PetscComplex data
4216dd63270SBarry Smith          PetscInt num
4226dd63270SBarry Smith          PetscInt count(1)
4236dd63270SBarry Smith          PetscDataType type
4246dd63270SBarry Smith          PetscErrorCode z
4256dd63270SBarry Smith        end subroutine
4266dd63270SBarry Smith        subroutine petscbinaryreadreal1cnt(fd,data,num,count,type,z)
427*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
4286dd63270SBarry Smith          import ePetscDataType
4296dd63270SBarry Smith          integer4 fd
4306dd63270SBarry Smith          PetscReal data
4316dd63270SBarry Smith          PetscInt num
4326dd63270SBarry Smith          PetscInt count(1)
4336dd63270SBarry Smith          PetscDataType type
4346dd63270SBarry Smith          PetscErrorCode z
4356dd63270SBarry Smith        end subroutine
4366dd63270SBarry Smith        subroutine petscbinaryreadint1cnt(fd,data,num,count,type,z)
437*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
4386dd63270SBarry Smith          import ePetscDataType
4396dd63270SBarry Smith          integer4 fd
4406dd63270SBarry Smith          PetscInt data
4416dd63270SBarry Smith          PetscInt num
4426dd63270SBarry Smith          PetscInt count(1)
4436dd63270SBarry Smith          PetscDataType type
4446dd63270SBarry Smith          PetscErrorCode z
4456dd63270SBarry Smith        end subroutine
4466dd63270SBarry Smith        end Interface
4476dd63270SBarry Smith
4486dd63270SBarry Smith        Interface petscbinarywrite
4496dd63270SBarry Smith        subroutine petscbinarywritecomplex(fd,data,num,type,z)
450*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
4516dd63270SBarry Smith          import ePetscDataType
4526dd63270SBarry Smith          integer4 fd
4536dd63270SBarry Smith          PetscComplex data(*)
4546dd63270SBarry Smith          PetscInt num
4556dd63270SBarry Smith          PetscDataType type
4566dd63270SBarry Smith          PetscErrorCode z
4576dd63270SBarry Smith        end subroutine
4586dd63270SBarry Smith        subroutine petscbinarywritereal(fd,data,num,type,z)
459*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
4606dd63270SBarry Smith          import ePetscDataType
4616dd63270SBarry Smith          integer4 fd
4626dd63270SBarry Smith          PetscReal data(*)
4636dd63270SBarry Smith          PetscInt num
4646dd63270SBarry Smith          PetscDataType type
4656dd63270SBarry Smith          PetscErrorCode z
4666dd63270SBarry Smith        end subroutine
4676dd63270SBarry Smith        subroutine petscbinarywriteint(fd,data,num,type,z)
468*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
4696dd63270SBarry Smith          import ePetscDataType
4706dd63270SBarry Smith          integer4 fd
4716dd63270SBarry Smith          PetscInt data(*)
4726dd63270SBarry Smith          PetscInt num
4736dd63270SBarry Smith          PetscDataType type
4746dd63270SBarry Smith          PetscErrorCode z
4756dd63270SBarry Smith        end subroutine
4766dd63270SBarry Smith        subroutine petscbinarywritecomplex1(fd,data,num,type,z)
477*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
4786dd63270SBarry Smith          import ePetscDataType
4796dd63270SBarry Smith          integer4 fd
4806dd63270SBarry Smith          PetscComplex data
4816dd63270SBarry Smith          PetscInt num
4826dd63270SBarry Smith          PetscDataType type
4836dd63270SBarry Smith          PetscErrorCode z
4846dd63270SBarry Smith        end subroutine
4856dd63270SBarry Smith        subroutine petscbinarywritereal1(fd,data,num,type,z)
486*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
4876dd63270SBarry Smith          import ePetscDataType
4886dd63270SBarry Smith          integer4 fd
4896dd63270SBarry Smith          PetscReal data
4906dd63270SBarry Smith          PetscInt num
4916dd63270SBarry Smith          PetscDataType type
4926dd63270SBarry Smith          PetscErrorCode z
4936dd63270SBarry Smith        end subroutine
4946dd63270SBarry Smith        subroutine petscbinarywriteint1(fd,data,num,type,z)
495*fe66ebccSMartin Diehl          use, intrinsic :: ISO_C_binding
4966dd63270SBarry Smith          import ePetscDataType
4976dd63270SBarry Smith          integer4 fd
4986dd63270SBarry Smith          PetscInt data
4996dd63270SBarry Smith          PetscInt num
5006dd63270SBarry Smith          PetscDataType type
5016dd63270SBarry Smith          PetscErrorCode z
5026dd63270SBarry Smith          end subroutine
5036dd63270SBarry Smith        end Interface
5046dd63270SBarry Smith
5056dd63270SBarry Smith      contains
5066dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
5076dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PetscInitializeWithHelp
5086dd63270SBarry Smith#endif
5096dd63270SBarry Smith      subroutine PetscInitializeWithHelp(filename,help,ierr)
5106dd63270SBarry Smith          character(len=*)           :: filename
5116dd63270SBarry Smith          character(len=*)           :: help
5126dd63270SBarry Smith          PetscErrorCode             :: ierr
5136dd63270SBarry Smith
5146dd63270SBarry Smith          if (filename .ne. PETSC_NULL_CHARACTER) then
5156dd63270SBarry Smith             call PetscInitializeF(trim(filename),help,ierr)
5166dd63270SBarry Smith             CHKERRQ(ierr)
5176dd63270SBarry Smith          else
5186dd63270SBarry Smith             call PetscInitializeF(filename,help,ierr)
5196dd63270SBarry Smith             CHKERRQ(ierr)
5206dd63270SBarry Smith          endif
5216dd63270SBarry Smith        end subroutine PetscInitializeWithHelp
5226dd63270SBarry Smith
5236dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
5246dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PetscInitializeNoHelp
5256dd63270SBarry Smith#endif
5266dd63270SBarry Smith        subroutine PetscInitializeNoHelp(filename,ierr)
5276dd63270SBarry Smith          character(len=*)           :: filename
5286dd63270SBarry Smith          PetscErrorCode             :: ierr
5296dd63270SBarry Smith
5306dd63270SBarry Smith          if (filename .ne. PETSC_NULL_CHARACTER) then
5316dd63270SBarry Smith             call PetscInitializeF(trim(filename),PETSC_NULL_CHARACTER,ierr)
5326dd63270SBarry Smith             CHKERRQ(ierr)
5336dd63270SBarry Smith          else
5346dd63270SBarry Smith             call PetscInitializeF(filename,PETSC_NULL_CHARACTER,ierr)
5356dd63270SBarry Smith             CHKERRQ(ierr)
5366dd63270SBarry Smith          endif
5376dd63270SBarry Smith        end subroutine PetscInitializeNoHelp
5386dd63270SBarry Smith
5396dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
5406dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT::PetscInitializeNoArguments
5416dd63270SBarry Smith#endif
5426dd63270SBarry Smith        subroutine PetscInitializeNoArguments(ierr)
5436dd63270SBarry Smith          PetscErrorCode             :: ierr
5446dd63270SBarry Smith
5456dd63270SBarry Smith          call PetscInitializeF(PETSC_NULL_CHARACTER,PETSC_NULL_CHARACTER,ierr)
5466dd63270SBarry Smith          CHKERRQ(ierr)
5476dd63270SBarry Smith          end subroutine PetscInitializeNoArguments
5486dd63270SBarry Smith
5496dd63270SBarry Smith#include <../ftn/sys/petscall.hf90>
5506dd63270SBarry Smith        end module
5516dd63270SBarry Smith
5526dd63270SBarry Smith        Subroutine F90ArraySetRealPointer(array, sz, j, T)
5536dd63270SBarry Smith          use petscsysdef
5546dd63270SBarry Smith          PetscInt                j,sz
5556dd63270SBarry Smith          PetscReal, target    :: array(1:sz)
5566dd63270SBarry Smith          PetscReal2d, pointer :: T(:)
5576dd63270SBarry Smith          T(j+1)%ptr=>array
5586dd63270SBarry Smith        End Subroutine
5596dd63270SBarry Smith#if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
5606dd63270SBarry Smith!DEC$ ATTRIBUTES DLLEXPORT:: F90ArraySetRealPointer
5616dd63270SBarry Smith#endif
5626dd63270SBarry Smith
5636dd63270SBarry Smith!      ------------------------------------------------------------------------
5646dd63270SBarry Smith!      TODO: generate the modules below by looping over
5656dd63270SBarry Smith!            ftn/sys/XXX.h90
566bfe80ac4SPierre Jolivet!            and skipping those in petscall.h
5676dd63270SBarry Smith
5686dd63270SBarry Smith        module petscbag
5696dd63270SBarry Smith        use petscsys
5706dd63270SBarry Smith#include <../include/petsc/finclude/petscbag.h>
5716dd63270SBarry Smith#include <../ftn/sys/petscbag.h>
5726dd63270SBarry Smith#include <../ftn/sys/petscbag.h90>
5736dd63270SBarry Smith        contains
5746dd63270SBarry Smith
5756dd63270SBarry Smith#include <../ftn/sys/petscbag.hf90>
5766dd63270SBarry Smith        end module
5776dd63270SBarry Smith
5786dd63270SBarry Smith!     ------------------------------------------------------------------------
5796dd63270SBarry Smith
5806dd63270SBarry Smith        module petscbm
5816dd63270SBarry Smith        use petscsys
5826dd63270SBarry Smith#include <../include/petsc/finclude/petscbm.h>
5836dd63270SBarry Smith#include <../ftn/sys/petscbm.h>
5846dd63270SBarry Smith#include <../ftn/sys/petscbm.h90>
5856dd63270SBarry Smith        contains
5866dd63270SBarry Smith
5876dd63270SBarry Smith#include <../ftn/sys/petscbm.hf90>
5886dd63270SBarry Smith       end module
5896dd63270SBarry Smith
5906dd63270SBarry Smith!     ------------------------------------------------------------------------
5916dd63270SBarry Smith
5926dd63270SBarry Smith        module petscmatlab
5936dd63270SBarry Smith        use petscsys
5946dd63270SBarry Smith#include <../include/petsc/finclude/petscmatlab.h>
5956dd63270SBarry Smith#include <../ftn/sys/petscmatlab.h>
5966dd63270SBarry Smith#include <../ftn/sys/petscmatlab.h90>
5976dd63270SBarry Smith
5986dd63270SBarry Smith        contains
5996dd63270SBarry Smith
6006dd63270SBarry Smith#include <../ftn/sys/petscmatlab.hf90>
6016dd63270SBarry Smith        end module
6026dd63270SBarry Smith
6036dd63270SBarry Smith!     ------------------------------------------------------------------------
6046dd63270SBarry Smith
6056dd63270SBarry Smith        module petscdraw
6066dd63270SBarry Smith        use petscsys
6076dd63270SBarry Smith#include <../include/petsc/finclude/petscdraw.h>
6086dd63270SBarry Smith#include <../ftn/sys/petscdraw.h>
6096dd63270SBarry Smith#include <../ftn/sys/petscdraw.h90>
6106dd63270SBarry Smith
6116dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_BASIC_COLORS = 33
6126dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_ROTATE = -1
6136dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_WHITE = 0
6146dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_BLACK = 1
6156dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_RED = 2
6166dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_GREEN = 3
6176dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_CYAN = 4
6186dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_BLUE = 5
6196dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_MAGENTA = 6
6206dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_AQUAMARINE = 7
6216dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_FORESTGREEN = 8
6226dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_ORANGE = 9
6236dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_VIOLET = 10
6246dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_BROWN = 11
6256dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_PINK = 12
6266dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_CORAL = 13
6276dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_GRAY = 14
6286dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_YELLOW = 15
6296dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_GOLD = 16
6306dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_LIGHTPINK = 17
6316dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_MEDIUMTURQUOISE = 18
6326dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_KHAKI = 19
6336dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_DIMGRAY = 20
6346dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_YELLOWGREEN = 21
6356dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_SKYBLUE = 22
6366dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_DARKGREEN = 23
6376dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_NAVYBLUE = 24
6386dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_SANDYBROWN = 25
6396dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_CADETBLUE = 26
6406dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_POWDERBLUE = 27
6416dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_DEEPPINK = 28
6426dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_THISTLE = 29
6436dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_LIMEGREEN = 30
6446dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_LAVENDERBLUSH = 31
6456dd63270SBarry Smith      PetscEnum, parameter :: PETSC_DRAW_PLUM = 32
6466dd63270SBarry Smith
6476dd63270SBarry Smith      contains
6486dd63270SBarry Smith
6496dd63270SBarry Smith#include <../ftn/sys/petscdraw.hf90>
6506dd63270SBarry Smith      end module
6516dd63270SBarry Smith
6526dd63270SBarry Smith!     ------------------------------------------------------------------------
6536dd63270SBarry Smith
6546dd63270SBarry Smith        subroutine PetscSetCOMM(c1,c2)
655*fe66ebccSMartin Diehl        use, intrinsic :: ISO_C_binding
6566dd63270SBarry Smith        use petscmpi, only: PETSC_COMM_WORLD,PETSC_COMM_SELF
6576dd63270SBarry Smith
6586dd63270SBarry Smith        implicit none
6596dd63270SBarry Smith        MPI_Comm c1,c2
6606dd63270SBarry Smith
6616dd63270SBarry Smith        PETSC_COMM_WORLD    = c1
6626dd63270SBarry Smith        PETSC_COMM_SELF     = c2
6636dd63270SBarry Smith        end
6646dd63270SBarry Smith
6656dd63270SBarry Smith        subroutine PetscGetCOMM(c1)
666*fe66ebccSMartin Diehl        use, intrinsic :: ISO_C_binding
6676dd63270SBarry Smith        use petscmpi, only: PETSC_COMM_WORLD
6686dd63270SBarry Smith        implicit none
6696dd63270SBarry Smith        MPI_Comm c1
6706dd63270SBarry Smith
6716dd63270SBarry Smith        c1 = PETSC_COMM_WORLD
6726dd63270SBarry Smith        end
6736dd63270SBarry Smith
6746dd63270SBarry Smith        subroutine PetscSetModuleBlock()
675*fe66ebccSMartin Diehl        use, intrinsic :: ISO_C_binding
6766dd63270SBarry Smith        use petscsys!, only: PETSC_NULL_CHARACTER,PETSC_NULL_INTEGER,&
6776dd63270SBarry Smith           !  PETSC_NULL_SCALAR,PETSC_NULL_DOUBLE,PETSC_NULL_REAL,&
6786dd63270SBarry Smith           !  PETSC_NULL_BOOL,PETSC_NULL_FUNCTION,PETSC_NULL_MPI_COMM
6796dd63270SBarry Smith        implicit none
6806dd63270SBarry Smith
6816dd63270SBarry Smith        call PetscSetFortranBasePointers(PETSC_NULL_CHARACTER,          &
6826dd63270SBarry Smith     &     PETSC_NULL_INTEGER,PETSC_NULL_SCALAR,                        &
6836dd63270SBarry Smith     &     PETSC_NULL_DOUBLE,PETSC_NULL_REAL,                           &
6846dd63270SBarry Smith     &     PETSC_NULL_BOOL,PETSC_NULL_ENUM,PETSC_NULL_FUNCTION,         &
6856dd63270SBarry Smith     &     PETSC_NULL_MPI_COMM,                                         &
6866dd63270SBarry Smith     &     PETSC_NULL_INTEGER_ARRAY,PETSC_NULL_SCALAR_ARRAY,            &
6876dd63270SBarry Smith     &     PETSC_NULL_REAL_ARRAY, PETSC_NULL_INTEGER_POINTER,           &
6886dd63270SBarry Smith     &     PETSC_NULL_SCALAR_POINTER, PETSC_NULL_REAL_POINTER)
6896dd63270SBarry Smith        end
6906dd63270SBarry Smith
6916dd63270SBarry Smith        subroutine PetscSetModuleBlockMPI(freal,fscalar,fsum,finteger)
692*fe66ebccSMartin Diehl        use, intrinsic :: ISO_C_binding
6936dd63270SBarry Smith        use petscmpi, only: MPIU_REAL,MPIU_SUM,MPIU_SCALAR,MPIU_INTEGER
6946dd63270SBarry Smith        implicit none
6956dd63270SBarry Smith
6966dd63270SBarry Smith        integer4 freal,fscalar,fsum,finteger
6976dd63270SBarry Smith
6986dd63270SBarry Smith        MPIU_REAL    = freal
6996dd63270SBarry Smith        MPIU_SCALAR  = fscalar
7006dd63270SBarry Smith        MPIU_SUM     = fsum
7016dd63270SBarry Smith        MPIU_INTEGER = finteger
7026dd63270SBarry Smith
7036dd63270SBarry Smith        end
7046dd63270SBarry Smith
7056dd63270SBarry Smith        subroutine PetscSetModuleBlockNumeric(pi,maxreal,minreal,eps,       &
7066dd63270SBarry Smith     &     seps,small,pinf,pninf)
7076dd63270SBarry Smith        use petscsys, only: PETSC_PI,PETSC_MAX_REAL,PETSC_MIN_REAL,&
7086dd63270SBarry Smith             PETSC_MACHINE_EPSILON,PETSC_SQRT_MACHINE_EPSILON,&
7096dd63270SBarry Smith             PETSC_SMALL,PETSC_INFINITY,PETSC_NINFINITY
710*fe66ebccSMartin Diehl        use, intrinsic :: ISO_C_binding
7116dd63270SBarry Smith        implicit none
7126dd63270SBarry Smith
7136dd63270SBarry Smith        PetscReal pi,maxreal,minreal,eps,seps
7146dd63270SBarry Smith        PetscReal small,pinf,pninf
7156dd63270SBarry Smith
7166dd63270SBarry Smith        PETSC_PI = pi
7176dd63270SBarry Smith        PETSC_MAX_REAL = maxreal
7186dd63270SBarry Smith        PETSC_MIN_REAL = minreal
7196dd63270SBarry Smith        PETSC_MACHINE_EPSILON = eps
7206dd63270SBarry Smith        PETSC_SQRT_MACHINE_EPSILON = seps
7216dd63270SBarry Smith        PETSC_SMALL = small
7226dd63270SBarry Smith        PETSC_INFINITY = pinf
7236dd63270SBarry Smith        PETSC_NINFINITY = pninf
7246dd63270SBarry Smith
7256dd63270SBarry Smith        end
7266dd63270SBarry Smith
727