! This file was automatically generated by SWIG (http://www.swig.org).
! Version 4.0.0
!
! Do not make changes to this file unless you know what you are doing--modify
! the SWIG interface file instead.

! ---------------------------------------------------------------
! Programmer(s): Auto-generated by swig.
! ---------------------------------------------------------------
! SUNDIALS Copyright Start
! Copyright (c) 2002-2022, Lawrence Livermore National Security
! and Southern Methodist University.
! All rights reserved.
!
! See the top-level LICENSE and NOTICE files for details.
!
! SPDX-License-Identifier: BSD-3-Clause
! SUNDIALS Copyright End
! ---------------------------------------------------------------

module fkinsol_mod
 use, intrinsic :: ISO_C_BINDING
 use fsundials_types_mod
 use fsundials_nvector_mod
 use fsundials_context_mod
 use fsundials_types_mod
 use fsundials_matrix_mod
 use fsundials_nvector_mod
 use fsundials_context_mod
 use fsundials_types_mod
 use fsundials_linearsolver_mod
 use fsundials_matrix_mod
 use fsundials_nvector_mod
 use fsundials_context_mod
 use fsundials_types_mod
 use fsundials_nonlinearsolver_mod
 implicit none
 private

 ! DECLARATION CONSTRUCTS
 integer(C_INT), parameter, public :: KIN_SUCCESS = 0_C_INT
 integer(C_INT), parameter, public :: KIN_INITIAL_GUESS_OK = 1_C_INT
 integer(C_INT), parameter, public :: KIN_STEP_LT_STPTOL = 2_C_INT
 integer(C_INT), parameter, public :: KIN_WARNING = 99_C_INT
 integer(C_INT), parameter, public :: KIN_MEM_NULL = -1_C_INT
 integer(C_INT), parameter, public :: KIN_ILL_INPUT = -2_C_INT
 integer(C_INT), parameter, public :: KIN_NO_MALLOC = -3_C_INT
 integer(C_INT), parameter, public :: KIN_MEM_FAIL = -4_C_INT
 integer(C_INT), parameter, public :: KIN_LINESEARCH_NONCONV = -5_C_INT
 integer(C_INT), parameter, public :: KIN_MAXITER_REACHED = -6_C_INT
 integer(C_INT), parameter, public :: KIN_MXNEWT_5X_EXCEEDED = -7_C_INT
 integer(C_INT), parameter, public :: KIN_LINESEARCH_BCFAIL = -8_C_INT
 integer(C_INT), parameter, public :: KIN_LINSOLV_NO_RECOVERY = -9_C_INT
 integer(C_INT), parameter, public :: KIN_LINIT_FAIL = -10_C_INT
 integer(C_INT), parameter, public :: KIN_LSETUP_FAIL = -11_C_INT
 integer(C_INT), parameter, public :: KIN_LSOLVE_FAIL = -12_C_INT
 integer(C_INT), parameter, public :: KIN_SYSFUNC_FAIL = -13_C_INT
 integer(C_INT), parameter, public :: KIN_FIRST_SYSFUNC_ERR = -14_C_INT
 integer(C_INT), parameter, public :: KIN_REPTD_SYSFUNC_ERR = -15_C_INT
 integer(C_INT), parameter, public :: KIN_VECTOROP_ERR = -16_C_INT
 integer(C_INT), parameter, public :: KIN_CONTEXT_ERR = -17_C_INT
 integer(C_INT), parameter, public :: KIN_ORTH_MGS = 0_C_INT
 integer(C_INT), parameter, public :: KIN_ORTH_ICWY = 1_C_INT
 integer(C_INT), parameter, public :: KIN_ORTH_CGS2 = 2_C_INT
 integer(C_INT), parameter, public :: KIN_ORTH_DCGS2 = 3_C_INT
 integer(C_INT), parameter, public :: KIN_ETACHOICE1 = 1_C_INT
 integer(C_INT), parameter, public :: KIN_ETACHOICE2 = 2_C_INT
 integer(C_INT), parameter, public :: KIN_ETACONSTANT = 3_C_INT
 integer(C_INT), parameter, public :: KIN_NONE = 0_C_INT
 integer(C_INT), parameter, public :: KIN_LINESEARCH = 1_C_INT
 integer(C_INT), parameter, public :: KIN_PICARD = 2_C_INT
 integer(C_INT), parameter, public :: KIN_FP = 3_C_INT
 public :: FKINCreate
 public :: FKINInit
 public :: FKINSol
 public :: FKINSetUserData
 public :: FKINSetDamping
 public :: FKINSetMAA
 public :: FKINSetOrthAA
 public :: FKINSetDelayAA
 public :: FKINSetDampingAA
 public :: FKINSetReturnNewest
 public :: FKINSetNumMaxIters
 public :: FKINSetNoInitSetup
 public :: FKINSetNoResMon
 public :: FKINSetMaxSetupCalls
 public :: FKINSetMaxSubSetupCalls
 public :: FKINSetEtaForm
 public :: FKINSetEtaConstValue
 public :: FKINSetEtaParams
 public :: FKINSetResMonParams
 public :: FKINSetResMonConstValue
 public :: FKINSetNoMinEps
 public :: FKINSetMaxNewtonStep
 public :: FKINSetMaxBetaFails
 public :: FKINSetRelErrFunc
 public :: FKINSetFuncNormTol
 public :: FKINSetScaledStepTol
 public :: FKINSetConstraints
 public :: FKINSetSysFunc
 public :: FKINSetErrHandlerFn
 public :: FKINSetErrFile
 public :: FKINSetInfoHandlerFn
 public :: FKINSetInfoFile
 public :: FKINSetPrintLevel
 public :: FKINSetDebugFile
 public :: FKINGetWorkSpace
 public :: FKINGetNumNonlinSolvIters
 public :: FKINGetNumFuncEvals
 public :: FKINGetNumBetaCondFails
 public :: FKINGetNumBacktrackOps
 public :: FKINGetFuncNorm
 public :: FKINGetStepLength
 public :: FKINGetUserData
 public :: FKINPrintAllStats
 type, bind(C) :: SwigArrayWrapper
  type(C_PTR), public :: data = C_NULL_PTR
  integer(C_SIZE_T), public :: size = 0
 end type
 public :: FKINGetReturnFlagName
 public :: FKINFree
 public :: FKINSetJacTimesVecSysFn
 integer(C_INT), parameter, public :: KINBBDPRE_SUCCESS = 0_C_INT
 integer(C_INT), parameter, public :: KINBBDPRE_PDATA_NULL = -11_C_INT
 integer(C_INT), parameter, public :: KINBBDPRE_FUNC_UNRECVR = -12_C_INT
 public :: FKINBBDPrecInit
 public :: FKINBBDPrecGetWorkSpace
 public :: FKINBBDPrecGetNumGfnEvals
 integer(C_INT), parameter, public :: KINLS_SUCCESS = 0_C_INT
 integer(C_INT), parameter, public :: KINLS_MEM_NULL = -1_C_INT
 integer(C_INT), parameter, public :: KINLS_LMEM_NULL = -2_C_INT
 integer(C_INT), parameter, public :: KINLS_ILL_INPUT = -3_C_INT
 integer(C_INT), parameter, public :: KINLS_MEM_FAIL = -4_C_INT
 integer(C_INT), parameter, public :: KINLS_PMEM_NULL = -5_C_INT
 integer(C_INT), parameter, public :: KINLS_JACFUNC_ERR = -6_C_INT
 integer(C_INT), parameter, public :: KINLS_SUNMAT_FAIL = -7_C_INT
 integer(C_INT), parameter, public :: KINLS_SUNLS_FAIL = -8_C_INT
 public :: FKINSetLinearSolver
 public :: FKINSetJacFn
 public :: FKINSetPreconditioner
 public :: FKINSetJacTimesVecFn
 public :: FKINGetJac
 public :: FKINGetJacNumIters
 public :: FKINGetLinWorkSpace
 public :: FKINGetNumJacEvals
 public :: FKINGetNumLinFuncEvals
 public :: FKINGetNumPrecEvals
 public :: FKINGetNumPrecSolves
 public :: FKINGetNumLinIters
 public :: FKINGetNumLinConvFails
 public :: FKINGetNumJtimesEvals
 public :: FKINGetLastLinFlag
 public :: FKINGetLinReturnFlagName

! WRAPPER DECLARATIONS
interface
function swigc_FKINCreate(farg1) &
bind(C, name="_wrap_FKINCreate") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR) :: fresult
end function

function swigc_FKINInit(farg1, farg2, farg3) &
bind(C, name="_wrap_FKINInit") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_FUNPTR), value :: farg2
type(C_PTR), value :: farg3
integer(C_INT) :: fresult
end function

function swigc_FKINSol(farg1, farg2, farg3, farg4, farg5) &
bind(C, name="_wrap_FKINSol") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT), intent(in) :: farg3
type(C_PTR), value :: farg4
type(C_PTR), value :: farg5
integer(C_INT) :: fresult
end function

function swigc_FKINSetUserData(farg1, farg2) &
bind(C, name="_wrap_FKINSetUserData") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetDamping(farg1, farg2) &
bind(C, name="_wrap_FKINSetDamping") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
real(C_DOUBLE), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetMAA(farg1, farg2) &
bind(C, name="_wrap_FKINSetMAA") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_LONG), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetOrthAA(farg1, farg2) &
bind(C, name="_wrap_FKINSetOrthAA") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_INT), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetDelayAA(farg1, farg2) &
bind(C, name="_wrap_FKINSetDelayAA") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_LONG), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetDampingAA(farg1, farg2) &
bind(C, name="_wrap_FKINSetDampingAA") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
real(C_DOUBLE), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetReturnNewest(farg1, farg2) &
bind(C, name="_wrap_FKINSetReturnNewest") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_INT), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetNumMaxIters(farg1, farg2) &
bind(C, name="_wrap_FKINSetNumMaxIters") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_LONG), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetNoInitSetup(farg1, farg2) &
bind(C, name="_wrap_FKINSetNoInitSetup") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_INT), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetNoResMon(farg1, farg2) &
bind(C, name="_wrap_FKINSetNoResMon") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_INT), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetMaxSetupCalls(farg1, farg2) &
bind(C, name="_wrap_FKINSetMaxSetupCalls") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_LONG), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetMaxSubSetupCalls(farg1, farg2) &
bind(C, name="_wrap_FKINSetMaxSubSetupCalls") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_LONG), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetEtaForm(farg1, farg2) &
bind(C, name="_wrap_FKINSetEtaForm") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_INT), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetEtaConstValue(farg1, farg2) &
bind(C, name="_wrap_FKINSetEtaConstValue") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
real(C_DOUBLE), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetEtaParams(farg1, farg2, farg3) &
bind(C, name="_wrap_FKINSetEtaParams") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
real(C_DOUBLE), intent(in) :: farg2
real(C_DOUBLE), intent(in) :: farg3
integer(C_INT) :: fresult
end function

function swigc_FKINSetResMonParams(farg1, farg2, farg3) &
bind(C, name="_wrap_FKINSetResMonParams") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
real(C_DOUBLE), intent(in) :: farg2
real(C_DOUBLE), intent(in) :: farg3
integer(C_INT) :: fresult
end function

function swigc_FKINSetResMonConstValue(farg1, farg2) &
bind(C, name="_wrap_FKINSetResMonConstValue") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
real(C_DOUBLE), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetNoMinEps(farg1, farg2) &
bind(C, name="_wrap_FKINSetNoMinEps") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_INT), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetMaxNewtonStep(farg1, farg2) &
bind(C, name="_wrap_FKINSetMaxNewtonStep") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
real(C_DOUBLE), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetMaxBetaFails(farg1, farg2) &
bind(C, name="_wrap_FKINSetMaxBetaFails") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_LONG), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetRelErrFunc(farg1, farg2) &
bind(C, name="_wrap_FKINSetRelErrFunc") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
real(C_DOUBLE), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetFuncNormTol(farg1, farg2) &
bind(C, name="_wrap_FKINSetFuncNormTol") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
real(C_DOUBLE), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetScaledStepTol(farg1, farg2) &
bind(C, name="_wrap_FKINSetScaledStepTol") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
real(C_DOUBLE), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetConstraints(farg1, farg2) &
bind(C, name="_wrap_FKINSetConstraints") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetSysFunc(farg1, farg2) &
bind(C, name="_wrap_FKINSetSysFunc") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_FUNPTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetErrHandlerFn(farg1, farg2, farg3) &
bind(C, name="_wrap_FKINSetErrHandlerFn") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_FUNPTR), value :: farg2
type(C_PTR), value :: farg3
integer(C_INT) :: fresult
end function

function swigc_FKINSetErrFile(farg1, farg2) &
bind(C, name="_wrap_FKINSetErrFile") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetInfoHandlerFn(farg1, farg2, farg3) &
bind(C, name="_wrap_FKINSetInfoHandlerFn") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_FUNPTR), value :: farg2
type(C_PTR), value :: farg3
integer(C_INT) :: fresult
end function

function swigc_FKINSetInfoFile(farg1, farg2) &
bind(C, name="_wrap_FKINSetInfoFile") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetPrintLevel(farg1, farg2) &
bind(C, name="_wrap_FKINSetPrintLevel") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_INT), intent(in) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetDebugFile(farg1, farg2) &
bind(C, name="_wrap_FKINSetDebugFile") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetWorkSpace(farg1, farg2, farg3) &
bind(C, name="_wrap_FKINGetWorkSpace") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
integer(C_INT) :: fresult
end function

function swigc_FKINGetNumNonlinSolvIters(farg1, farg2) &
bind(C, name="_wrap_FKINGetNumNonlinSolvIters") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetNumFuncEvals(farg1, farg2) &
bind(C, name="_wrap_FKINGetNumFuncEvals") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetNumBetaCondFails(farg1, farg2) &
bind(C, name="_wrap_FKINGetNumBetaCondFails") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetNumBacktrackOps(farg1, farg2) &
bind(C, name="_wrap_FKINGetNumBacktrackOps") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetFuncNorm(farg1, farg2) &
bind(C, name="_wrap_FKINGetFuncNorm") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetStepLength(farg1, farg2) &
bind(C, name="_wrap_FKINGetStepLength") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetUserData(farg1, farg2) &
bind(C, name="_wrap_FKINGetUserData") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINPrintAllStats(farg1, farg2, farg3) &
bind(C, name="_wrap_FKINPrintAllStats") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT), intent(in) :: farg3
integer(C_INT) :: fresult
end function

 subroutine SWIG_free(cptr) &
  bind(C, name="free")
 use, intrinsic :: ISO_C_BINDING
 type(C_PTR), value :: cptr
end subroutine
function swigc_FKINGetReturnFlagName(farg1) &
bind(C, name="_wrap_FKINGetReturnFlagName") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigarraywrapper
integer(C_LONG), intent(in) :: farg1
type(SwigArrayWrapper) :: fresult
end function

subroutine swigc_FKINFree(farg1) &
bind(C, name="_wrap_FKINFree")
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
end subroutine

function swigc_FKINSetJacTimesVecSysFn(farg1, farg2) &
bind(C, name="_wrap_FKINSetJacTimesVecSysFn") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_FUNPTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) &
bind(C, name="_wrap_FKINBBDPrecInit") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_INT64_T), intent(in) :: farg2
integer(C_INT64_T), intent(in) :: farg3
integer(C_INT64_T), intent(in) :: farg4
integer(C_INT64_T), intent(in) :: farg5
integer(C_INT64_T), intent(in) :: farg6
real(C_DOUBLE), intent(in) :: farg7
type(C_FUNPTR), value :: farg8
type(C_FUNPTR), value :: farg9
integer(C_INT) :: fresult
end function

function swigc_FKINBBDPrecGetWorkSpace(farg1, farg2, farg3) &
bind(C, name="_wrap_FKINBBDPrecGetWorkSpace") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
integer(C_INT) :: fresult
end function

function swigc_FKINBBDPrecGetNumGfnEvals(farg1, farg2) &
bind(C, name="_wrap_FKINBBDPrecGetNumGfnEvals") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetLinearSolver(farg1, farg2, farg3) &
bind(C, name="_wrap_FKINSetLinearSolver") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
integer(C_INT) :: fresult
end function

function swigc_FKINSetJacFn(farg1, farg2) &
bind(C, name="_wrap_FKINSetJacFn") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_FUNPTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINSetPreconditioner(farg1, farg2, farg3) &
bind(C, name="_wrap_FKINSetPreconditioner") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_FUNPTR), value :: farg2
type(C_FUNPTR), value :: farg3
integer(C_INT) :: fresult
end function

function swigc_FKINSetJacTimesVecFn(farg1, farg2) &
bind(C, name="_wrap_FKINSetJacTimesVecFn") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_FUNPTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetJac(farg1, farg2) &
bind(C, name="_wrap_FKINGetJac") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetJacNumIters(farg1, farg2) &
bind(C, name="_wrap_FKINGetJacNumIters") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetLinWorkSpace(farg1, farg2, farg3) &
bind(C, name="_wrap_FKINGetLinWorkSpace") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
integer(C_INT) :: fresult
end function

function swigc_FKINGetNumJacEvals(farg1, farg2) &
bind(C, name="_wrap_FKINGetNumJacEvals") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetNumLinFuncEvals(farg1, farg2) &
bind(C, name="_wrap_FKINGetNumLinFuncEvals") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetNumPrecEvals(farg1, farg2) &
bind(C, name="_wrap_FKINGetNumPrecEvals") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetNumPrecSolves(farg1, farg2) &
bind(C, name="_wrap_FKINGetNumPrecSolves") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetNumLinIters(farg1, farg2) &
bind(C, name="_wrap_FKINGetNumLinIters") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetNumLinConvFails(farg1, farg2) &
bind(C, name="_wrap_FKINGetNumLinConvFails") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetNumJtimesEvals(farg1, farg2) &
bind(C, name="_wrap_FKINGetNumJtimesEvals") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetLastLinFlag(farg1, farg2) &
bind(C, name="_wrap_FKINGetLastLinFlag") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FKINGetLinReturnFlagName(farg1) &
bind(C, name="_wrap_FKINGetLinReturnFlagName") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigarraywrapper
integer(C_LONG), intent(in) :: farg1
type(SwigArrayWrapper) :: fresult
end function

end interface


contains
 ! MODULE SUBPROGRAMS
function FKINCreate(sunctx) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
type(C_PTR) :: swig_result
type(C_PTR) :: sunctx
type(C_PTR) :: fresult 
type(C_PTR) :: farg1 

farg1 = sunctx
fresult = swigc_FKINCreate(farg1)
swig_result = fresult
end function

function FKINInit(kinmem, func, tmpl) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_FUNPTR), intent(in), value :: func
type(N_Vector), target, intent(inout) :: tmpl
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_FUNPTR) :: farg2 
type(C_PTR) :: farg3 

farg1 = kinmem
farg2 = func
farg3 = c_loc(tmpl)
fresult = swigc_FKINInit(farg1, farg2, farg3)
swig_result = fresult
end function

function FKINSol(kinmem, uu, strategy, u_scale, f_scale) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(N_Vector), target, intent(inout) :: uu
integer(C_INT), intent(in) :: strategy
type(N_Vector), target, intent(inout) :: u_scale
type(N_Vector), target, intent(inout) :: f_scale
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 
integer(C_INT) :: farg3 
type(C_PTR) :: farg4 
type(C_PTR) :: farg5 

farg1 = kinmem
farg2 = c_loc(uu)
farg3 = strategy
farg4 = c_loc(u_scale)
farg5 = c_loc(f_scale)
fresult = swigc_FKINSol(farg1, farg2, farg3, farg4, farg5)
swig_result = fresult
end function

function FKINSetUserData(kinmem, user_data) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_PTR) :: user_data
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = user_data
fresult = swigc_FKINSetUserData(farg1, farg2)
swig_result = fresult
end function

function FKINSetDamping(kinmem, beta) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), intent(in) :: beta
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
real(C_DOUBLE) :: farg2 

farg1 = kinmem
farg2 = beta
fresult = swigc_FKINSetDamping(farg1, farg2)
swig_result = fresult
end function

function FKINSetMAA(kinmem, maa) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), intent(in) :: maa
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_LONG) :: farg2 

farg1 = kinmem
farg2 = maa
fresult = swigc_FKINSetMAA(farg1, farg2)
swig_result = fresult
end function

function FKINSetOrthAA(kinmem, orthaa) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_INT), intent(in) :: orthaa
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_INT) :: farg2 

farg1 = kinmem
farg2 = orthaa
fresult = swigc_FKINSetOrthAA(farg1, farg2)
swig_result = fresult
end function

function FKINSetDelayAA(kinmem, delay) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), intent(in) :: delay
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_LONG) :: farg2 

farg1 = kinmem
farg2 = delay
fresult = swigc_FKINSetDelayAA(farg1, farg2)
swig_result = fresult
end function

function FKINSetDampingAA(kinmem, beta) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), intent(in) :: beta
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
real(C_DOUBLE) :: farg2 

farg1 = kinmem
farg2 = beta
fresult = swigc_FKINSetDampingAA(farg1, farg2)
swig_result = fresult
end function

function FKINSetReturnNewest(kinmem, ret_newest) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_INT), intent(in) :: ret_newest
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_INT) :: farg2 

farg1 = kinmem
farg2 = ret_newest
fresult = swigc_FKINSetReturnNewest(farg1, farg2)
swig_result = fresult
end function

function FKINSetNumMaxIters(kinmem, mxiter) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), intent(in) :: mxiter
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_LONG) :: farg2 

farg1 = kinmem
farg2 = mxiter
fresult = swigc_FKINSetNumMaxIters(farg1, farg2)
swig_result = fresult
end function

function FKINSetNoInitSetup(kinmem, noinitsetup) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_INT), intent(in) :: noinitsetup
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_INT) :: farg2 

farg1 = kinmem
farg2 = noinitsetup
fresult = swigc_FKINSetNoInitSetup(farg1, farg2)
swig_result = fresult
end function

function FKINSetNoResMon(kinmem, nonniresmon) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_INT), intent(in) :: nonniresmon
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_INT) :: farg2 

farg1 = kinmem
farg2 = nonniresmon
fresult = swigc_FKINSetNoResMon(farg1, farg2)
swig_result = fresult
end function

function FKINSetMaxSetupCalls(kinmem, msbset) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), intent(in) :: msbset
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_LONG) :: farg2 

farg1 = kinmem
farg2 = msbset
fresult = swigc_FKINSetMaxSetupCalls(farg1, farg2)
swig_result = fresult
end function

function FKINSetMaxSubSetupCalls(kinmem, msbsetsub) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), intent(in) :: msbsetsub
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_LONG) :: farg2 

farg1 = kinmem
farg2 = msbsetsub
fresult = swigc_FKINSetMaxSubSetupCalls(farg1, farg2)
swig_result = fresult
end function

function FKINSetEtaForm(kinmem, etachoice) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_INT), intent(in) :: etachoice
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_INT) :: farg2 

farg1 = kinmem
farg2 = etachoice
fresult = swigc_FKINSetEtaForm(farg1, farg2)
swig_result = fresult
end function

function FKINSetEtaConstValue(kinmem, eta) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), intent(in) :: eta
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
real(C_DOUBLE) :: farg2 

farg1 = kinmem
farg2 = eta
fresult = swigc_FKINSetEtaConstValue(farg1, farg2)
swig_result = fresult
end function

function FKINSetEtaParams(kinmem, egamma, ealpha) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), intent(in) :: egamma
real(C_DOUBLE), intent(in) :: ealpha
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
real(C_DOUBLE) :: farg2 
real(C_DOUBLE) :: farg3 

farg1 = kinmem
farg2 = egamma
farg3 = ealpha
fresult = swigc_FKINSetEtaParams(farg1, farg2, farg3)
swig_result = fresult
end function

function FKINSetResMonParams(kinmem, omegamin, omegamax) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), intent(in) :: omegamin
real(C_DOUBLE), intent(in) :: omegamax
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
real(C_DOUBLE) :: farg2 
real(C_DOUBLE) :: farg3 

farg1 = kinmem
farg2 = omegamin
farg3 = omegamax
fresult = swigc_FKINSetResMonParams(farg1, farg2, farg3)
swig_result = fresult
end function

function FKINSetResMonConstValue(kinmem, omegaconst) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), intent(in) :: omegaconst
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
real(C_DOUBLE) :: farg2 

farg1 = kinmem
farg2 = omegaconst
fresult = swigc_FKINSetResMonConstValue(farg1, farg2)
swig_result = fresult
end function

function FKINSetNoMinEps(kinmem, nomineps) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_INT), intent(in) :: nomineps
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_INT) :: farg2 

farg1 = kinmem
farg2 = nomineps
fresult = swigc_FKINSetNoMinEps(farg1, farg2)
swig_result = fresult
end function

function FKINSetMaxNewtonStep(kinmem, mxnewtstep) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), intent(in) :: mxnewtstep
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
real(C_DOUBLE) :: farg2 

farg1 = kinmem
farg2 = mxnewtstep
fresult = swigc_FKINSetMaxNewtonStep(farg1, farg2)
swig_result = fresult
end function

function FKINSetMaxBetaFails(kinmem, mxnbcf) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), intent(in) :: mxnbcf
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_LONG) :: farg2 

farg1 = kinmem
farg2 = mxnbcf
fresult = swigc_FKINSetMaxBetaFails(farg1, farg2)
swig_result = fresult
end function

function FKINSetRelErrFunc(kinmem, relfunc) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), intent(in) :: relfunc
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
real(C_DOUBLE) :: farg2 

farg1 = kinmem
farg2 = relfunc
fresult = swigc_FKINSetRelErrFunc(farg1, farg2)
swig_result = fresult
end function

function FKINSetFuncNormTol(kinmem, fnormtol) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), intent(in) :: fnormtol
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
real(C_DOUBLE) :: farg2 

farg1 = kinmem
farg2 = fnormtol
fresult = swigc_FKINSetFuncNormTol(farg1, farg2)
swig_result = fresult
end function

function FKINSetScaledStepTol(kinmem, scsteptol) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), intent(in) :: scsteptol
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
real(C_DOUBLE) :: farg2 

farg1 = kinmem
farg2 = scsteptol
fresult = swigc_FKINSetScaledStepTol(farg1, farg2)
swig_result = fresult
end function

function FKINSetConstraints(kinmem, constraints) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(N_Vector), target, intent(inout) :: constraints
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(constraints)
fresult = swigc_FKINSetConstraints(farg1, farg2)
swig_result = fresult
end function

function FKINSetSysFunc(kinmem, func) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_FUNPTR), intent(in), value :: func
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_FUNPTR) :: farg2 

farg1 = kinmem
farg2 = func
fresult = swigc_FKINSetSysFunc(farg1, farg2)
swig_result = fresult
end function

function FKINSetErrHandlerFn(kinmem, ehfun, eh_data) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_FUNPTR), intent(in), value :: ehfun
type(C_PTR) :: eh_data
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_FUNPTR) :: farg2 
type(C_PTR) :: farg3 

farg1 = kinmem
farg2 = ehfun
farg3 = eh_data
fresult = swigc_FKINSetErrHandlerFn(farg1, farg2, farg3)
swig_result = fresult
end function

function FKINSetErrFile(kinmem, errfp) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_PTR) :: errfp
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = errfp
fresult = swigc_FKINSetErrFile(farg1, farg2)
swig_result = fresult
end function

function FKINSetInfoHandlerFn(kinmem, ihfun, ih_data) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_FUNPTR), intent(in), value :: ihfun
type(C_PTR) :: ih_data
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_FUNPTR) :: farg2 
type(C_PTR) :: farg3 

farg1 = kinmem
farg2 = ihfun
farg3 = ih_data
fresult = swigc_FKINSetInfoHandlerFn(farg1, farg2, farg3)
swig_result = fresult
end function

function FKINSetInfoFile(kinmem, infofp) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_PTR) :: infofp
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = infofp
fresult = swigc_FKINSetInfoFile(farg1, farg2)
swig_result = fresult
end function

function FKINSetPrintLevel(kinmem, printfl) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_INT), intent(in) :: printfl
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_INT) :: farg2 

farg1 = kinmem
farg2 = printfl
fresult = swigc_FKINSetPrintLevel(farg1, farg2)
swig_result = fresult
end function

function FKINSetDebugFile(kinmem, debugfp) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_PTR) :: debugfp
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = debugfp
fresult = swigc_FKINSetDebugFile(farg1, farg2)
swig_result = fresult
end function

function FKINGetWorkSpace(kinmem, lenrw, leniw) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: lenrw
integer(C_LONG), dimension(*), target, intent(inout) :: leniw
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 
type(C_PTR) :: farg3 

farg1 = kinmem
farg2 = c_loc(lenrw(1))
farg3 = c_loc(leniw(1))
fresult = swigc_FKINGetWorkSpace(farg1, farg2, farg3)
swig_result = fresult
end function

function FKINGetNumNonlinSolvIters(kinmem, nniters) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: nniters
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(nniters(1))
fresult = swigc_FKINGetNumNonlinSolvIters(farg1, farg2)
swig_result = fresult
end function

function FKINGetNumFuncEvals(kinmem, nfevals) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: nfevals
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(nfevals(1))
fresult = swigc_FKINGetNumFuncEvals(farg1, farg2)
swig_result = fresult
end function

function FKINGetNumBetaCondFails(kinmem, nbcfails) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: nbcfails
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(nbcfails(1))
fresult = swigc_FKINGetNumBetaCondFails(farg1, farg2)
swig_result = fresult
end function

function FKINGetNumBacktrackOps(kinmem, nbacktr) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: nbacktr
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(nbacktr(1))
fresult = swigc_FKINGetNumBacktrackOps(farg1, farg2)
swig_result = fresult
end function

function FKINGetFuncNorm(kinmem, fnorm) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), dimension(*), target, intent(inout) :: fnorm
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(fnorm(1))
fresult = swigc_FKINGetFuncNorm(farg1, farg2)
swig_result = fresult
end function

function FKINGetStepLength(kinmem, steplength) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
real(C_DOUBLE), dimension(*), target, intent(inout) :: steplength
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(steplength(1))
fresult = swigc_FKINGetStepLength(farg1, farg2)
swig_result = fresult
end function

function FKINGetUserData(kinmem, user_data) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_PTR), target, intent(inout) :: user_data
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(user_data)
fresult = swigc_FKINGetUserData(farg1, farg2)
swig_result = fresult
end function

function FKINPrintAllStats(kinmem, outfile, fmt) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_PTR) :: outfile
integer(SUNOutputFormat), intent(in) :: fmt
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 
integer(C_INT) :: farg3 

farg1 = kinmem
farg2 = outfile
farg3 = fmt
fresult = swigc_FKINPrintAllStats(farg1, farg2, farg3)
swig_result = fresult
end function


subroutine SWIG_chararray_to_string(wrap, string)
  use, intrinsic :: ISO_C_BINDING
  type(SwigArrayWrapper), intent(IN) :: wrap
  character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string
  character(kind=C_CHAR), dimension(:), pointer :: chars
  integer(kind=C_SIZE_T) :: i
  call c_f_pointer(wrap%data, chars, [wrap%size])
  allocate(character(kind=C_CHAR, len=wrap%size) :: string)
  do i=1, wrap%size
    string(i:i) = chars(i)
  end do
end subroutine

function FKINGetReturnFlagName(flag) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
character(kind=C_CHAR, len=:), allocatable :: swig_result
integer(C_LONG), intent(in) :: flag
type(SwigArrayWrapper) :: fresult 
integer(C_LONG) :: farg1 

farg1 = flag
fresult = swigc_FKINGetReturnFlagName(farg1)
call SWIG_chararray_to_string(fresult, swig_result)
if (.false.) call SWIG_free(fresult%data)
end function

subroutine FKINFree(kinmem)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), target, intent(inout) :: kinmem
type(C_PTR) :: farg1 

farg1 = c_loc(kinmem)
call swigc_FKINFree(farg1)
end subroutine

function FKINSetJacTimesVecSysFn(kinmem, jtimessysfn) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_FUNPTR), intent(in), value :: jtimessysfn
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_FUNPTR) :: farg2 

farg1 = kinmem
farg2 = jtimessysfn
fresult = swigc_FKINSetJacTimesVecSysFn(farg1, farg2)
swig_result = fresult
end function

function FKINBBDPrecInit(kinmem, nlocal, mudq, mldq, mukeep, mlkeep, dq_rel_uu, gloc, gcomm) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_INT64_T), intent(in) :: nlocal
integer(C_INT64_T), intent(in) :: mudq
integer(C_INT64_T), intent(in) :: mldq
integer(C_INT64_T), intent(in) :: mukeep
integer(C_INT64_T), intent(in) :: mlkeep
real(C_DOUBLE), intent(in) :: dq_rel_uu
type(C_FUNPTR), intent(in), value :: gloc
type(C_FUNPTR), intent(in), value :: gcomm
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
integer(C_INT64_T) :: farg2 
integer(C_INT64_T) :: farg3 
integer(C_INT64_T) :: farg4 
integer(C_INT64_T) :: farg5 
integer(C_INT64_T) :: farg6 
real(C_DOUBLE) :: farg7 
type(C_FUNPTR) :: farg8 
type(C_FUNPTR) :: farg9 

farg1 = kinmem
farg2 = nlocal
farg3 = mudq
farg4 = mldq
farg5 = mukeep
farg6 = mlkeep
farg7 = dq_rel_uu
farg8 = gloc
farg9 = gcomm
fresult = swigc_FKINBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9)
swig_result = fresult
end function

function FKINBBDPrecGetWorkSpace(kinmem, lenrwbbdp, leniwbbdp) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: lenrwbbdp
integer(C_LONG), dimension(*), target, intent(inout) :: leniwbbdp
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 
type(C_PTR) :: farg3 

farg1 = kinmem
farg2 = c_loc(lenrwbbdp(1))
farg3 = c_loc(leniwbbdp(1))
fresult = swigc_FKINBBDPrecGetWorkSpace(farg1, farg2, farg3)
swig_result = fresult
end function

function FKINBBDPrecGetNumGfnEvals(kinmem, ngevalsbbdp) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: ngevalsbbdp
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(ngevalsbbdp(1))
fresult = swigc_FKINBBDPrecGetNumGfnEvals(farg1, farg2)
swig_result = fresult
end function

function FKINSetLinearSolver(kinmem, ls, a) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(SUNLinearSolver), target, intent(inout) :: ls
type(SUNMatrix), target, intent(inout) :: a
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 
type(C_PTR) :: farg3 

farg1 = kinmem
farg2 = c_loc(ls)
farg3 = c_loc(a)
fresult = swigc_FKINSetLinearSolver(farg1, farg2, farg3)
swig_result = fresult
end function

function FKINSetJacFn(kinmem, jac) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_FUNPTR), intent(in), value :: jac
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_FUNPTR) :: farg2 

farg1 = kinmem
farg2 = jac
fresult = swigc_FKINSetJacFn(farg1, farg2)
swig_result = fresult
end function

function FKINSetPreconditioner(kinmem, psetup, psolve) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_FUNPTR), intent(in), value :: psetup
type(C_FUNPTR), intent(in), value :: psolve
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_FUNPTR) :: farg2 
type(C_FUNPTR) :: farg3 

farg1 = kinmem
farg2 = psetup
farg3 = psolve
fresult = swigc_FKINSetPreconditioner(farg1, farg2, farg3)
swig_result = fresult
end function

function FKINSetJacTimesVecFn(kinmem, jtv) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_FUNPTR), intent(in), value :: jtv
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_FUNPTR) :: farg2 

farg1 = kinmem
farg2 = jtv
fresult = swigc_FKINSetJacTimesVecFn(farg1, farg2)
swig_result = fresult
end function

function FKINGetJac(kinmem, j) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
type(C_PTR), target, intent(inout) :: j
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(j)
fresult = swigc_FKINGetJac(farg1, farg2)
swig_result = fresult
end function

function FKINGetJacNumIters(kinmem, nni_j) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: nni_j
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(nni_j(1))
fresult = swigc_FKINGetJacNumIters(farg1, farg2)
swig_result = fresult
end function

function FKINGetLinWorkSpace(kinmem, lenrwls, leniwls) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls
integer(C_LONG), dimension(*), target, intent(inout) :: leniwls
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 
type(C_PTR) :: farg3 

farg1 = kinmem
farg2 = c_loc(lenrwls(1))
farg3 = c_loc(leniwls(1))
fresult = swigc_FKINGetLinWorkSpace(farg1, farg2, farg3)
swig_result = fresult
end function

function FKINGetNumJacEvals(kinmem, njevals) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: njevals
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(njevals(1))
fresult = swigc_FKINGetNumJacEvals(farg1, farg2)
swig_result = fresult
end function

function FKINGetNumLinFuncEvals(kinmem, nfevals) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: nfevals
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(nfevals(1))
fresult = swigc_FKINGetNumLinFuncEvals(farg1, farg2)
swig_result = fresult
end function

function FKINGetNumPrecEvals(kinmem, npevals) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: npevals
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(npevals(1))
fresult = swigc_FKINGetNumPrecEvals(farg1, farg2)
swig_result = fresult
end function

function FKINGetNumPrecSolves(kinmem, npsolves) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: npsolves
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(npsolves(1))
fresult = swigc_FKINGetNumPrecSolves(farg1, farg2)
swig_result = fresult
end function

function FKINGetNumLinIters(kinmem, nliters) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: nliters
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(nliters(1))
fresult = swigc_FKINGetNumLinIters(farg1, farg2)
swig_result = fresult
end function

function FKINGetNumLinConvFails(kinmem, nlcfails) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(nlcfails(1))
fresult = swigc_FKINGetNumLinConvFails(farg1, farg2)
swig_result = fresult
end function

function FKINGetNumJtimesEvals(kinmem, njvevals) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: njvevals
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(njvevals(1))
fresult = swigc_FKINGetNumJtimesEvals(farg1, farg2)
swig_result = fresult
end function

function FKINGetLastLinFlag(kinmem, flag) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: kinmem
integer(C_LONG), dimension(*), target, intent(inout) :: flag
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = kinmem
farg2 = c_loc(flag(1))
fresult = swigc_FKINGetLastLinFlag(farg1, farg2)
swig_result = fresult
end function

function FKINGetLinReturnFlagName(flag) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
character(kind=C_CHAR, len=:), allocatable :: swig_result
integer(C_LONG), intent(in) :: flag
type(SwigArrayWrapper) :: fresult 
integer(C_LONG) :: farg1 

farg1 = flag
fresult = swigc_FKINGetLinReturnFlagName(farg1)
call SWIG_chararray_to_string(fresult, swig_result)
if (.false.) call SWIG_free(fresult%data)
end function


end module
