#if defined(PETSC_HAVE_FORTRAN_TYPE_STAR)
      Interface
       subroutine PetscSFBcastBegin(sf,unit,rarray,larray,op,ierr)
          import tPetscSF
          PetscSF :: sf
          PetscMPIInt :: unit,op
          type(*) :: rarray(:)
          type(*) :: larray(:)
          PetscErrorCode :: ierr
        end Subroutine PetscSFBcastBegin

      subroutine PetscSFBcastEnd(sf,unit,rarray,larray,op,ierr)
          import tPetscSF
          PetscSF :: sf
          PetscMPIInt :: unit,op
          type(*) :: rarray(:)
          type(*) :: larray(:)
          PetscErrorCode :: ierr
        end Subroutine PetscSFBcastEnd

      subroutine PetscSFReduceBegin(sf,unit,larray,rarray,op,ierr)
          import tPetscSF
          PetscSF :: sf
          PetscMPIInt :: unit,op
          type(*) :: larray(:)
          type(*) :: rarray(:)
          PetscErrorCode :: ierr
        end Subroutine PetscSFReduceBegin

      subroutine PetscSFReduceEnd(sf,unit,larray,rarray,op,ierr)
          import tPetscSF
          PetscSF :: sf
          PetscMPIInt :: unit,op
          type(*) :: larray(:)
          type(*) :: rarray(:)
          PetscErrorCode :: ierr
        end Subroutine PetscSFReduceEnd
      end Interface
#endif

      Interface
      subroutine PetscSFGetGraph(sf,nroots,nleaves,ilocal,iremote,ierr)
          import tPetscSF,PetscSFNode
          PetscSF :: sf
          PetscInt :: nroots,nleaves
          PetscInt, pointer :: ilocal(:)
          type(PetscSFNode), pointer :: iremote(:)
          PetscErrorCode :: ierr
      end Subroutine PetscSFGetGraph

      subroutine PetscSFGetLeafRanks(sf,niranks,iranks,ioffset,irootloc,ierr)
          import tPetscSF
          PetscSF :: sf
          PetscMPIInt :: niranks
          PetscMPIInt, pointer :: iranks(:)
          PetscInt, pointer :: ioffset(:),irootloc(:)
          PetscErrorCode :: ierr
      end Subroutine PetscSFGetLeafRanks

      subroutine PetscSFGetRootRanks(sf,nranks,ranks,roffset,rmine,rremote,ierr)
          import tPetscSF
          PetscSF :: sf
          PetscMPIInt :: nranks
          PetscMPIInt, pointer :: ranks(:)
          PetscInt, pointer :: roffset(:),rmine(:),rremote(:)
          PetscErrorCode :: ierr
      end Subroutine PetscSFGetRootRanks
      end Interface

      Interface VecMin
      subroutine VecMin1(x,p,val,ierr)
       import tVec
       Vec, intent(in) :: x
       PetscInt, intent(out) ::  p
       PetscReal, intent(out) ::  val
       PetscErrorCode, intent(out) :: ierr
       end subroutine
      subroutine VecMin2(x,p,val,ierr)
       import tVec
       Vec, intent(in) :: x
       PetscInt, intent(out) ::  p(*)
       PetscReal, intent(out) ::  val
       PetscErrorCode, intent(out) :: ierr
       end subroutine
      end Interface

      Interface VecMax
      subroutine VecMax1(x,p,val,ierr)
       import tVec
       Vec, intent(in) :: x
       PetscInt, intent(out) ::  p
       PetscReal, intent(out) ::  val
       PetscErrorCode, intent(out) :: ierr
       end subroutine
      subroutine VecMax2(x,p,val,ierr)
       import tVec
       Vec, intent(in) :: x
       PetscInt, intent(out) ::  p(*)
       PetscReal, intent(out) ::  val
       PetscErrorCode, intent(out) :: ierr
       end subroutine
      end Interface

      Interface
        Subroutine VecGetArrayF90(v,array,ierr)
          import tVec
          PetscScalar, pointer :: array(:)
          PetscErrorCode ierr
          Vec     v
        End Subroutine
      End Interface

      Interface
        Subroutine VecRestoreArrayF90(v,array,ierr)
          import tVec
          PetscScalar, pointer :: array(:)
          PetscErrorCode ierr
          Vec     v
        End Subroutine
      End Interface

      Interface
        Subroutine VecGetArrayReadF90(v,array,ierr)
          import tVec
          PetscScalar, pointer :: array(:)
          PetscErrorCode ierr
          Vec     v
        End Subroutine
      End Interface

      Interface
        Subroutine VecRestoreArrayReadF90(v,array,ierr)
          import tVec
          PetscScalar, pointer :: array(:)
          PetscErrorCode ierr
          Vec     v
        End Subroutine
      End Interface

      Interface
        Subroutine VecGetValuesSectionF90(v,s,p,va,ierr)
          import tVec,tPetscSection
          PetscScalar, pointer :: va(:)
          PetscErrorCode ierr
          Vec     v
          PetscSection s
          PetscInt p
        End Subroutine
      End Interface

      Interface
        Subroutine VecRestoreValuesSectionF90(v,s,p,va,ierr)
          import tVec,tPetscSection
          PetscScalar, pointer :: va(:)
          PetscErrorCode ierr
          Vec     v
          PetscSection s
          PetscInt p
        End Subroutine
      End Interface

      Interface
        Subroutine VecSetValuesSectionF90(v,s,p,va,mode,ierr)
          import tVec,tPetscSection
          PetscScalar, pointer :: va(:)
          PetscErrorCode ierr
          Vec     v
          PetscSection s
          PetscInt p
          InsertMode mode
        End Subroutine
      End Interface

! -------------------------------------------------------------

      Interface
        Subroutine VecDuplicateVecsF90(v,m,vs,ierr)
          import tVec
          Vec, pointer :: vs(:)
          PetscInt m
          PetscErrorCode ierr
          Vec     v
        End Subroutine
      End Interface
!
!  Question: should VecDestroyVecsF90() take the m argument since
! the array of vectors already knows how long it is? Yes, to
! match calling sequence for C/C++.
!
      Interface
        Subroutine VecDestroyVecsF90(m,vs,ierr)
          import tVec
          Vec, pointer :: vs(:)
          PetscInt m
          PetscErrorCode ierr
        End Subroutine

       subroutine VecScatterRemap(a,b,c,ierr)
         import tVecScatter
         VecScatter a ! VecScatter
         PetscInt b (*) ! PetscInt
         PetscInt c (*) ! PetscInt
         PetscErrorCode ierr
       end subroutine

      end Interface
