Dear users,

I encountered some basic problems when using PETSc with Fortran90. To 
illustrate the problem easiest I made a simple problem (attached).
There is a petsc.f90 that contains a module with all PETSc specific coding 
(initializations, etc).
I have a main with some easy declarations and calls. There also is a f90_kind 
for type definition (essentially for the 'double precision'). Note that I wrap 
the matrices in Fortran structures so that I can keep the code free from PETSc 
except petsc.f90.
The file 'output' is what I get.

The program fills two diagonal matrices of size 10. This seems to work fine.

The call to get_info should print the number of rows and columns of a matrix: 
it thinks the number of columns is 0.

Another routine mat_prod does matrix-matrix multiplication through MatMatMult. 
This seg faults.

I also tried the above with all kinds of includes instead of the 'use'-manner. 
This gave the same results.

It seems like the interfacing is not working as it should. Am I missing a 'use' 
statement or a compile option?
strangely enough the matrix construction does work fine.

I hope anyone might shed some light on this.

Thank you.
Danny

Attachment: f90_kind.f90
Description: f90_kind.f90

Attachment: main.f90
Description: main.f90

Attachment: petsc.f90
Description: petsc.f90

Attachment: Makefile
Description: Makefile

Attachment: output
Description: output

Reply via email to