anchor.diff:      end function
       
       !> SUNLinearSolver create GMRES linear solver
  -    function sunspgmr(tmpl,pType,maxl) bind(c,name='SUNSPGMR')
  +    function sunlinsol_spgmr(tmpl,pType,maxl) bind(c,name='SUNLinSol_SPGMR')
         use iso_c_binding
         type(C_PTR),value::tmpl !< template N_Vector pointer
         integer(C_INT),value::pType !< preconditioning type
         integer(C_INT),value::maxl !< maximum dimensions of the Krylov subspace
  -      type(C_PTR)::sunspgmr !< value of the linear solver pointer
  +      type(C_PTR)::sunlinsol_spgmr !< value of the linear solver pointer
       end function
       
       !> SUNLinearSolver free linear solver
  
positive.code:       type(C_PTR)::mem !< location of memory pointer
      end subroutine
      
      !> KINSOL set sparse iterative linear solver
      function kinspilssetlinearsolver(mem,ls) bind(c,name='KINSpilsSetLinearSolver')
        use iso_c_binding
        type(C_PTR),value::mem !< memory pointer
        type(C_PTR),value::ls !< sparse iterative linear solver pointer
        integer(C_INT)::kinspilssetlinearsolver !< error code
      end function
      
      !> KINSOL solve
  
negative.code:     else
        c_maxl=0
      end if
      this%ls=sunlinsol_spgmr(this%x,PREC_NONE,c_maxl) ! use solution vector as template
      if(.not.c_associated(this%ls))then
        write(*,'(a)')"[E] initNewtonKrylov(): linear solver object not allocated"
        stop
      end if
      info=kinsetlinearsolver(this%work,this%ls,C_NULL_PTR)
      if(info/=0)then
        write(*,'(a,i3)')"[E] initNewtonKrylov(): KINSetLinearSolver error code ",info
        stop
      end if
    end subroutine
  