[petsc-dev] MatNullSpace with fortran data types

Blaise Bourdin bourdin at lsu.edu
Mon Jul 16 12:27:54 CDT 2012


Hi,

I am having trouble with MatNullSPace in fortran with fortran data types enabled. 
I don't mind if MatNullSpace is not a f90 data type, but right now, neither the old style
	MatNullSpace   nsp 
nor the more f90-ish
	type(MatNullSpace) nsp
seem to work.

galerkin:PetscF90 bourdin$ make -f makefile.MatNullSpace MatNullSpace
/opt/HPC/mpich2-1.4.1p1-intel11.1/bin/mpif90 -c  -fPIC -g   -I/opt/HPC/petsc-3.3/include -I/opt/HPC/petsc-3.3/Darwin-intel11.1-mef90-g/include -I/opt/HPC/petsc-3.3/include/sieve -I/opt/HPC/petsc-3.3/Darwin-intel11.1-mef90-g/cbind/include -I/opt/HPC/petsc-3.3/Darwin-intel11.1-mef90-g/forbind/include -I/opt/HPC/mpich2-1.4.1p1-intel11.1/include    -o MatNullSpace.o MatNullSpace.F90
MatNullSpace.F90(18): error #6457: This derived type name has not been declared.   [MATNULLSPACE]
      type(MatNullSpace)   nsp
-----------^
MatNullSpace.F90(34): error #6404: This name does not have a type, and must have an explicit type.   [NSP]
      call MatNullSpaceCreate(PETSC_COMM_WORLD,PETSC_TRUE,0,PETSC_NULL_OBJECT,nsp,ierr)
------------------------------------------------------------------------------^
compilation aborted for MatNullSpace.F90 (code 1)
make: [MatNullSpace.o] Error 1 (ignored)

or 

galerkin:PetscF90 bourdin$ make -f makefile.MatNullSpace MatNullSpace
/opt/HPC/mpich2-1.4.1p1-intel11.1/bin/mpif90 -c  -fPIC -g   -I/opt/HPC/petsc-3.3/include -I/opt/HPC/petsc-3.3/Darwin-intel11.1-mef90-g/include -I/opt/HPC/petsc-3.3/include/sieve -I/opt/HPC/petsc-3.3/Darwin-intel11.1-mef90-g/cbind/include -I/opt/HPC/petsc-3.3/Darwin-intel11.1-mef90-g/forbind/include -I/opt/HPC/mpich2-1.4.1p1-intel11.1/include    -o MatNullSpace.o MatNullSpace.F90
MatNullSpace.F90(19): error #5082: Syntax error, found IDENTIFIER 'NSP' when expecting one of: ( % : . = =>
      MatNullSpace         nsp


Peeking in include/finclude, it looks like the matching fortran data type has not been declared. I added it (and that of MatFDColoring) to include/finclude/ftn-customn/petscmatdef.h90, but I still get an error when trying to compile a trivial example. What am I missing?

I am attaching an simple example and the incomplete patch I though would be enough to define the fortrasn data type for MatNullSpace.



Blaise
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MatNullSpace.patch
Type: application/octet-stream
Size: 1534 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120716/3df9e340/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MatNullSpace.F90
Type: application/octet-stream
Size: 1190 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120716/3df9e340/attachment-0001.obj>
-------------- next part --------------

-- 
Department of Mathematics and Center for Computation & Technology
Louisiana State University, Baton Rouge, LA 70803, USA
Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin









More information about the petsc-dev mailing list