I am trying to update our code to petsc 3.25.1. We were previously on 3.22.4. I am running into a compile error that I can not understand. I went through the release notes but can not see what is wrong. Any suggestions will be appreciated.
-sanjay
/Users/sg/petsc/gnu/bin/mpif90 -o parstop.o -c -fPIC -Wall -ffree-line-length-none -ffree-line-length-0 -Wno-lto-type-mismatch -Wno-unused-dummy-argument -g -O -I/Users/sg/petsc/include -I/Users/sg/petsc/gnu/include -I/opt/X11/include -I/Users/sg/Feap/ver87/include -I/Users/sg/Feap/ver87/modules -I/usr/local/include -J/Users/sg/Feap/ver87/modules parstop.F
parstop.F:64:72:
64 | if(.not.PetscObjectIsNull(Mdiag)) then
| 1
Warning: Line truncated at (1) [-Wline-truncation]
parstop.F:64:70:
64 | if(.not.PetscObjectIsNull(Mdiag)) then
| 1
Error: Syntax error in IF-clause after (1)
parstop.F:66:9:
66 | endif
| 1
Error: Expecting END SUBROUTINE statement at (1)
parstop.F:68:72:
68 | if(.not.PetscObjectIsNull(Msqrt)) then
| 1
Warning: Line truncated at (1) [-Wline-truncation]
parstop.F:68:70:
68 | if(.not.PetscObjectIsNull(Msqrt)) then
| 1
Error: Syntax error in IF-clause after (1)
parstop.F:70:9:
70 | endif
| 1
Error: Expecting END SUBROUTINE statement at (1)
The subroutine is super simple:
# include <petsc/finclude/petscksp.h>
use petscksp
use pfeapc
implicit none
# include "pfeapb.h"
PetscErrorCode ierr
logical :: eflag
save
! Close out PETSc matrices
if(.not.PetscObjectIsNull(Kmat)) then
call MatDestroy(Kmat, ierr)
endif
if(.not.PetscObjectIsNull(Pmat)) then
call MatDestroy(Pmat, ierr)
endif
if(.not.PetscObjectIsNull(Mmat)) then
call MatDestroy(Mmat, ierr)
endif
if(pfeap_dstr) then
call KSPDestroy(kspsol, ierr)
endif
! Close out PETSc vectors
if(.not.PetscObjectIsNull(Mdiag)) then
call VecDestroy(Mdiag, ierr)
endif
if(.not.PetscObjectIsNull(Msqrt)) then
call VecDestroy(Msqrt, ierr)
endif
The custom module pfeapc contains the objects:
module pfeapc
# include <petsc/finclude/petscksp.h>
use petscksp
implicit none
Vec :: rhs, sol, xvec
Vec :: yvec, zvec
Vec :: Mdiag, Msqrt
Mat :: Kmat, Mmat, Pmat
KSP :: kspsol
end module pfeapc