Discussion:
[petsc-users] pass PETSC_NULL_INTEGER to dynamic array of Vec in Frotran90
Mi Yan
2013-02-20 14:11:08 UTC
Permalink
xlf9014.1 reported error for the below FORTRAN 90 code:

******
MatNullSpace nullsp
PetscErrorCode :: ierr
call MatNullSpaceCreate( PETSC_COMM_WORLD, PETSC_TRUE, 0,
PETSC_NULL_INTEGER, nullsp, ierr );
****
The error message is:
Actual argument attributes do not match those specified by an accessible
explicit interface.

The error implies the real argument the attribute of "PETSC_NULL_INTEGER"
does not match with those specified by the interface. The interface of
MatNullSpaceCreate is declared in finclude/ftn-auto/petscmat.h90 , whose
4th dummy argument is declared as
Vec vecs (*)

In my code, PETSC_NULL_INTEGER is passed to an array of Vec. Is there
anything wrong here?

thanks,
Mi
Satish Balay
2013-02-21 17:05:31 UTC
Permalink
For one - you might need PETSC_NULL_OBJECT. And even then - perhaps
the compiler might complain [as it expects an array].

And then the fortran interface to MatNullSpaceCreate() doesn't have
code to handle PETSC_NULL for this argument. [so it won't work anyway]

So you are better off passing in a dummy Vec

Vec :: dummyv(1)

Also - its best to pass in 'variables' not cosntants like '0' to
fortran subroutines.

PetscInt :: zero

zero = 0

Satish
Post by Mi Yan
******
MatNullSpace nullsp
PetscErrorCode :: ierr
call MatNullSpaceCreate( PETSC_COMM_WORLD, PETSC_TRUE, 0,
PETSC_NULL_INTEGER, nullsp, ierr );
****
Actual argument attributes do not match those specified by an accessible
explicit interface.
The error implies the real argument the attribute of "PETSC_NULL_INTEGER"
does not match with those specified by the interface. The interface of
MatNullSpaceCreate is declared in finclude/ftn-auto/petscmat.h90 , whose
4th dummy argument is declared as
Vec vecs (*)
In my code, PETSC_NULL_INTEGER is passed to an array of Vec. Is there
anything wrong here?
thanks,
Mi
Loading...