Actual source code: f90impl.h
petsc-3.12.4 2020-02-04
Report Typos and Errors

      2: #if !defined(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: #if defined(PETSC_USING_F90)
     18: typedef struct { char dummy; } F90Array1d;
     19: typedef struct { char dummy; } F90Array2d;
     20: typedef struct { char dummy; } F90Array3d;
     21: typedef struct { char dummy; } F90Array4d;

     23: PETSC_EXTERN PetscErrorCode F90Array1dCreate(void*,MPI_Datatype,PetscInt,PetscInt,F90Array1d* PETSC_F90_2PTR_PROTO_NOVAR);
     24: PETSC_EXTERN PetscErrorCode F90Array1dAccess(F90Array1d*,MPI_Datatype,void** PETSC_F90_2PTR_PROTO_NOVAR);
     25: PETSC_EXTERN PetscErrorCode F90Array1dDestroy(F90Array1d*,MPI_Datatype PETSC_F90_2PTR_PROTO_NOVAR);
     26: PETSC_EXTERN PetscErrorCode F90Array1dGetNextRecord(F90Array1d*,void** PETSC_F90_2PTR_PROTO_NOVAR);

     28: PETSC_EXTERN PetscErrorCode F90Array2dCreate(void*,MPI_Datatype,PetscInt,PetscInt,PetscInt,PetscInt,F90Array2d* PETSC_F90_2PTR_PROTO_NOVAR);
     29: PETSC_EXTERN PetscErrorCode F90Array2dAccess(F90Array2d*,MPI_Datatype,void** PETSC_F90_2PTR_PROTO_NOVAR);
     30: PETSC_EXTERN PetscErrorCode F90Array2dDestroy(F90Array2d*,MPI_Datatype PETSC_F90_2PTR_PROTO_NOVAR);
     31: PETSC_EXTERN PetscErrorCode F90Array2dGetNextRecord(F90Array2d*,void** PETSC_F90_2PTR_PROTO_NOVAR);

     33: PETSC_EXTERN PetscErrorCode F90Array3dCreate(void*,MPI_Datatype,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,F90Array3d* PETSC_F90_2PTR_PROTO_NOVAR);
     34: PETSC_EXTERN PetscErrorCode F90Array3dAccess(F90Array3d*,MPI_Datatype,void** PETSC_F90_2PTR_PROTO_NOVAR);
     35: PETSC_EXTERN PetscErrorCode F90Array3dDestroy(F90Array3d*,MPI_Datatype PETSC_F90_2PTR_PROTO_NOVAR);
     36: PETSC_EXTERN PetscErrorCode F90Array3dGetNextRecord(F90Array3d*,void** PETSC_F90_2PTR_PROTO_NOVAR);

     38: PETSC_EXTERN PetscErrorCode F90Array4dCreate(void*,MPI_Datatype,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,F90Array4d* PETSC_F90_2PTR_PROTO_NOVAR);
     39: PETSC_EXTERN PetscErrorCode F90Array4dAccess(F90Array4d*,MPI_Datatype,void** PETSC_F90_2PTR_PROTO_NOVAR);
     40: PETSC_EXTERN PetscErrorCode F90Array4dDestroy(F90Array4d*,MPI_Datatype PETSC_F90_2PTR_PROTO_NOVAR);
     41: PETSC_EXTERN PetscErrorCode F90Array4dGetNextRecord(F90Array4d*,void** PETSC_F90_2PTR_PROTO_NOVAR);

     44: /*
     45:   F90Array1dCreate - Given a C pointer to a one dimensional
     46:   array and its length; this fills in the appropriate Fortran 90
     47:   pointer data structure.

     49:   Input Parameters:
     50: +   array - regular C pointer (address)
     51: .   type  - DataType of the array
     52: .   start - starting index of the array
     53: -   len   - length of array (in items)

     55:   Output Parameters:
     56: .   ptr - Fortran 90 pointer
     57: */

     59: #endif /* PETSC_USING_F90 */
     60: #endif