[petsc-dev] Problems with VecScatterRemap() Fortran interface in PETSc 3.10

Mills, Richard Tran rtmills at anl.gov
Fri Oct 5 13:23:34 CDT 2018


Fellow PETSc developers (cc: PFLOTRAN developers),

I am trying to get PFLOTRAN (which currently uses PETSc 3.9) working with the recent PETSc 3.10 release. One problem I am hitting is that VecScatterRemap() calls that were fine with PETSc 3.9 cause compile time errors due to mismatched ranks in some arguments. Digging around in the 3.10 source code, I see that in my auto-generated interfaces in $PETSC_DIR/src/vec/f90-mod/ftn-auto-interfaces/petscvec.h90 there is

      subroutine VecScatterRemap(a,b,c,z)
      use petscvecdef
       VecScatter a ! VecScatter
       PetscInt b ! PetscInt
       PetscInt c ! PetscInt
       integer z
       end subroutine

but I think arguments b and c need to be defined something like

       PetscInt, dimension(:), pointer :: b
       PetscInt, dimension(:), pointer :: c

(Though my modern Fortran skills are rusty and I'm not sure if this is quite how these should be declared.) Note that this interface doesn't appear to be generated at all in PETSc 3.9. It's been a very long time since I've done any hacking on the Fortran interface stuff in PETSc. How do I go about fixing this?

Related Fortran usage question: At one point in PFLOTRAN, there is the call

  call VecScatterRemap(ugdm%scatter_ltol,int_ptr,PETSC_NULL_INTEGER, &
                       ierr);CHKERRQ(ierr)

If I manually change the Fortran interface code to be as above, then I get

  Error: Actual argument for 'c' must be a pointer at (1)

If argument 'c' should indeed be defined as a pointer to a one-dimensional array, what variant of PETSC_NULL are we to pass?

--Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20181005/11748c18/attachment.html>


More information about the petsc-dev mailing list