Re: [petsc-dev] new Fortran error
The fix for this is to add PetscObjectSetName() to src/sys/f90-mod/petscsys.h90 with the * notation to allow any type. You will see in that file PetscObjectReference() etc. PetsFE is an INTEGER(8) in Fortran because no one has updated it yet to be a Fortran type. You will see in include/petsc/finclude/petscdm.h that only DM has be properly updated to be a Fortran type, a bunch of others are still treated as integers and need to be fixed eventually. #define DM type(tDM) #define DMAdaptor PetscFortranAddr #define PetscQuadrature PetscFortranAddr #define PetscDS PetscFortranAddr #define PetscFE PetscFortranAddr #define PetscSpace PetscFortranAddr #define PetscDualSpace PetscFortranAddr #define PetscFV PetscFortranAddr #define PetscLimiter PetscFortranAddr #define PetscPartitioner PetscFortranAddr #define DMField PetscFortranAddr
On Jul 10, 2020, at 9:57 AM, Mark Adams <[email protected]> wrote:
I suspect you have upgraded gfortran and now have gfortran version 10,
09:35 knepley/feature-swarm-fortran= ~/Codes/petsc$ mpif90 --version GNU Fortran (Homebrew GCC 10.1.0) 10.1.0
which is pickier about argument matching.
If you add -fallow-argument-mismatch to the fortran flags, do things go away?
Well, it turns 6 errors into 2 warnings:
FC arch-macosx-gnu-g/tests/dm/impls/swarm/tutorials/ex1f90.o /Users/markadams/Codes/petsc/src/dm/impls/swarm/tutorials/ex1f90.F90:39:30:
34 | call PetscObjectSetName(dm, 'Potential Grid', ierr);CHKERRA(ierr) | 2 ...... 39 | call PetscObjectSetName(fe, 'fe', ierr);CHKERRA(ierr) | 1 Warning: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/TYPE(tdm)). FLINKER arch-macosx-gnu-g/tests/dm/impls/swarm/tutorials/ex1f90 TEST arch-macosx-gnu-g/tests/counts/dm_impls_swarm_tutorials-ex1f90_0.counts ok dm_impls_swarm_tutorials-ex1f90_0 ok diff-dm_impls_swarm_tutorials-ex1f90_0
Oh well, I guess we need to add this param if we want to set names and take it out of regression tests.
I wonder why it seems to say a PetsFE is an INTEGER(8) ...
Thanks, Mark
Lawrenmce
participants (1)
-
Barry Smith