Actual source code: petsckspmod.F90

  1: module petsckspdef
  2:   use, intrinsic :: ISO_C_binding
  3:   use petscdmdef

  5: #include <../ftn/ksp/petscall.h>
  6: end module petsckspdef

  8: module petscksp
  9:   use petscdm
 10:   use petsckspdef

 12: #include <../src/ksp/ftn-mod/petscksp.h90>
 13: #include <../ftn/ksp/petscall.h90>

 15: contains

 17: #include <../ftn/ksp/petscall.hf90>

 19: end module petscksp

 21: ! Return the address of the PETSC_NULL_KSP_POINTER descriptor, so C stubs can recognize an omitted array argument.
 22: function PETSC_NULL_KSP_POINTER_Fortran() bind(C, name="PETSC_NULL_KSP_POINTER_Fortran") result(ptr)
 23:   use, intrinsic :: ISO_C_binding
 24:   use petsckspdef, only: tKSP, PETSC_NULL_KSP_POINTER
 25:   implicit none
 26:   type(c_ptr) ptr

 28: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
 29: !DEC$ ATTRIBUTES DLLEXPORT::PETSC_NULL_KSP_POINTER_Fortran
 30: #endif
 31:   interface
 32:     subroutine F90Array1dGetDescriptor(array, address)
 33:       use, intrinsic :: ISO_C_binding
 34:       import tKSP
 35:       KSP, pointer :: array(:)
 36:       type(c_ptr) address
 37:     end subroutine
 38:   end interface

 40:   call F90Array1dGetDescriptor(PETSC_NULL_KSP_POINTER, ptr)
 41: end function