[petsc-dev] XDestroy should set Fortran to PETSC_NULL_X

Smith, Barry F. bsmith at mcs.anl.gov
Thu Sep 6 00:32:12 CDT 2018


   I think does the trick:  https://bitbucket.org/petsc/petsc/pull-requests/1106/change-fortran-null-pointer-to-match-c/diff

   Barry


> On Sep 5, 2018, at 5:55 PM, Jed Brown <jed at jedbrown.org> wrote:
> 
> It is safe in Fortran to write
> 
>  call DMDestroy(da, ierr)
>  call DMDestroy(da, ierr)
> 
> but not
> 
>  da = PETSC_NULL_DM
>  call DMDestroy(da, ierr)
> 
> That's pretty lame and inconsistent with the analogous C concept.
> Should we either change the value of PETSC_NULL_DM or change the
> generated Destroy code?



More information about the petsc-dev mailing list