There were 2 changes that appear to affect pflotran
https://bitbucket.org/petsc/petsc/commits/3d1df95b16 Change Fortran null
pointer to match C null pointer
https://bitbucket.org/petsc/petsc/commits/487a658c8b Remove
CHKFORTRANNULLOBJECTDEREFERENCE since it is no longer needed with Fortran null
equal to C null
The second one causes compile errors with pflotran. I have fixes in branch
balay/revert_vecscatterremap_/maint
However - the first one is causing regression failure in pflotran. I
assumed pflotran requires fixes (patch attached) - but this is not working.
>>>>>
$ make check
make[1]: Entering directory '/home/balay/git-repo/pflotran/src/pflotran'
gmake[2]: Entering directory '/home/balay/git-repo/pflotran/regression_tests'
/usr/bin/python regression_tests.py -e
/home/balay/git-repo/pflotran/src/pflotran/pflotran --mpiexec mpiexec \
--suite standard standard_parallel \
--config-files ascem/1d/1d-calcite/1d-calcite.cfg
Test log file : pflotran-tests-2018-10-05_16-56-18.testlog
Running pflotran regression tests :
FF
----------------------------------------------------------------------
Regression test summary:
Total run time: 0.204805 [s]
Total tests : 2
Tests run : 2
Failed : 2
gmake[2]: [Makefile:207: check] Error 2 (ignored)
gmake[2]: Leaving directory '/home/balay/git-repo/pflotran/regression_tests'
make[1]: Leaving directory '/home/balay/git-repo/pflotran/src/pflotran'
<<<<<
Richard, Would you be able to debug this?
I noticed the current code has the following - so that overloading the new null
def?
$ git grep tVec\(0\)
src/pflotran/convergence.F90: residual_vec = tVec(0)
src/pflotran/convergence.F90: solution_vec = tVec(0)
src/pflotran/convergence.F90: update_vec = tVec(0)
src/pflotran/pm_wipp_flow.F90: residual_vec = tVec(0)
src/pflotran/timestepper_BE.F90: residual_vec = tVec(0)
Satish
-------------
On Fri, 5 Oct 2018, Mills, Richard Tran wrote:
> Fellow PETSc developers (cc: PFLOTRAN developers),
>
> I am trying to get PFLOTRAN (which currently uses PETSc 3.9) working with the
> recent PETSc 3.10 release. One problem I am hitting is that VecScatterRemap()
> calls that were fine with PETSc 3.9 cause compile time errors due to
> mismatched ranks in some arguments. Digging around in the 3.10 source code, I
> see that in my auto-generated interfaces in
> $PETSC_DIR/src/vec/f90-mod/ftn-auto-interfaces/petscvec.h90 there is
>
> subroutine VecScatterRemap(a,b,c,z)
> use petscvecdef
> VecScatter a ! VecScatter
> PetscInt b ! PetscInt
> PetscInt c ! PetscInt
> integer z
> end subroutine
>
> but I think arguments b and c need to be defined something like
>
> PetscInt, dimension(:), pointer :: b
> PetscInt, dimension(:), pointer :: c
>
> (Though my modern Fortran skills are rusty and I'm not sure if this is quite
> how these should be declared.) Note that this interface doesn't appear to be
> generated at all in PETSc 3.9. It's been a very long time since I've done any
> hacking on the Fortran interface stuff in PETSc. How do I go about fixing
> this?
>
> Related Fortran usage question: At one point in PFLOTRAN, there is the call
>
> call VecScatterRemap(ugdm%scatter_ltol,int_ptr,PETSC_NULL_INTEGER, &
> ierr);CHKERRQ(ierr)
>
> If I manually change the Fortran interface code to be as above, then I get
>
> Error: Actual argument for 'c' must be a pointer at (1)
>
> If argument 'c' should indeed be defined as a pointer to a one-dimensional
> array, what variant of PETSC_NULL are we to pass?
>
> --Richard
>
diff --git a/src/pflotran/general.F90 b/src/pflotran/general.F90
index 26cb3693f..d38ab4ccc 100644
--- a/src/pflotran/general.F90
+++ b/src/pflotran/general.F90
@@ -1055,7 +1055,7 @@ subroutine GeneralResidual(snes,xx,r,realization,ierr)
PetscViewer :: viewer
PetscErrorCode :: ierr
- Mat, parameter :: null_mat = tMat(-1)
+ Mat, parameter :: null_mat = tMat(0)
type(discretization_type), pointer :: discretization
type(grid_type), pointer :: grid
type(patch_type), pointer :: patch
@@ -1499,7 +1499,7 @@ subroutine GeneralJacobian(snes,xx,A,B,realization,ierr)
PetscInt :: irow
PetscInt :: local_id_up, local_id_dn
PetscInt :: ghosted_id_up, ghosted_id_dn
- Vec, parameter :: null_vec = tVec(-1)
+ Vec, parameter :: null_vec = tVec(0)
PetscReal :: Jup(realization%option%nflowdof,realization%option%nflowdof), &
Jdn(realization%option%nflowdof,realization%option%nflowdof)
diff --git a/src/pflotran/richards.F90 b/src/pflotran/richards.F90
index 51ba71961..f74cb664f 100644
--- a/src/pflotran/richards.F90
+++ b/src/pflotran/richards.F90
@@ -1774,7 +1774,7 @@ subroutine RichardsResidualSourceSink(r,realization,ierr)
PetscReal :: well_inj_water
PetscReal :: Dq, dphi, v_darcy, ukvr
- Mat, parameter :: null_mat = tMat(-1)
+ Mat, parameter :: null_mat = tMat(0)
PetscErrorCode :: ierr
@@ -2691,7 +2691,7 @@ subroutine RichardsJacobianSourceSink(A,realization,ierr)
PetscReal :: pressure_max
PetscReal :: pressure_min
PetscReal :: ukvr, Dq, dphi, v_darcy
- Vec, parameter :: null_vec = tVec(-1)
+ Vec, parameter :: null_vec = tVec(0)
character(len=MAXSTRINGLENGTH) :: string
patch => realization%patch
diff --git a/src/pflotran/wipp_flow.F90 b/src/pflotran/wipp_flow.F90
index a40c99fb8..85f0cc7bd 100644
--- a/src/pflotran/wipp_flow.F90
+++ b/src/pflotran/wipp_flow.F90
@@ -903,7 +903,7 @@ subroutine
WIPPFloResidual(snes,xx,r,realization,pmwss_ptr,ierr)
class(pm_wipp_srcsink_type), pointer :: pmwss_ptr
PetscErrorCode :: ierr
- Mat, parameter :: null_mat = tMat(-1)
+ Mat, parameter :: null_mat = tMat(0)
type(discretization_type), pointer :: discretization
type(grid_type), pointer :: grid
type(patch_type), pointer :: patch
@@ -1370,7 +1370,7 @@ subroutine
WIPPFloJacobian(snes,xx,A,B,realization,pmwss_ptr,ierr)
PetscInt :: local_id, ghosted_id, natural_id
PetscInt :: local_id_up, local_id_dn
PetscInt :: ghosted_id_up, ghosted_id_dn
- Vec, parameter :: null_vec = tVec(-1)
+ Vec, parameter :: null_vec = tVec(0)
PetscReal :: Jup(realization%option%nflowdof,realization%option%nflowdof), &
Jdn(realization%option%nflowdof,realization%option%nflowdof)