/* File: c_librarymodule.c
 * This file is auto-generated with f2py (version:2).
 * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
 * written by Pearu Peterson <pearu@cens.ioc.ee>.
 * See http://cens.ioc.ee/projects/f2py2e/
 * Generation date: Thu Jan 29 22:06:57 2015
 * $Revision:$
 * $Date:$
 * Do not edit this file directly unless you know what you are doing!!!
 */
#ifdef __cplusplus
extern "C" {
#endif

/*********************** See f2py2e/cfuncs.py: includes ***********************/
#include "Python.h"
#include <stdarg.h>
#include "fortranobject.h"
#include <math.h>

/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/
static PyObject *c_library_error;
static PyObject *c_library_module;

/*********************** See f2py2e/cfuncs.py: typedefs ***********************/
/*need_typedefs*/

/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/
/*need_typedefs_generated*/

/********************** See f2py2e/cfuncs.py: cppmacros **********************/
#define rank(var) var ## _Rank
#define shape(var,dim) var ## _Dims[dim]
#define old_rank(var) (((PyArrayObject *)(capi_ ## var ## _tmp))->nd)
#define old_shape(var,dim) (((PyArrayObject *)(capi_ ## var ## _tmp))->dimensions[dim])
#define fshape(var,dim) shape(var,rank(var)-dim-1)
#define len(var) shape(var,0)
#define flen(var) fshape(var,0)
#define old_size(var) PyArray_SIZE((PyArrayObject *)(capi_ ## var ## _tmp))
/* #define index(i) capi_i ## i */
#define slen(var) capi_ ## var ## _len
#define size(var, ...) f2py_size((PyArrayObject *)(capi_ ## var ## _tmp), ## __VA_ARGS__, -1)

#ifdef DEBUGCFUNCS
#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess);
#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \
  PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\
  fprintf(stderr,"\n");
#else
#define CFUNCSMESS(mess)
#define CFUNCSMESSPY(mess,obj)
#endif

#ifndef max
#define max(a,b) ((a > b) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) ((a < b) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a,b) ((a > b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) ((a < b) ? (a) : (b))
#endif

#define CHECKSCALAR(check,tcheck,name,show,var)\
  if (!(check)) {\
    char errstring[256];\
    sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\
    PyErr_SetString(c_library_error,errstring);\
    /*goto capi_fail;*/\
  } else 
#if defined(PREPEND_FORTRAN)
#if defined(NO_APPEND_FORTRAN)
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) _##F
#else
#define F_FUNC(f,F) _##f
#endif
#else
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) _##F##_
#else
#define F_FUNC(f,F) _##f##_
#endif
#endif
#else
#if defined(NO_APPEND_FORTRAN)
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) F
#else
#define F_FUNC(f,F) f
#endif
#else
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) F##_
#else
#define F_FUNC(f,F) f##_
#endif
#endif
#endif
#if defined(UNDERSCORE_G77)
#define F_FUNC_US(f,F) F_FUNC(f##_,F##_)
#else
#define F_FUNC_US(f,F) F_FUNC(f,F)
#endif


/************************ See f2py2e/cfuncs.py: cfuncs ************************/
static int f2py_size(PyArrayObject* var, ...)
{
  npy_int sz = 0;
  npy_int dim;
  npy_int rank;
  va_list argp;
  va_start(argp, var);
  dim = va_arg(argp, npy_int);
  if (dim==-1)
    {
      sz = PyArray_SIZE(var);
    }
  else
    {
      rank = PyArray_NDIM(var);
      if (dim>=1 && dim<=rank)
        sz = PyArray_DIM(var, dim-1);
      else
        fprintf(stderr, "f2py_size: 2nd argument value=%d fails to satisfy 1<=value<=%d. Result will be 0.\n", dim, rank);
    }
  va_end(argp);
  return sz;
}

static int double_from_pyobj(double* v,PyObject *obj,const char *errmess) {
  PyObject* tmp = NULL;
  if (PyFloat_Check(obj)) {
#ifdef __sgi
    *v = PyFloat_AsDouble(obj);
#else
    *v = PyFloat_AS_DOUBLE(obj);
#endif
    return 1;
  }
  tmp = PyNumber_Float(obj);
  if (tmp) {
#ifdef __sgi
    *v = PyFloat_AsDouble(tmp);
#else
    *v = PyFloat_AS_DOUBLE(tmp);
#endif
    Py_DECREF(tmp);
    return 1;
  }
  if (PyComplex_Check(obj))
    tmp = PyObject_GetAttrString(obj,"real");
  else if (PyString_Check(obj) || PyUnicode_Check(obj))
    /*pass*/;
  else if (PySequence_Check(obj))
    tmp = PySequence_GetItem(obj,0);
  if (tmp) {
    PyErr_Clear();
    if (double_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;}
    Py_DECREF(tmp);
  }
  {
    PyObject* err = PyErr_Occurred();
    if (err==NULL) err = c_library_error;
    PyErr_SetString(err,errmess);
  }
  return 0;
}

static int int_from_pyobj(int* v,PyObject *obj,const char *errmess) {
  PyObject* tmp = NULL;
  if (PyInt_Check(obj)) {
    *v = (int)PyInt_AS_LONG(obj);
    return 1;
  }
  tmp = PyNumber_Int(obj);
  if (tmp) {
    *v = PyInt_AS_LONG(tmp);
    Py_DECREF(tmp);
    return 1;
  }
  if (PyComplex_Check(obj))
    tmp = PyObject_GetAttrString(obj,"real");
  else if (PyString_Check(obj) || PyUnicode_Check(obj))
    /*pass*/;
  else if (PySequence_Check(obj))
    tmp = PySequence_GetItem(obj,0);
  if (tmp) {
    PyErr_Clear();
    if (int_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;}
    Py_DECREF(tmp);
  }
  {
    PyObject* err = PyErr_Occurred();
    if (err==NULL) err = c_library_error;
    PyErr_SetString(err,errmess);
  }
  return 0;
}


/********************* See f2py2e/cfuncs.py: userincludes *********************/
/*need_userincludes*/

/********************* See f2py2e/capi_rules.py: usercode *********************/


/* See f2py2e/rules.py */
extern void findrfc(double*,double,int*,int,int*);
extern void findcross(double*,double,int*,int,int*);
extern void disufq(double*,double*,double*,double*,double*,double*,double,double,int,int,int,int);
extern void disufq2(double*,double*,double*,double*,double*,double*,double*,double*,double,double,int,int,int,int);
extern void findrfc3_astm(double*,double*,int,int*);
extern void findrfc5_astm(double*,double*,double*,int,int*);
/*eof externroutines*/

/******************** See f2py2e/capi_rules.py: usercode1 ********************/


/******************* See f2py2e/cb_rules.py: buildcallback *******************/
/*need_callbacks*/

/*********************** See f2py2e/rules.py: buildapi ***********************/

/********************************** findrfc **********************************/
static char doc_f2py_rout_c_library_findrfc[] = "\
ind,info = findrfc(y1,hmin)\n\nWrapper for ``findrfc``.\
\n\nParameters\n----------\n"
"y1 : input rank-1 array('d') with bounds (n)\n"
"hmin : input float\n"
"\nReturns\n-------\n"
"ind : rank-1 array('i') with bounds (n)\n"
"info : rank-1 array('i') with bounds (1)";
/* extern void findrfc(double*,double,int*,int,int*); */
static PyObject *f2py_rout_c_library_findrfc(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(double*,double,int*,int,int*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  double *y1 = NULL;
  npy_intp y1_Dims[1] = {-1};
  const int y1_Rank = 1;
  PyArrayObject *capi_y1_tmp = NULL;
  int capi_y1_intent = 0;
  PyObject *y1_capi = Py_None;
  double hmin = 0;
  PyObject *hmin_capi = Py_None;
  int *ind = NULL;
  npy_intp ind_Dims[1] = {-1};
  const int ind_Rank = 1;
  PyArrayObject *capi_ind_tmp = NULL;
  int capi_ind_intent = 0;
  int n = 0;
  int *info = NULL;
  npy_intp info_Dims[1] = {-1};
  const int info_Rank = 1;
  PyArrayObject *capi_info_tmp = NULL;
  int capi_info_intent = 0;
  static char *capi_kwlist[] = {"y1","hmin",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OO:c_library.findrfc",\
    capi_kwlist,&y1_capi,&hmin_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable info */
  info_Dims[0]=1;
  capi_info_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_info_tmp = array_from_pyobj(NPY_INT,info_Dims,info_Rank,capi_info_intent,Py_None);
  if (capi_info_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `info' of c_library.findrfc to C/Fortran array" );
  } else {
    info = (int *)(capi_info_tmp->data);

  /* Processing variable y1 */
  ;
  capi_y1_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_y1_tmp = array_from_pyobj(NPY_DOUBLE,y1_Dims,y1_Rank,capi_y1_intent,y1_capi);
  if (capi_y1_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 1st argument `y1' of c_library.findrfc to C/Fortran array" );
  } else {
    y1 = (double *)(capi_y1_tmp->data);

  /* Processing variable hmin */
    f2py_success = double_from_pyobj(&hmin,hmin_capi,"c_library.findrfc() 2nd argument (hmin) can't be converted to double");
  if (f2py_success) {
  /* Processing variable n */
  n = len(y1);
  /* Processing variable ind */
  ind_Dims[0]=n;
  capi_ind_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_ind_tmp = array_from_pyobj(NPY_INT,ind_Dims,ind_Rank,capi_ind_intent,Py_None);
  if (capi_ind_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `ind' of c_library.findrfc to C/Fortran array" );
  } else {
    ind = (int *)(capi_ind_tmp->data);

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(y1,hmin,ind,n,info);
if (PyErr_Occurred())
  f2py_success = 0;
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_call_clock();
#endif
/*end of callfortranroutine*/
    if (f2py_success) {
/*pyobjfrom*/
/*end of pyobjfrom*/
    CFUNCSMESS("Building return value.\n");
    capi_buildvalue = Py_BuildValue("NN",capi_ind_tmp,capi_info_tmp);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  }  /*if (capi_ind_tmp == NULL) ... else of ind*/
  /* End of cleaning variable ind */
  /* End of cleaning variable n */
  } /*if (f2py_success) of hmin*/
  /* End of cleaning variable hmin */
  if((PyObject *)capi_y1_tmp!=y1_capi) {
    Py_XDECREF(capi_y1_tmp); }
  }  /*if (capi_y1_tmp == NULL) ... else of y1*/
  /* End of cleaning variable y1 */
  }  /*if (capi_info_tmp == NULL) ... else of info*/
  /* End of cleaning variable info */
/*end of cleanupfrompyobj*/
  if (capi_buildvalue == NULL) {
/*routdebugfailure*/
  } else {
/*routdebugleave*/
  }
  CFUNCSMESS("Freeing memory.\n");
/*freemem*/
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
  return capi_buildvalue;
}
/******************************* end of findrfc *******************************/

/********************************* findcross *********************************/
static char doc_f2py_rout_c_library_findcross[] = "\
ind,info = findcross(y,v)\n\nWrapper for ``findcross``.\
\n\nParameters\n----------\n"
"y : input rank-1 array('d') with bounds (n)\n"
"v : input float\n"
"\nReturns\n-------\n"
"ind : rank-1 array('i') with bounds (n)\n"
"info : rank-1 array('i') with bounds (1)";
/* extern void findcross(double*,double,int*,int,int*); */
static PyObject *f2py_rout_c_library_findcross(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(double*,double,int*,int,int*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  double *y = NULL;
  npy_intp y_Dims[1] = {-1};
  const int y_Rank = 1;
  PyArrayObject *capi_y_tmp = NULL;
  int capi_y_intent = 0;
  PyObject *y_capi = Py_None;
  double v = 0;
  PyObject *v_capi = Py_None;
  int *ind = NULL;
  npy_intp ind_Dims[1] = {-1};
  const int ind_Rank = 1;
  PyArrayObject *capi_ind_tmp = NULL;
  int capi_ind_intent = 0;
  int n = 0;
  int *info = NULL;
  npy_intp info_Dims[1] = {-1};
  const int info_Rank = 1;
  PyArrayObject *capi_info_tmp = NULL;
  int capi_info_intent = 0;
  static char *capi_kwlist[] = {"y","v",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OO:c_library.findcross",\
    capi_kwlist,&y_capi,&v_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable info */
  info_Dims[0]=1;
  capi_info_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_info_tmp = array_from_pyobj(NPY_INT,info_Dims,info_Rank,capi_info_intent,Py_None);
  if (capi_info_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `info' of c_library.findcross to C/Fortran array" );
  } else {
    info = (int *)(capi_info_tmp->data);

  /* Processing variable y */
  ;
  capi_y_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_y_tmp = array_from_pyobj(NPY_DOUBLE,y_Dims,y_Rank,capi_y_intent,y_capi);
  if (capi_y_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 1st argument `y' of c_library.findcross to C/Fortran array" );
  } else {
    y = (double *)(capi_y_tmp->data);

  /* Processing variable v */
    f2py_success = double_from_pyobj(&v,v_capi,"c_library.findcross() 2nd argument (v) can't be converted to double");
  if (f2py_success) {
  /* Processing variable n */
  n = len(y);
  /* Processing variable ind */
  ind_Dims[0]=n;
  capi_ind_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_ind_tmp = array_from_pyobj(NPY_INT,ind_Dims,ind_Rank,capi_ind_intent,Py_None);
  if (capi_ind_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `ind' of c_library.findcross to C/Fortran array" );
  } else {
    ind = (int *)(capi_ind_tmp->data);

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(y,v,ind,n,info);
if (PyErr_Occurred())
  f2py_success = 0;
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_call_clock();
#endif
/*end of callfortranroutine*/
    if (f2py_success) {
/*pyobjfrom*/
/*end of pyobjfrom*/
    CFUNCSMESS("Building return value.\n");
    capi_buildvalue = Py_BuildValue("NN",capi_ind_tmp,capi_info_tmp);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  }  /*if (capi_ind_tmp == NULL) ... else of ind*/
  /* End of cleaning variable ind */
  /* End of cleaning variable n */
  } /*if (f2py_success) of v*/
  /* End of cleaning variable v */
  if((PyObject *)capi_y_tmp!=y_capi) {
    Py_XDECREF(capi_y_tmp); }
  }  /*if (capi_y_tmp == NULL) ... else of y*/
  /* End of cleaning variable y */
  }  /*if (capi_info_tmp == NULL) ... else of info*/
  /* End of cleaning variable info */
/*end of cleanupfrompyobj*/
  if (capi_buildvalue == NULL) {
/*routdebugfailure*/
  } else {
/*routdebugleave*/
  }
  CFUNCSMESS("Freeing memory.\n");
/*freemem*/
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
  return capi_buildvalue;
}
/****************************** end of findcross ******************************/

/*********************************** disufq ***********************************/
static char doc_f2py_rout_c_library_disufq[] = "\
rvec,ivec = disufq(rA,iA,w,kw,h,g,nmin,nmax,m,[n])\n\nWrapper for ``disufq``.\
\n\nParameters\n----------\n"
"rA : input rank-1 array('d') with bounds (n*m)\n"
"iA : input rank-1 array('d') with bounds (n*m)\n"
"w : input rank-1 array('d') with bounds (0.5 * n + 1.0)\n"
"kw : input rank-1 array('d') with bounds (0.5 * n + 1.0)\n"
"h : input float\n"
"g : input float\n"
"nmin : input int\n"
"nmax : input int\n"
"m : input int\n"
"\nOther Parameters\n----------------\n"
"n : input int, optional\n    Default: (len(w)-1.0)/(0.5)\n"
"\nReturns\n-------\n"
"rvec : rank-1 array('d') with bounds (n*m)\n"
"ivec : rank-1 array('d') with bounds (n*m)";
/* extern void disufq(double*,double*,double*,double*,double*,double*,double,double,int,int,int,int); */
static PyObject *f2py_rout_c_library_disufq(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(double*,double*,double*,double*,double*,double*,double,double,int,int,int,int)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  double *rvec = NULL;
  npy_intp rvec_Dims[1] = {-1};
  const int rvec_Rank = 1;
  PyArrayObject *capi_rvec_tmp = NULL;
  int capi_rvec_intent = 0;
  double *ivec = NULL;
  npy_intp ivec_Dims[1] = {-1};
  const int ivec_Rank = 1;
  PyArrayObject *capi_ivec_tmp = NULL;
  int capi_ivec_intent = 0;
  double *rA = NULL;
  npy_intp rA_Dims[1] = {-1};
  const int rA_Rank = 1;
  PyArrayObject *capi_rA_tmp = NULL;
  int capi_rA_intent = 0;
  PyObject *rA_capi = Py_None;
  double *iA = NULL;
  npy_intp iA_Dims[1] = {-1};
  const int iA_Rank = 1;
  PyArrayObject *capi_iA_tmp = NULL;
  int capi_iA_intent = 0;
  PyObject *iA_capi = Py_None;
  double *w = NULL;
  npy_intp w_Dims[1] = {-1};
  const int w_Rank = 1;
  PyArrayObject *capi_w_tmp = NULL;
  int capi_w_intent = 0;
  PyObject *w_capi = Py_None;
  double *kw = NULL;
  npy_intp kw_Dims[1] = {-1};
  const int kw_Rank = 1;
  PyArrayObject *capi_kw_tmp = NULL;
  int capi_kw_intent = 0;
  PyObject *kw_capi = Py_None;
  double h = 0;
  PyObject *h_capi = Py_None;
  double g = 0;
  PyObject *g_capi = Py_None;
  int nmin = 0;
  PyObject *nmin_capi = Py_None;
  int nmax = 0;
  PyObject *nmax_capi = Py_None;
  int m = 0;
  PyObject *m_capi = Py_None;
  int n = 0;
  PyObject *n_capi = Py_None;
  static char *capi_kwlist[] = {"rA","iA","w","kw","h","g","nmin","nmax","m","n",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OOOOOOOOO|O:c_library.disufq",\
    capi_kwlist,&rA_capi,&iA_capi,&w_capi,&kw_capi,&h_capi,&g_capi,&nmin_capi,&nmax_capi,&m_capi,&n_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable nmax */
    f2py_success = int_from_pyobj(&nmax,nmax_capi,"c_library.disufq() 8th argument (nmax) can't be converted to int");
  if (f2py_success) {
  /* Processing variable g */
    f2py_success = double_from_pyobj(&g,g_capi,"c_library.disufq() 6th argument (g) can't be converted to double");
  if (f2py_success) {
  /* Processing variable h */
    f2py_success = double_from_pyobj(&h,h_capi,"c_library.disufq() 5th argument (h) can't be converted to double");
  if (f2py_success) {
  /* Processing variable m */
    f2py_success = int_from_pyobj(&m,m_capi,"c_library.disufq() 9th argument (m) can't be converted to int");
  if (f2py_success) {
  /* Processing variable w */
  ;
  capi_w_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_w_tmp = array_from_pyobj(NPY_DOUBLE,w_Dims,w_Rank,capi_w_intent,w_capi);
  if (capi_w_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 3rd argument `w' of c_library.disufq to C/Fortran array" );
  } else {
    w = (double *)(capi_w_tmp->data);

  /* Processing variable nmin */
    f2py_success = int_from_pyobj(&nmin,nmin_capi,"c_library.disufq() 7th argument (nmin) can't be converted to int");
  if (f2py_success) {
  /* Processing variable n */
  if (n_capi == Py_None) n = (len(w)-1.0)/(0.5); else
    f2py_success = int_from_pyobj(&n,n_capi,"c_library.disufq() 1st keyword (n) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR((len(w)-1.0)/(0.5)>=n,"(len(w)-1.0)/(0.5)>=n","1st keyword n","disufq:n=%d",n) {
  /* Processing variable kw */
  kw_Dims[0]=0.5 * n + 1.0;
  capi_kw_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_kw_tmp = array_from_pyobj(NPY_DOUBLE,kw_Dims,kw_Rank,capi_kw_intent,kw_capi);
  if (capi_kw_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 4th argument `kw' of c_library.disufq to C/Fortran array" );
  } else {
    kw = (double *)(capi_kw_tmp->data);

  /* Processing variable rA */
  rA_Dims[0]=n*m;
  capi_rA_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_rA_tmp = array_from_pyobj(NPY_DOUBLE,rA_Dims,rA_Rank,capi_rA_intent,rA_capi);
  if (capi_rA_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 1st argument `rA' of c_library.disufq to C/Fortran array" );
  } else {
    rA = (double *)(capi_rA_tmp->data);

  /* Processing variable iA */
  iA_Dims[0]=n*m;
  capi_iA_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_iA_tmp = array_from_pyobj(NPY_DOUBLE,iA_Dims,iA_Rank,capi_iA_intent,iA_capi);
  if (capi_iA_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 2nd argument `iA' of c_library.disufq to C/Fortran array" );
  } else {
    iA = (double *)(capi_iA_tmp->data);

  /* Processing variable ivec */
  ivec_Dims[0]=n*m;
  capi_ivec_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_ivec_tmp = array_from_pyobj(NPY_DOUBLE,ivec_Dims,ivec_Rank,capi_ivec_intent,Py_None);
  if (capi_ivec_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `ivec' of c_library.disufq to C/Fortran array" );
  } else {
    ivec = (double *)(capi_ivec_tmp->data);

  /* Processing variable rvec */
  rvec_Dims[0]=n*m;
  capi_rvec_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_rvec_tmp = array_from_pyobj(NPY_DOUBLE,rvec_Dims,rvec_Rank,capi_rvec_intent,Py_None);
  if (capi_rvec_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `rvec' of c_library.disufq to C/Fortran array" );
  } else {
    rvec = (double *)(capi_rvec_tmp->data);

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(rvec,ivec,rA,iA,w,kw,h,g,nmin,nmax,m,n);
if (PyErr_Occurred())
  f2py_success = 0;
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_call_clock();
#endif
/*end of callfortranroutine*/
    if (f2py_success) {
/*pyobjfrom*/
/*end of pyobjfrom*/
    CFUNCSMESS("Building return value.\n");
    capi_buildvalue = Py_BuildValue("NN",capi_rvec_tmp,capi_ivec_tmp);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  }  /*if (capi_rvec_tmp == NULL) ... else of rvec*/
  /* End of cleaning variable rvec */
  }  /*if (capi_ivec_tmp == NULL) ... else of ivec*/
  /* End of cleaning variable ivec */
  if((PyObject *)capi_iA_tmp!=iA_capi) {
    Py_XDECREF(capi_iA_tmp); }
  }  /*if (capi_iA_tmp == NULL) ... else of iA*/
  /* End of cleaning variable iA */
  if((PyObject *)capi_rA_tmp!=rA_capi) {
    Py_XDECREF(capi_rA_tmp); }
  }  /*if (capi_rA_tmp == NULL) ... else of rA*/
  /* End of cleaning variable rA */
  if((PyObject *)capi_kw_tmp!=kw_capi) {
    Py_XDECREF(capi_kw_tmp); }
  }  /*if (capi_kw_tmp == NULL) ... else of kw*/
  /* End of cleaning variable kw */
  } /*CHECKSCALAR((len(w)-1.0)/(0.5)>=n)*/
  } /*if (f2py_success) of n*/
  /* End of cleaning variable n */
  } /*if (f2py_success) of nmin*/
  /* End of cleaning variable nmin */
  if((PyObject *)capi_w_tmp!=w_capi) {
    Py_XDECREF(capi_w_tmp); }
  }  /*if (capi_w_tmp == NULL) ... else of w*/
  /* End of cleaning variable w */
  } /*if (f2py_success) of m*/
  /* End of cleaning variable m */
  } /*if (f2py_success) of h*/
  /* End of cleaning variable h */
  } /*if (f2py_success) of g*/
  /* End of cleaning variable g */
  } /*if (f2py_success) of nmax*/
  /* End of cleaning variable nmax */
/*end of cleanupfrompyobj*/
  if (capi_buildvalue == NULL) {
/*routdebugfailure*/
  } else {
/*routdebugleave*/
  }
  CFUNCSMESS("Freeing memory.\n");
/*freemem*/
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
  return capi_buildvalue;
}
/******************************* end of disufq *******************************/

/********************************** disufq2 **********************************/
static char doc_f2py_rout_c_library_disufq2[] = "\
rsvec,isvec,rdvec,idvec = disufq2(rA,iA,w,kw,h,g,nmin,nmax,m,[n])\n\nWrapper for ``disufq2``.\
\n\nParameters\n----------\n"
"rA : input rank-1 array('d') with bounds (n*m)\n"
"iA : input rank-1 array('d') with bounds (n*m)\n"
"w : input rank-1 array('d') with bounds (0.5 * n + 1.0)\n"
"kw : input rank-1 array('d') with bounds (0.5 * n + 1.0)\n"
"h : input float\n"
"g : input float\n"
"nmin : input int\n"
"nmax : input int\n"
"m : input int\n"
"\nOther Parameters\n----------------\n"
"n : input int, optional\n    Default: (len(w)-1.0)/(0.5)\n"
"\nReturns\n-------\n"
"rsvec : rank-1 array('d') with bounds (n*m)\n"
"isvec : rank-1 array('d') with bounds (n*m)\n"
"rdvec : rank-1 array('d') with bounds (n*m)\n"
"idvec : rank-1 array('d') with bounds (n*m)";
/* extern void disufq2(double*,double*,double*,double*,double*,double*,double*,double*,double,double,int,int,int,int); */
static PyObject *f2py_rout_c_library_disufq2(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,double*,double,double,int,int,int,int)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  double *rsvec = NULL;
  npy_intp rsvec_Dims[1] = {-1};
  const int rsvec_Rank = 1;
  PyArrayObject *capi_rsvec_tmp = NULL;
  int capi_rsvec_intent = 0;
  double *isvec = NULL;
  npy_intp isvec_Dims[1] = {-1};
  const int isvec_Rank = 1;
  PyArrayObject *capi_isvec_tmp = NULL;
  int capi_isvec_intent = 0;
  double *rdvec = NULL;
  npy_intp rdvec_Dims[1] = {-1};
  const int rdvec_Rank = 1;
  PyArrayObject *capi_rdvec_tmp = NULL;
  int capi_rdvec_intent = 0;
  double *idvec = NULL;
  npy_intp idvec_Dims[1] = {-1};
  const int idvec_Rank = 1;
  PyArrayObject *capi_idvec_tmp = NULL;
  int capi_idvec_intent = 0;
  double *rA = NULL;
  npy_intp rA_Dims[1] = {-1};
  const int rA_Rank = 1;
  PyArrayObject *capi_rA_tmp = NULL;
  int capi_rA_intent = 0;
  PyObject *rA_capi = Py_None;
  double *iA = NULL;
  npy_intp iA_Dims[1] = {-1};
  const int iA_Rank = 1;
  PyArrayObject *capi_iA_tmp = NULL;
  int capi_iA_intent = 0;
  PyObject *iA_capi = Py_None;
  double *w = NULL;
  npy_intp w_Dims[1] = {-1};
  const int w_Rank = 1;
  PyArrayObject *capi_w_tmp = NULL;
  int capi_w_intent = 0;
  PyObject *w_capi = Py_None;
  double *kw = NULL;
  npy_intp kw_Dims[1] = {-1};
  const int kw_Rank = 1;
  PyArrayObject *capi_kw_tmp = NULL;
  int capi_kw_intent = 0;
  PyObject *kw_capi = Py_None;
  double h = 0;
  PyObject *h_capi = Py_None;
  double g = 0;
  PyObject *g_capi = Py_None;
  int nmin = 0;
  PyObject *nmin_capi = Py_None;
  int nmax = 0;
  PyObject *nmax_capi = Py_None;
  int m = 0;
  PyObject *m_capi = Py_None;
  int n = 0;
  PyObject *n_capi = Py_None;
  static char *capi_kwlist[] = {"rA","iA","w","kw","h","g","nmin","nmax","m","n",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OOOOOOOOO|O:c_library.disufq2",\
    capi_kwlist,&rA_capi,&iA_capi,&w_capi,&kw_capi,&h_capi,&g_capi,&nmin_capi,&nmax_capi,&m_capi,&n_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable nmax */
    f2py_success = int_from_pyobj(&nmax,nmax_capi,"c_library.disufq2() 8th argument (nmax) can't be converted to int");
  if (f2py_success) {
  /* Processing variable g */
    f2py_success = double_from_pyobj(&g,g_capi,"c_library.disufq2() 6th argument (g) can't be converted to double");
  if (f2py_success) {
  /* Processing variable m */
    f2py_success = int_from_pyobj(&m,m_capi,"c_library.disufq2() 9th argument (m) can't be converted to int");
  if (f2py_success) {
  /* Processing variable w */
  ;
  capi_w_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_w_tmp = array_from_pyobj(NPY_DOUBLE,w_Dims,w_Rank,capi_w_intent,w_capi);
  if (capi_w_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 3rd argument `w' of c_library.disufq2 to C/Fortran array" );
  } else {
    w = (double *)(capi_w_tmp->data);

  /* Processing variable h */
    f2py_success = double_from_pyobj(&h,h_capi,"c_library.disufq2() 5th argument (h) can't be converted to double");
  if (f2py_success) {
  /* Processing variable nmin */
    f2py_success = int_from_pyobj(&nmin,nmin_capi,"c_library.disufq2() 7th argument (nmin) can't be converted to int");
  if (f2py_success) {
  /* Processing variable n */
  if (n_capi == Py_None) n = (len(w)-1.0)/(0.5); else
    f2py_success = int_from_pyobj(&n,n_capi,"c_library.disufq2() 1st keyword (n) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR((len(w)-1.0)/(0.5)>=n,"(len(w)-1.0)/(0.5)>=n","1st keyword n","disufq2:n=%d",n) {
  /* Processing variable rdvec */
  rdvec_Dims[0]=n*m;
  capi_rdvec_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_rdvec_tmp = array_from_pyobj(NPY_DOUBLE,rdvec_Dims,rdvec_Rank,capi_rdvec_intent,Py_None);
  if (capi_rdvec_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `rdvec' of c_library.disufq2 to C/Fortran array" );
  } else {
    rdvec = (double *)(capi_rdvec_tmp->data);

  /* Processing variable idvec */
  idvec_Dims[0]=n*m;
  capi_idvec_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_idvec_tmp = array_from_pyobj(NPY_DOUBLE,idvec_Dims,idvec_Rank,capi_idvec_intent,Py_None);
  if (capi_idvec_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `idvec' of c_library.disufq2 to C/Fortran array" );
  } else {
    idvec = (double *)(capi_idvec_tmp->data);

  /* Processing variable isvec */
  isvec_Dims[0]=n*m;
  capi_isvec_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_isvec_tmp = array_from_pyobj(NPY_DOUBLE,isvec_Dims,isvec_Rank,capi_isvec_intent,Py_None);
  if (capi_isvec_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `isvec' of c_library.disufq2 to C/Fortran array" );
  } else {
    isvec = (double *)(capi_isvec_tmp->data);

  /* Processing variable rsvec */
  rsvec_Dims[0]=n*m;
  capi_rsvec_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_rsvec_tmp = array_from_pyobj(NPY_DOUBLE,rsvec_Dims,rsvec_Rank,capi_rsvec_intent,Py_None);
  if (capi_rsvec_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `rsvec' of c_library.disufq2 to C/Fortran array" );
  } else {
    rsvec = (double *)(capi_rsvec_tmp->data);

  /* Processing variable kw */
  kw_Dims[0]=0.5 * n + 1.0;
  capi_kw_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_kw_tmp = array_from_pyobj(NPY_DOUBLE,kw_Dims,kw_Rank,capi_kw_intent,kw_capi);
  if (capi_kw_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 4th argument `kw' of c_library.disufq2 to C/Fortran array" );
  } else {
    kw = (double *)(capi_kw_tmp->data);

  /* Processing variable rA */
  rA_Dims[0]=n*m;
  capi_rA_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_rA_tmp = array_from_pyobj(NPY_DOUBLE,rA_Dims,rA_Rank,capi_rA_intent,rA_capi);
  if (capi_rA_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 1st argument `rA' of c_library.disufq2 to C/Fortran array" );
  } else {
    rA = (double *)(capi_rA_tmp->data);

  /* Processing variable iA */
  iA_Dims[0]=n*m;
  capi_iA_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_iA_tmp = array_from_pyobj(NPY_DOUBLE,iA_Dims,iA_Rank,capi_iA_intent,iA_capi);
  if (capi_iA_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 2nd argument `iA' of c_library.disufq2 to C/Fortran array" );
  } else {
    iA = (double *)(capi_iA_tmp->data);

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(rsvec,isvec,rdvec,idvec,rA,iA,w,kw,h,g,nmin,nmax,m,n);
if (PyErr_Occurred())
  f2py_success = 0;
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_call_clock();
#endif
/*end of callfortranroutine*/
    if (f2py_success) {
/*pyobjfrom*/
/*end of pyobjfrom*/
    CFUNCSMESS("Building return value.\n");
    capi_buildvalue = Py_BuildValue("NNNN",capi_rsvec_tmp,capi_isvec_tmp,capi_rdvec_tmp,capi_idvec_tmp);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  if((PyObject *)capi_iA_tmp!=iA_capi) {
    Py_XDECREF(capi_iA_tmp); }
  }  /*if (capi_iA_tmp == NULL) ... else of iA*/
  /* End of cleaning variable iA */
  if((PyObject *)capi_rA_tmp!=rA_capi) {
    Py_XDECREF(capi_rA_tmp); }
  }  /*if (capi_rA_tmp == NULL) ... else of rA*/
  /* End of cleaning variable rA */
  if((PyObject *)capi_kw_tmp!=kw_capi) {
    Py_XDECREF(capi_kw_tmp); }
  }  /*if (capi_kw_tmp == NULL) ... else of kw*/
  /* End of cleaning variable kw */
  }  /*if (capi_rsvec_tmp == NULL) ... else of rsvec*/
  /* End of cleaning variable rsvec */
  }  /*if (capi_isvec_tmp == NULL) ... else of isvec*/
  /* End of cleaning variable isvec */
  }  /*if (capi_idvec_tmp == NULL) ... else of idvec*/
  /* End of cleaning variable idvec */
  }  /*if (capi_rdvec_tmp == NULL) ... else of rdvec*/
  /* End of cleaning variable rdvec */
  } /*CHECKSCALAR((len(w)-1.0)/(0.5)>=n)*/
  } /*if (f2py_success) of n*/
  /* End of cleaning variable n */
  } /*if (f2py_success) of nmin*/
  /* End of cleaning variable nmin */
  } /*if (f2py_success) of h*/
  /* End of cleaning variable h */
  if((PyObject *)capi_w_tmp!=w_capi) {
    Py_XDECREF(capi_w_tmp); }
  }  /*if (capi_w_tmp == NULL) ... else of w*/
  /* End of cleaning variable w */
  } /*if (f2py_success) of m*/
  /* End of cleaning variable m */
  } /*if (f2py_success) of g*/
  /* End of cleaning variable g */
  } /*if (f2py_success) of nmax*/
  /* End of cleaning variable nmax */
/*end of cleanupfrompyobj*/
  if (capi_buildvalue == NULL) {
/*routdebugfailure*/
  } else {
/*routdebugleave*/
  }
  CFUNCSMESS("Freeing memory.\n");
/*freemem*/
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
  return capi_buildvalue;
}
/******************************* end of disufq2 *******************************/

/******************************* findrfc3_astm *******************************/
static char doc_f2py_rout_c_library_findrfc3_astm[] = "\
array_out,nout = findrfc3_astm(array_ext)\n\nWrapper for ``findrfc3_astm``.\
\n\nParameters\n----------\n"
"array_ext : input rank-1 array('d') with bounds (n)\n"
"\nReturns\n-------\n"
"array_out : rank-2 array('d') with bounds (n,3)\n"
"nout : rank-1 array('i') with bounds (2)";
/* extern void findrfc3_astm(double*,double*,int,int*); */
static PyObject *f2py_rout_c_library_findrfc3_astm(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(double*,double*,int,int*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  double *array_ext = NULL;
  npy_intp array_ext_Dims[1] = {-1};
  const int array_ext_Rank = 1;
  PyArrayObject *capi_array_ext_tmp = NULL;
  int capi_array_ext_intent = 0;
  PyObject *array_ext_capi = Py_None;
  double *array_out = NULL;
  npy_intp array_out_Dims[2] = {-1, -1};
  const int array_out_Rank = 2;
  PyArrayObject *capi_array_out_tmp = NULL;
  int capi_array_out_intent = 0;
  int n = 0;
  int *nout = NULL;
  npy_intp nout_Dims[1] = {-1};
  const int nout_Rank = 1;
  PyArrayObject *capi_nout_tmp = NULL;
  int capi_nout_intent = 0;
  static char *capi_kwlist[] = {"array_ext",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "O:c_library.findrfc3_astm",\
    capi_kwlist,&array_ext_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable array_ext */
  ;
  capi_array_ext_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_array_ext_tmp = array_from_pyobj(NPY_DOUBLE,array_ext_Dims,array_ext_Rank,capi_array_ext_intent,array_ext_capi);
  if (capi_array_ext_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 1st argument `array_ext' of c_library.findrfc3_astm to C/Fortran array" );
  } else {
    array_ext = (double *)(capi_array_ext_tmp->data);

  /* Processing variable nout */
  nout_Dims[0]=2;
  capi_nout_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_nout_tmp = array_from_pyobj(NPY_INT,nout_Dims,nout_Rank,capi_nout_intent,Py_None);
  if (capi_nout_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `nout' of c_library.findrfc3_astm to C/Fortran array" );
  } else {
    nout = (int *)(capi_nout_tmp->data);

  /* Processing variable n */
  n = len(array_ext);
  /* Processing variable array_out */
  array_out_Dims[0]=n,array_out_Dims[1]=3;
  capi_array_out_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_array_out_tmp = array_from_pyobj(NPY_DOUBLE,array_out_Dims,array_out_Rank,capi_array_out_intent,Py_None);
  if (capi_array_out_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `array_out' of c_library.findrfc3_astm to C/Fortran array" );
  } else {
    array_out = (double *)(capi_array_out_tmp->data);

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(array_ext,array_out,n,nout);
if (PyErr_Occurred())
  f2py_success = 0;
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_call_clock();
#endif
/*end of callfortranroutine*/
    if (f2py_success) {
/*pyobjfrom*/
/*end of pyobjfrom*/
    CFUNCSMESS("Building return value.\n");
    capi_buildvalue = Py_BuildValue("NN",capi_array_out_tmp,capi_nout_tmp);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  }  /*if (capi_array_out_tmp == NULL) ... else of array_out*/
  /* End of cleaning variable array_out */
  /* End of cleaning variable n */
  }  /*if (capi_nout_tmp == NULL) ... else of nout*/
  /* End of cleaning variable nout */
  if((PyObject *)capi_array_ext_tmp!=array_ext_capi) {
    Py_XDECREF(capi_array_ext_tmp); }
  }  /*if (capi_array_ext_tmp == NULL) ... else of array_ext*/
  /* End of cleaning variable array_ext */
/*end of cleanupfrompyobj*/
  if (capi_buildvalue == NULL) {
/*routdebugfailure*/
  } else {
/*routdebugleave*/
  }
  CFUNCSMESS("Freeing memory.\n");
/*freemem*/
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
  return capi_buildvalue;
}
/**************************** end of findrfc3_astm ****************************/

/******************************* findrfc5_astm *******************************/
static char doc_f2py_rout_c_library_findrfc5_astm[] = "\
array_out,nout = findrfc5_astm(array_ext,array_t)\n\nWrapper for ``findrfc5_astm``.\
\n\nParameters\n----------\n"
"array_ext : input rank-1 array('d') with bounds (n)\n"
"array_t : input rank-1 array('d') with bounds (n)\n"
"\nReturns\n-------\n"
"array_out : rank-2 array('d') with bounds (n,5)\n"
"nout : rank-1 array('i') with bounds (2)";
/* extern void findrfc5_astm(double*,double*,double*,int,int*); */
static PyObject *f2py_rout_c_library_findrfc5_astm(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(double*,double*,double*,int,int*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  double *array_ext = NULL;
  npy_intp array_ext_Dims[1] = {-1};
  const int array_ext_Rank = 1;
  PyArrayObject *capi_array_ext_tmp = NULL;
  int capi_array_ext_intent = 0;
  PyObject *array_ext_capi = Py_None;
  double *array_t = NULL;
  npy_intp array_t_Dims[1] = {-1};
  const int array_t_Rank = 1;
  PyArrayObject *capi_array_t_tmp = NULL;
  int capi_array_t_intent = 0;
  PyObject *array_t_capi = Py_None;
  double *array_out = NULL;
  npy_intp array_out_Dims[2] = {-1, -1};
  const int array_out_Rank = 2;
  PyArrayObject *capi_array_out_tmp = NULL;
  int capi_array_out_intent = 0;
  int n = 0;
  int *nout = NULL;
  npy_intp nout_Dims[1] = {-1};
  const int nout_Rank = 1;
  PyArrayObject *capi_nout_tmp = NULL;
  int capi_nout_intent = 0;
  static char *capi_kwlist[] = {"array_ext","array_t",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OO:c_library.findrfc5_astm",\
    capi_kwlist,&array_ext_capi,&array_t_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable nout */
  nout_Dims[0]=2;
  capi_nout_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_nout_tmp = array_from_pyobj(NPY_INT,nout_Dims,nout_Rank,capi_nout_intent,Py_None);
  if (capi_nout_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `nout' of c_library.findrfc5_astm to C/Fortran array" );
  } else {
    nout = (int *)(capi_nout_tmp->data);

  /* Processing variable array_ext */
  ;
  capi_array_ext_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_array_ext_tmp = array_from_pyobj(NPY_DOUBLE,array_ext_Dims,array_ext_Rank,capi_array_ext_intent,array_ext_capi);
  if (capi_array_ext_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 1st argument `array_ext' of c_library.findrfc5_astm to C/Fortran array" );
  } else {
    array_ext = (double *)(capi_array_ext_tmp->data);

  /* Processing variable n */
  n = len(array_ext);
  /* Processing variable array_t */
  array_t_Dims[0]=n;
  capi_array_t_intent |= F2PY_INTENT_C|F2PY_INTENT_IN;
  capi_array_t_tmp = array_from_pyobj(NPY_DOUBLE,array_t_Dims,array_t_Rank,capi_array_t_intent,array_t_capi);
  if (capi_array_t_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting 2nd argument `array_t' of c_library.findrfc5_astm to C/Fortran array" );
  } else {
    array_t = (double *)(capi_array_t_tmp->data);

  /* Processing variable array_out */
  array_out_Dims[0]=n,array_out_Dims[1]=5;
  capi_array_out_intent |= F2PY_INTENT_HIDE|F2PY_INTENT_C|F2PY_INTENT_OUT;
  capi_array_out_tmp = array_from_pyobj(NPY_DOUBLE,array_out_Dims,array_out_Rank,capi_array_out_intent,Py_None);
  if (capi_array_out_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(c_library_error,"failed in converting hidden `array_out' of c_library.findrfc5_astm to C/Fortran array" );
  } else {
    array_out = (double *)(capi_array_out_tmp->data);

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(array_ext,array_t,array_out,n,nout);
if (PyErr_Occurred())
  f2py_success = 0;
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_call_clock();
#endif
/*end of callfortranroutine*/
    if (f2py_success) {
/*pyobjfrom*/
/*end of pyobjfrom*/
    CFUNCSMESS("Building return value.\n");
    capi_buildvalue = Py_BuildValue("NN",capi_array_out_tmp,capi_nout_tmp);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  }  /*if (capi_array_out_tmp == NULL) ... else of array_out*/
  /* End of cleaning variable array_out */
  if((PyObject *)capi_array_t_tmp!=array_t_capi) {
    Py_XDECREF(capi_array_t_tmp); }
  }  /*if (capi_array_t_tmp == NULL) ... else of array_t*/
  /* End of cleaning variable array_t */
  /* End of cleaning variable n */
  if((PyObject *)capi_array_ext_tmp!=array_ext_capi) {
    Py_XDECREF(capi_array_ext_tmp); }
  }  /*if (capi_array_ext_tmp == NULL) ... else of array_ext*/
  /* End of cleaning variable array_ext */
  }  /*if (capi_nout_tmp == NULL) ... else of nout*/
  /* End of cleaning variable nout */
/*end of cleanupfrompyobj*/
  if (capi_buildvalue == NULL) {
/*routdebugfailure*/
  } else {
/*routdebugleave*/
  }
  CFUNCSMESS("Freeing memory.\n");
/*freemem*/
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
  return capi_buildvalue;
}
/**************************** end of findrfc5_astm ****************************/
/*eof body*/

/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/
/*need_f90modhooks*/

/************** See f2py2e/rules.py: module_rules['modulebody'] **************/

/******************* See f2py2e/common_rules.py: buildhooks *******************/

/*need_commonhooks*/

/**************************** See f2py2e/rules.py ****************************/

static FortranDataDef f2py_routine_defs[] = {
  {"findrfc",-1,{{-1}},0,(char *)findrfc,(f2py_init_func)f2py_rout_c_library_findrfc,doc_f2py_rout_c_library_findrfc},
  {"findcross",-1,{{-1}},0,(char *)findcross,(f2py_init_func)f2py_rout_c_library_findcross,doc_f2py_rout_c_library_findcross},
  {"disufq",-1,{{-1}},0,(char *)disufq,(f2py_init_func)f2py_rout_c_library_disufq,doc_f2py_rout_c_library_disufq},
  {"disufq2",-1,{{-1}},0,(char *)disufq2,(f2py_init_func)f2py_rout_c_library_disufq2,doc_f2py_rout_c_library_disufq2},
  {"findrfc3_astm",-1,{{-1}},0,(char *)findrfc3_astm,(f2py_init_func)f2py_rout_c_library_findrfc3_astm,doc_f2py_rout_c_library_findrfc3_astm},
  {"findrfc5_astm",-1,{{-1}},0,(char *)findrfc5_astm,(f2py_init_func)f2py_rout_c_library_findrfc5_astm,doc_f2py_rout_c_library_findrfc5_astm},

/*eof routine_defs*/
  {NULL}
};

static PyMethodDef f2py_module_methods[] = {

  {NULL,NULL}
};

#if PY_VERSION_HEX >= 0x03000000
static struct PyModuleDef moduledef = {
  PyModuleDef_HEAD_INIT,
  "c_library",
  NULL,
  -1,
  f2py_module_methods,
  NULL,
  NULL,
  NULL,
  NULL
};
#endif

#if PY_VERSION_HEX >= 0x03000000
#define RETVAL m
PyMODINIT_FUNC PyInit_c_library(void) {
#else
#define RETVAL
PyMODINIT_FUNC initc_library(void) {
#endif
  int i;
  PyObject *m,*d, *s;
#if PY_VERSION_HEX >= 0x03000000
  m = c_library_module = PyModule_Create(&moduledef);
#else
  m = c_library_module = Py_InitModule("c_library", f2py_module_methods);
#endif
  Py_TYPE(&PyFortran_Type) = &PyType_Type;
  import_array();
  if (PyErr_Occurred())
    {PyErr_SetString(PyExc_ImportError, "can't initialize module c_library (failed to import numpy)"); return RETVAL;}
  d = PyModule_GetDict(m);
  s = PyString_FromString("$Revision: $");
  PyDict_SetItemString(d, "__version__", s);
#if PY_VERSION_HEX >= 0x03000000
  s = PyUnicode_FromString(
#else
  s = PyString_FromString(
#endif
    "This module 'c_library' is auto-generated with f2py (version:2).\nFunctions:\n"
"  ind,info = findrfc(y1,hmin)\n"
"  ind,info = findcross(y,v)\n"
"  rvec,ivec = disufq(rA,iA,w,kw,h,g,nmin,nmax,m,n=(len(w)-1.0)/(0.5))\n"
"  rsvec,isvec,rdvec,idvec = disufq2(rA,iA,w,kw,h,g,nmin,nmax,m,n=(len(w)-1.0)/(0.5))\n"
"  array_out,nout = findrfc3_astm(array_ext)\n"
"  array_out,nout = findrfc5_astm(array_ext,array_t)\n"
".");
  PyDict_SetItemString(d, "__doc__", s);
  c_library_error = PyErr_NewException ("c_library.error", NULL, NULL);
  Py_DECREF(s);
  for(i=0;f2py_routine_defs[i].name!=NULL;i++)
    PyDict_SetItemString(d, f2py_routine_defs[i].name,PyFortranObject_NewAsAttr(&f2py_routine_defs[i]));






/*eof initf2pywraphooks*/
/*eof initf90modhooks*/

/*eof initcommonhooks*/


#ifdef F2PY_REPORT_ATEXIT
  if (! PyErr_Occurred())
    on_exit(f2py_report_on_exit,(void*)"c_library");
#endif

  return RETVAL;
}
#ifdef __cplusplus
}
#endif