Hector E Barrios Molano <[email protected]> writes: > 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
You can use PETSC_NULL_MAT > 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? Please no.
