[petsc-users] PETSc Fortran 64-bit

Mike Michell mi.mike1021 at gmail.com
Wed Feb 1 13:58:57 CST 2023


Hi all,

I want to use PETSc with 64-bit indices with a Fortran90 code. It seems
some PETSc functions have no problem, but some of the others do not accept
32-bit error code integer (e.g., "ierr" declared as PetscErrorCode type).

For example,

call DMPlexGetChart(dm, pst, pend, ierr);CHKERRA(ierr)    works okay,

but

call DMPlexGetDepthStratum(dm, 0, vst, vend, ierr);CHKERRA(ierr)  gives an
error regarding the datatype of ierr. The error basically leads:
Error: Type mismatch in argument ‘b’ at (1); passed INTEGER(4) to INTEGER(8)

I tried to declare ierr as integer(kind=8) type, but there are still some
problems. If PETSc is configured with 32-bit indices, the Fortran code
works without problem.

What surprising to me is that as mentioned above, DMPlexGetChart() works
okay, but  DMPlexGetDepthStratum() does not work with "ierr (PetscErrorCode
type)" variable with 64-bit indices.

Can I get any comments on it?

Thanks,
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230201/90871c0e/attachment.html>


More information about the petsc-users mailing list