Hi PETSc Experts!

I am updating a Fortran code that use PETSc 3.7 to version 3.9.2 (from git repository).

Such code declares:

Mat mat

and used it as an integer, for example, to assign an initial value and test it to know if the matrix has been created by PETSc.

data mat/-1/
if (mat .eq. -1) then

With the new PETSc Fortran modules the compiler complains about this and stops.

Is there a better way to achieve this? So that I do not have to set an predefined value to Mat type to test if it was already created by PETSc?

If not, Is there a way to access the value in mat?
Looking at the source code type(tMat) has "v" variable, so could I used as mat%v?

Thanks for your help,

Hector

Reply via email to