Hello,
How should i implement the function below in Fortran
PetscErrorCode func (SNES snes,PetscInt it,PetscReal xnorm,PetscReal gnorm,
PetscReal f,SNESConvergedReason *reason,void *cctx)
should it be a subroutine
subroutine func (SNES snes,PetscInt it,PetscReal xnorm,PetscReal gnorm,or a function whose result is of type PetscErrorCode
PetscReal f,SNESConvergedReason *reason,void *cctx, PetscErrorCode ierr)