Actual source code: f90impl.h


  2: #ifndef PETSCF90_H
  3: #define PETSCF90_H
  4: #include <petsc/private/fortranimpl.h>

  6: /* PGI compilers pass in f90 pointers as 2 arguments */
  7: #if defined(PETSC_HAVE_F90_2PTR_ARG)
  8:   #define PETSC_F90_2PTR_PROTO_NOVAR , void *
  9:   #define PETSC_F90_2PTR_PROTO(ptr)  , void *ptr
 10:   #define PETSC_F90_2PTR_PARAM(ptr)  , ptr
 11: #else
 12:   #define PETSC_F90_2PTR_PROTO_NOVAR
 13:   #define PETSC_F90_2PTR_PROTO(ptr)
 14:   #define PETSC_F90_2PTR_PARAM(ptr)
 15: #endif

 17: typedef struct {
 18:   char dummy;
 19: } F90Array1d;
 20: typedef struct {
 21:   char dummy;
 22: } F90Array2d;
 23: typedef struct {
 24:   char dummy;
 25: } F90Array3d;
 26: typedef struct {
 27:   char dummy;
 28: } F90Array4d;

 30: PETSC_EXTERN PetscErrorCode F90Array1dCreate(void *, MPI_Datatype, PetscInt, PetscInt, F90Array1d *PETSC_F90_2PTR_PROTO_NOVAR);
 31: PETSC_EXTERN PetscErrorCode F90Array1dAccess(F90Array1d *, MPI_Datatype, void **PETSC_F90_2PTR_PROTO_NOVAR);
 32: PETSC_EXTERN PetscErrorCode F90Array1dDestroy(F90Array1d *, MPI_Datatype PETSC_F90_2PTR_PROTO_NOVAR);
 33: PETSC_EXTERN PetscErrorCode F90Array1dGetNextRecord(F90Array1d *, void **PETSC_F90_2PTR_PROTO_NOVAR);

 35: PETSC_EXTERN PetscErrorCode F90Array2dCreate(void *, MPI_Datatype, PetscInt, PetscInt, PetscInt, PetscInt, F90Array2d *PETSC_F90_2PTR_PROTO_NOVAR);
 36: PETSC_EXTERN PetscErrorCode F90Array2dAccess(F90Array2d *, MPI_Datatype, void **PETSC_F90_2PTR_PROTO_NOVAR);
 37: PETSC_EXTERN PetscErrorCode F90Array2dDestroy(F90Array2d *, MPI_Datatype PETSC_F90_2PTR_PROTO_NOVAR);
 38: PETSC_EXTERN PetscErrorCode F90Array2dGetNextRecord(F90Array2d *, void **PETSC_F90_2PTR_PROTO_NOVAR);

 40: PETSC_EXTERN PetscErrorCode F90Array3dCreate(void *, MPI_Datatype, PetscInt, PetscInt, PetscInt, PetscInt, PetscInt, PetscInt, F90Array3d *PETSC_F90_2PTR_PROTO_NOVAR);
 41: PETSC_EXTERN PetscErrorCode F90Array3dAccess(F90Array3d *, MPI_Datatype, void **PETSC_F90_2PTR_PROTO_NOVAR);
 42: PETSC_EXTERN PetscErrorCode F90Array3dDestroy(F90Array3d *, MPI_Datatype PETSC_F90_2PTR_PROTO_NOVAR);
 43: PETSC_EXTERN PetscErrorCode F90Array3dGetNextRecord(F90Array3d *, void **PETSC_F90_2PTR_PROTO_NOVAR);

 45: PETSC_EXTERN PetscErrorCode F90Array4dCreate(void *, MPI_Datatype, PetscInt, PetscInt, PetscInt, PetscInt, PetscInt, PetscInt, PetscInt, PetscInt, F90Array4d *PETSC_F90_2PTR_PROTO_NOVAR);
 46: PETSC_EXTERN PetscErrorCode F90Array4dAccess(F90Array4d *, MPI_Datatype, void **PETSC_F90_2PTR_PROTO_NOVAR);
 47: PETSC_EXTERN PetscErrorCode F90Array4dDestroy(F90Array4d *, MPI_Datatype PETSC_F90_2PTR_PROTO_NOVAR);
 48: PETSC_EXTERN PetscErrorCode F90Array4dGetNextRecord(F90Array4d *, void **PETSC_F90_2PTR_PROTO_NOVAR);

 50: /*
 51:   F90Array1dCreate - Given a C pointer to a one dimensional
 52:   array and its length; this fills in the appropriate Fortran 90
 53:   pointer data structure.

 55:   Input Parameters:
 56: +   array - regular C pointer (address)
 57: .   type  - DataType of the array
 58: .   start - starting index of the array
 59: -   len   - length of array (in items)

 61:   Output Parameters:
 62: .   ptr - Fortran 90 pointer
 63: */

 65: #endif