/* File: _ssrfpackmodule.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>.
 * Generation date: Wed May 15 20:50:31 2019
 * 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 *_ssrfpack_error;
static PyObject *_ssrfpack_module;

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

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

/********************** See f2py2e/cfuncs.py: cppmacros **********************/
#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

#define rank(var) var ## _Rank
#define shape(var,dim) var ## _Dims[dim]
#define old_rank(var) (PyArray_NDIM((PyArrayObject *)(capi_ ## var ## _tmp)))
#define old_shape(var,dim) PyArray_DIM(((PyArrayObject *)(capi_ ## var ## _tmp)),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

#if defined(PREPEND_FORTRAN)
#if defined(NO_APPEND_FORTRAN)
#if defined(UPPERCASE_FORTRAN)
#define F_WRAPPEDFUNC(f,F) _F2PYWRAP##F
#else
#define F_WRAPPEDFUNC(f,F) _f2pywrap##f
#endif
#else
#if defined(UPPERCASE_FORTRAN)
#define F_WRAPPEDFUNC(f,F) _F2PYWRAP##F##_
#else
#define F_WRAPPEDFUNC(f,F) _f2pywrap##f##_
#endif
#endif
#else
#if defined(NO_APPEND_FORTRAN)
#if defined(UPPERCASE_FORTRAN)
#define F_WRAPPEDFUNC(f,F) F2PYWRAP##F
#else
#define F_WRAPPEDFUNC(f,F) f2pywrap##f
#endif
#else
#if defined(UPPERCASE_FORTRAN)
#define F_WRAPPEDFUNC(f,F) F2PYWRAP##F##_
#else
#define F_WRAPPEDFUNC(f,F) f2pywrap##f##_
#endif
#endif
#endif
#if defined(UNDERSCORE_G77)
#define F_WRAPPEDFUNC_US(f,F) F_WRAPPEDFUNC(f##_,F##_)
#else
#define F_WRAPPEDFUNC_US(f,F) F_WRAPPEDFUNC(f,F)
#endif


/************************ See f2py2e/cfuncs.py: cfuncs ************************/
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 = _ssrfpack_error;
        PyErr_SetString(err,errmess);
    }
    return 0;
}

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 float_from_pyobj(float* v,PyObject *obj,const char *errmess) {
    double d=0.0;
    if (double_from_pyobj(&d,obj,errmess)) {
        *v = (float)d;
        return 1;
    }
    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 = _ssrfpack_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 F_FUNC(arcint,ARCINT)(float*,float*,float*,float*,float*,float*,float*,float*,float*,float*,float*);
extern void F_WRAPPEDFUNC(arclen,ARCLEN)(float*,float*,float*);
extern void F_FUNC(gradg,GRADG)(int*,float*,float*,float*,float*,int*,int*,int*,int*,float*,int*,float*,float*,int*);
extern void F_FUNC(gradl,GRADL)(int*,int*,float*,float*,float*,float*,int*,int*,int*,float*,int*);
extern void F_FUNC(intrc0,INTRC0)(int*,float*,float*,float*,float*,float*,float*,int*,int*,int*,int*,float*,int*);
extern void F_FUNC(intrc1,INTRC1)(int*,float*,float*,float*,float*,float*,float*,int*,int*,int*,int*,float*,int*,float*,int*,float*,int*);
extern void F_FUNC(sgprnt,SGPRNT)(int*,int*,int*,int*,int*,float*);
extern void F_FUNC(smsurf,SMSURF)(int*,float*,float*,float*,float*,int*,int*,int*,int*,float*,float*,float*,float*,float*,int*,float*,float*,int*);
/*eof externroutines*/

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


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

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

/*********************************** arcint ***********************************/
static char doc_f2py_rout__ssrfpack_arcint[] = "\
f,g,gn = arcint(p,p1,p2,f1,f2,g1,g2,sigma,g)\n\nWrapper for ``arcint``.\
\n\nParameters\n----------\n"
"p : input rank-1 array('f') with bounds (3)\n"
"p1 : input rank-1 array('f') with bounds (3)\n"
"p2 : input rank-1 array('f') with bounds (3)\n"
"f1 : input float\n"
"f2 : input float\n"
"g1 : input rank-1 array('f') with bounds (3)\n"
"g2 : input rank-1 array('f') with bounds (3)\n"
"sigma : input float\n"
"g : input rank-1 array('f') with bounds (3)\n"
"\nReturns\n-------\n"
"f : float\n"
"g : rank-1 array('f') with bounds (3)\n"
"gn : float";
/* extern void F_FUNC(arcint,ARCINT)(float*,float*,float*,float*,float*,float*,float*,float*,float*,float*,float*); */
static PyObject *f2py_rout__ssrfpack_arcint(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(float*,float*,float*,float*,float*,float*,float*,float*,float*,float*,float*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  float *p = NULL;
  npy_intp p_Dims[1] = {-1};
  const int p_Rank = 1;
  PyArrayObject *capi_p_tmp = NULL;
  int capi_p_intent = 0;
  PyObject *p_capi = Py_None;
  float *p1 = NULL;
  npy_intp p1_Dims[1] = {-1};
  const int p1_Rank = 1;
  PyArrayObject *capi_p1_tmp = NULL;
  int capi_p1_intent = 0;
  PyObject *p1_capi = Py_None;
  float *p2 = NULL;
  npy_intp p2_Dims[1] = {-1};
  const int p2_Rank = 1;
  PyArrayObject *capi_p2_tmp = NULL;
  int capi_p2_intent = 0;
  PyObject *p2_capi = Py_None;
  float f1 = 0;
  PyObject *f1_capi = Py_None;
  float f2 = 0;
  PyObject *f2_capi = Py_None;
  float *g1 = NULL;
  npy_intp g1_Dims[1] = {-1};
  const int g1_Rank = 1;
  PyArrayObject *capi_g1_tmp = NULL;
  int capi_g1_intent = 0;
  PyObject *g1_capi = Py_None;
  float *g2 = NULL;
  npy_intp g2_Dims[1] = {-1};
  const int g2_Rank = 1;
  PyArrayObject *capi_g2_tmp = NULL;
  int capi_g2_intent = 0;
  PyObject *g2_capi = Py_None;
  float sigma = 0;
  PyObject *sigma_capi = Py_None;
  float f = 0;
  float *g = NULL;
  npy_intp g_Dims[1] = {-1};
  const int g_Rank = 1;
  PyArrayObject *capi_g_tmp = NULL;
  int capi_g_intent = 0;
  PyObject *g_capi = Py_None;
  float gn = 0;
  static char *capi_kwlist[] = {"p","p1","p2","f1","f2","g1","g2","sigma","g",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OOOOOOOOO:_ssrfpack.arcint",\
    capi_kwlist,&p_capi,&p1_capi,&p2_capi,&f1_capi,&f2_capi,&g1_capi,&g2_capi,&sigma_capi,&g_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable p */
  p_Dims[0]=3;
  capi_p_intent |= F2PY_INTENT_IN;
  capi_p_tmp = array_from_pyobj(NPY_FLOAT,p_Dims,p_Rank,capi_p_intent,p_capi);
  if (capi_p_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 1st argument `p' of _ssrfpack.arcint to C/Fortran array" );
  } else {
    p = (float *)(PyArray_DATA(capi_p_tmp));

  /* Processing variable p1 */
  p1_Dims[0]=3;
  capi_p1_intent |= F2PY_INTENT_IN;
  capi_p1_tmp = array_from_pyobj(NPY_FLOAT,p1_Dims,p1_Rank,capi_p1_intent,p1_capi);
  if (capi_p1_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 2nd argument `p1' of _ssrfpack.arcint to C/Fortran array" );
  } else {
    p1 = (float *)(PyArray_DATA(capi_p1_tmp));

  /* Processing variable p2 */
  p2_Dims[0]=3;
  capi_p2_intent |= F2PY_INTENT_IN;
  capi_p2_tmp = array_from_pyobj(NPY_FLOAT,p2_Dims,p2_Rank,capi_p2_intent,p2_capi);
  if (capi_p2_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 3rd argument `p2' of _ssrfpack.arcint to C/Fortran array" );
  } else {
    p2 = (float *)(PyArray_DATA(capi_p2_tmp));

  /* Processing variable f1 */
    f2py_success = float_from_pyobj(&f1,f1_capi,"_ssrfpack.arcint() 4th argument (f1) can't be converted to float");
  if (f2py_success) {
  /* Processing variable f2 */
    f2py_success = float_from_pyobj(&f2,f2_capi,"_ssrfpack.arcint() 5th argument (f2) can't be converted to float");
  if (f2py_success) {
  /* Processing variable g1 */
  g1_Dims[0]=3;
  capi_g1_intent |= F2PY_INTENT_IN;
  capi_g1_tmp = array_from_pyobj(NPY_FLOAT,g1_Dims,g1_Rank,capi_g1_intent,g1_capi);
  if (capi_g1_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 6th argument `g1' of _ssrfpack.arcint to C/Fortran array" );
  } else {
    g1 = (float *)(PyArray_DATA(capi_g1_tmp));

  /* Processing variable g2 */
  g2_Dims[0]=3;
  capi_g2_intent |= F2PY_INTENT_IN;
  capi_g2_tmp = array_from_pyobj(NPY_FLOAT,g2_Dims,g2_Rank,capi_g2_intent,g2_capi);
  if (capi_g2_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 7th argument `g2' of _ssrfpack.arcint to C/Fortran array" );
  } else {
    g2 = (float *)(PyArray_DATA(capi_g2_tmp));

  /* Processing variable sigma */
    f2py_success = float_from_pyobj(&sigma,sigma_capi,"_ssrfpack.arcint() 8th argument (sigma) can't be converted to float");
  if (f2py_success) {
  /* Processing variable f */
  /* Processing variable g */
  g_Dims[0]=3;
  capi_g_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
  capi_g_tmp = array_from_pyobj(NPY_FLOAT,g_Dims,g_Rank,capi_g_intent,g_capi);
  if (capi_g_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 9th argument `g' of _ssrfpack.arcint to C/Fortran array" );
  } else {
    g = (float *)(PyArray_DATA(capi_g_tmp));

  /* Processing variable gn */
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(p,p1,p2,&f1,&f2,g1,g2,&sigma,&f,g,&gn);
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("fNf",f,capi_g_tmp,gn);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  /* End of cleaning variable gn */
  }  /*if (capi_g_tmp == NULL) ... else of g*/
  /* End of cleaning variable g */
  /* End of cleaning variable f */
  } /*if (f2py_success) of sigma*/
  /* End of cleaning variable sigma */
  if((PyObject *)capi_g2_tmp!=g2_capi) {
    Py_XDECREF(capi_g2_tmp); }
  }  /*if (capi_g2_tmp == NULL) ... else of g2*/
  /* End of cleaning variable g2 */
  if((PyObject *)capi_g1_tmp!=g1_capi) {
    Py_XDECREF(capi_g1_tmp); }
  }  /*if (capi_g1_tmp == NULL) ... else of g1*/
  /* End of cleaning variable g1 */
  } /*if (f2py_success) of f2*/
  /* End of cleaning variable f2 */
  } /*if (f2py_success) of f1*/
  /* End of cleaning variable f1 */
  if((PyObject *)capi_p2_tmp!=p2_capi) {
    Py_XDECREF(capi_p2_tmp); }
  }  /*if (capi_p2_tmp == NULL) ... else of p2*/
  /* End of cleaning variable p2 */
  if((PyObject *)capi_p1_tmp!=p1_capi) {
    Py_XDECREF(capi_p1_tmp); }
  }  /*if (capi_p1_tmp == NULL) ... else of p1*/
  /* End of cleaning variable p1 */
  if((PyObject *)capi_p_tmp!=p_capi) {
    Py_XDECREF(capi_p_tmp); }
  }  /*if (capi_p_tmp == NULL) ... else of p*/
  /* End of cleaning variable p */
/*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 arcint *******************************/

/*********************************** arclen ***********************************/
static char doc_f2py_rout__ssrfpack_arclen[] = "\
arclen = arclen(p,q)\n\nWrapper for ``arclen``.\
\n\nParameters\n----------\n"
"p : input rank-1 array('f') with bounds (3)\n"
"q : input rank-1 array('f') with bounds (3)\n"
"\nReturns\n-------\n"
"arclen : float";
/* extern void F_WRAPPEDFUNC(arclen,ARCLEN)(float*,float*,float*); */
static PyObject *f2py_rout__ssrfpack_arclen(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(float*,float*,float*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  float arclen = 0;
  float *p = NULL;
  npy_intp p_Dims[1] = {-1};
  const int p_Rank = 1;
  PyArrayObject *capi_p_tmp = NULL;
  int capi_p_intent = 0;
  PyObject *p_capi = Py_None;
  float *q = NULL;
  npy_intp q_Dims[1] = {-1};
  const int q_Rank = 1;
  PyArrayObject *capi_q_tmp = NULL;
  int capi_q_intent = 0;
  PyObject *q_capi = Py_None;
  static char *capi_kwlist[] = {"p","q",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OO:_ssrfpack.arclen",\
    capi_kwlist,&p_capi,&q_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable p */
  p_Dims[0]=3;
  capi_p_intent |= F2PY_INTENT_IN;
  capi_p_tmp = array_from_pyobj(NPY_FLOAT,p_Dims,p_Rank,capi_p_intent,p_capi);
  if (capi_p_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 1st argument `p' of _ssrfpack.arclen to C/Fortran array" );
  } else {
    p = (float *)(PyArray_DATA(capi_p_tmp));

  /* Processing variable q */
  q_Dims[0]=3;
  capi_q_intent |= F2PY_INTENT_IN;
  capi_q_tmp = array_from_pyobj(NPY_FLOAT,q_Dims,q_Rank,capi_q_intent,q_capi);
  if (capi_q_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 2nd argument `q' of _ssrfpack.arclen to C/Fortran array" );
  } else {
    q = (float *)(PyArray_DATA(capi_q_tmp));

  /* Processing variable arclen */
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
  (*f2py_func)(&arclen,p,q);
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("f",arclen);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  /* End of cleaning variable arclen */
  if((PyObject *)capi_q_tmp!=q_capi) {
    Py_XDECREF(capi_q_tmp); }
  }  /*if (capi_q_tmp == NULL) ... else of q*/
  /* End of cleaning variable q */
  if((PyObject *)capi_p_tmp!=p_capi) {
    Py_XDECREF(capi_p_tmp); }
  }  /*if (capi_p_tmp == NULL) ... else of p*/
  /* End of cleaning variable p */
/*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 arclen *******************************/

/*********************************** gradg ***********************************/
static char doc_f2py_rout__ssrfpack_gradg[] = "\
grad,ier = gradg(x,y,z,f,list,lptr,lend,iflgs,sigma,nit,dgmax)\n\nWrapper for ``gradg``.\
\n\nParameters\n----------\n"
"x : input rank-1 array('f') with bounds (n)\n"
"y : input rank-1 array('f') with bounds (n)\n"
"z : input rank-1 array('f') with bounds (n)\n"
"f : input rank-1 array('f') with bounds (n)\n"
"list : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lptr : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lend : input rank-1 array('i') with bounds (n)\n"
"iflgs : input int\n"
"sigma : input rank-1 array('f') with bounds (*)\n"
"nit : input int\n"
"dgmax : input float\n"
"\nReturns\n-------\n"
"grad : rank-2 array('f') with bounds (3,n)\n"
"ier : int";
/* extern void F_FUNC(gradg,GRADG)(int*,float*,float*,float*,float*,int*,int*,int*,int*,float*,int*,float*,float*,int*); */
static PyObject *f2py_rout__ssrfpack_gradg(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(int*,float*,float*,float*,float*,int*,int*,int*,int*,float*,int*,float*,float*,int*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  int n = 0;
  float *x = NULL;
  npy_intp x_Dims[1] = {-1};
  const int x_Rank = 1;
  PyArrayObject *capi_x_tmp = NULL;
  int capi_x_intent = 0;
  PyObject *x_capi = Py_None;
  float *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;
  float *z = NULL;
  npy_intp z_Dims[1] = {-1};
  const int z_Rank = 1;
  PyArrayObject *capi_z_tmp = NULL;
  int capi_z_intent = 0;
  PyObject *z_capi = Py_None;
  float *f = NULL;
  npy_intp f_Dims[1] = {-1};
  const int f_Rank = 1;
  PyArrayObject *capi_f_tmp = NULL;
  int capi_f_intent = 0;
  PyObject *f_capi = Py_None;
  int *list = NULL;
  npy_intp list_Dims[1] = {-1};
  const int list_Rank = 1;
  PyArrayObject *capi_list_tmp = NULL;
  int capi_list_intent = 0;
  PyObject *list_capi = Py_None;
  int *lptr = NULL;
  npy_intp lptr_Dims[1] = {-1};
  const int lptr_Rank = 1;
  PyArrayObject *capi_lptr_tmp = NULL;
  int capi_lptr_intent = 0;
  PyObject *lptr_capi = Py_None;
  int *lend = NULL;
  npy_intp lend_Dims[1] = {-1};
  const int lend_Rank = 1;
  PyArrayObject *capi_lend_tmp = NULL;
  int capi_lend_intent = 0;
  PyObject *lend_capi = Py_None;
  int iflgs = 0;
  PyObject *iflgs_capi = Py_None;
  float *sigma = NULL;
  npy_intp sigma_Dims[1] = {-1};
  const int sigma_Rank = 1;
  PyArrayObject *capi_sigma_tmp = NULL;
  int capi_sigma_intent = 0;
  PyObject *sigma_capi = Py_None;
  int nit = 0;
  PyObject *nit_capi = Py_None;
  float dgmax = 0;
  PyObject *dgmax_capi = Py_None;
  float *grad = NULL;
  npy_intp grad_Dims[2] = {-1, -1};
  const int grad_Rank = 2;
  PyArrayObject *capi_grad_tmp = NULL;
  int capi_grad_intent = 0;
  int ier = 0;
  static char *capi_kwlist[] = {"x","y","z","f","list","lptr","lend","iflgs","sigma","nit","dgmax",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OOOOOOOOOOO:_ssrfpack.gradg",\
    capi_kwlist,&x_capi,&y_capi,&z_capi,&f_capi,&list_capi,&lptr_capi,&lend_capi,&iflgs_capi,&sigma_capi,&nit_capi,&dgmax_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable x */
  ;
  capi_x_intent |= F2PY_INTENT_IN;
  capi_x_tmp = array_from_pyobj(NPY_FLOAT,x_Dims,x_Rank,capi_x_intent,x_capi);
  if (capi_x_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 1st argument `x' of _ssrfpack.gradg to C/Fortran array" );
  } else {
    x = (float *)(PyArray_DATA(capi_x_tmp));

  /* Processing variable iflgs */
    f2py_success = int_from_pyobj(&iflgs,iflgs_capi,"_ssrfpack.gradg() 8th argument (iflgs) can't be converted to int");
  if (f2py_success) {
  /* Processing variable sigma */
  ;
  capi_sigma_intent |= F2PY_INTENT_IN;
  capi_sigma_tmp = array_from_pyobj(NPY_FLOAT,sigma_Dims,sigma_Rank,capi_sigma_intent,sigma_capi);
  if (capi_sigma_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 9th argument `sigma' of _ssrfpack.gradg to C/Fortran array" );
  } else {
    sigma = (float *)(PyArray_DATA(capi_sigma_tmp));

  /* Processing variable nit */
    f2py_success = int_from_pyobj(&nit,nit_capi,"_ssrfpack.gradg() 10th argument (nit) can't be converted to int");
  if (f2py_success) {
  /* Processing variable dgmax */
    f2py_success = float_from_pyobj(&dgmax,dgmax_capi,"_ssrfpack.gradg() 11st argument (dgmax) can't be converted to float");
  if (f2py_success) {
  /* Processing variable ier */
  /* Processing variable n */
  n = len(x);
  /* Processing variable y */
  y_Dims[0]=n;
  capi_y_intent |= F2PY_INTENT_IN;
  capi_y_tmp = array_from_pyobj(NPY_FLOAT,y_Dims,y_Rank,capi_y_intent,y_capi);
  if (capi_y_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 2nd argument `y' of _ssrfpack.gradg to C/Fortran array" );
  } else {
    y = (float *)(PyArray_DATA(capi_y_tmp));

  /* Processing variable z */
  z_Dims[0]=n;
  capi_z_intent |= F2PY_INTENT_IN;
  capi_z_tmp = array_from_pyobj(NPY_FLOAT,z_Dims,z_Rank,capi_z_intent,z_capi);
  if (capi_z_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 3rd argument `z' of _ssrfpack.gradg to C/Fortran array" );
  } else {
    z = (float *)(PyArray_DATA(capi_z_tmp));

  /* Processing variable f */
  f_Dims[0]=n;
  capi_f_intent |= F2PY_INTENT_IN;
  capi_f_tmp = array_from_pyobj(NPY_FLOAT,f_Dims,f_Rank,capi_f_intent,f_capi);
  if (capi_f_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 4th argument `f' of _ssrfpack.gradg to C/Fortran array" );
  } else {
    f = (float *)(PyArray_DATA(capi_f_tmp));

  /* Processing variable list */
  list_Dims[0]=6 * n - 12;
  capi_list_intent |= F2PY_INTENT_IN;
  capi_list_tmp = array_from_pyobj(NPY_INT,list_Dims,list_Rank,capi_list_intent,list_capi);
  if (capi_list_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 5th argument `list' of _ssrfpack.gradg to C/Fortran array" );
  } else {
    list = (int *)(PyArray_DATA(capi_list_tmp));

  /* Processing variable lptr */
  lptr_Dims[0]=6 * n - 12;
  capi_lptr_intent |= F2PY_INTENT_IN;
  capi_lptr_tmp = array_from_pyobj(NPY_INT,lptr_Dims,lptr_Rank,capi_lptr_intent,lptr_capi);
  if (capi_lptr_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 6th argument `lptr' of _ssrfpack.gradg to C/Fortran array" );
  } else {
    lptr = (int *)(PyArray_DATA(capi_lptr_tmp));

  /* Processing variable lend */
  lend_Dims[0]=n;
  capi_lend_intent |= F2PY_INTENT_IN;
  capi_lend_tmp = array_from_pyobj(NPY_INT,lend_Dims,lend_Rank,capi_lend_intent,lend_capi);
  if (capi_lend_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 7th argument `lend' of _ssrfpack.gradg to C/Fortran array" );
  } else {
    lend = (int *)(PyArray_DATA(capi_lend_tmp));

  /* Processing variable grad */
  grad_Dims[0]=3,grad_Dims[1]=n;
  capi_grad_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE;
  capi_grad_tmp = array_from_pyobj(NPY_FLOAT,grad_Dims,grad_Rank,capi_grad_intent,Py_None);
  if (capi_grad_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting hidden `grad' of _ssrfpack.gradg to C/Fortran array" );
  } else {
    grad = (float *)(PyArray_DATA(capi_grad_tmp));

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(&n,x,y,z,f,list,lptr,lend,&iflgs,sigma,&nit,&dgmax,grad,&ier);
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("Ni",capi_grad_tmp,ier);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  }  /*if (capi_grad_tmp == NULL) ... else of grad*/
  /* End of cleaning variable grad */
  if((PyObject *)capi_lend_tmp!=lend_capi) {
    Py_XDECREF(capi_lend_tmp); }
  }  /*if (capi_lend_tmp == NULL) ... else of lend*/
  /* End of cleaning variable lend */
  if((PyObject *)capi_lptr_tmp!=lptr_capi) {
    Py_XDECREF(capi_lptr_tmp); }
  }  /*if (capi_lptr_tmp == NULL) ... else of lptr*/
  /* End of cleaning variable lptr */
  if((PyObject *)capi_list_tmp!=list_capi) {
    Py_XDECREF(capi_list_tmp); }
  }  /*if (capi_list_tmp == NULL) ... else of list*/
  /* End of cleaning variable list */
  if((PyObject *)capi_f_tmp!=f_capi) {
    Py_XDECREF(capi_f_tmp); }
  }  /*if (capi_f_tmp == NULL) ... else of f*/
  /* End of cleaning variable f */
  if((PyObject *)capi_z_tmp!=z_capi) {
    Py_XDECREF(capi_z_tmp); }
  }  /*if (capi_z_tmp == NULL) ... else of z*/
  /* End of cleaning variable z */
  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 */
  /* End of cleaning variable n */
  /* End of cleaning variable ier */
  } /*if (f2py_success) of dgmax*/
  /* End of cleaning variable dgmax */
  } /*if (f2py_success) of nit*/
  /* End of cleaning variable nit */
  if((PyObject *)capi_sigma_tmp!=sigma_capi) {
    Py_XDECREF(capi_sigma_tmp); }
  }  /*if (capi_sigma_tmp == NULL) ... else of sigma*/
  /* End of cleaning variable sigma */
  } /*if (f2py_success) of iflgs*/
  /* End of cleaning variable iflgs */
  if((PyObject *)capi_x_tmp!=x_capi) {
    Py_XDECREF(capi_x_tmp); }
  }  /*if (capi_x_tmp == NULL) ... else of x*/
  /* End of cleaning variable x */
/*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 gradg ********************************/

/*********************************** gradl ***********************************/
static char doc_f2py_rout__ssrfpack_gradl[] = "\
g,ier = gradl(k,x,y,z,w,list,lptr,lend)\n\nWrapper for ``gradl``.\
\n\nParameters\n----------\n"
"k : input int\n"
"x : input rank-1 array('f') with bounds (n)\n"
"y : input rank-1 array('f') with bounds (n)\n"
"z : input rank-1 array('f') with bounds (n)\n"
"w : input rank-1 array('f') with bounds (n)\n"
"list : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lptr : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lend : input rank-1 array('i') with bounds (n)\n"
"\nReturns\n-------\n"
"g : rank-1 array('f') with bounds (3)\n"
"ier : int";
/* extern void F_FUNC(gradl,GRADL)(int*,int*,float*,float*,float*,float*,int*,int*,int*,float*,int*); */
static PyObject *f2py_rout__ssrfpack_gradl(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(int*,int*,float*,float*,float*,float*,int*,int*,int*,float*,int*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  int n = 0;
  int k = 0;
  PyObject *k_capi = Py_None;
  float *x = NULL;
  npy_intp x_Dims[1] = {-1};
  const int x_Rank = 1;
  PyArrayObject *capi_x_tmp = NULL;
  int capi_x_intent = 0;
  PyObject *x_capi = Py_None;
  float *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;
  float *z = NULL;
  npy_intp z_Dims[1] = {-1};
  const int z_Rank = 1;
  PyArrayObject *capi_z_tmp = NULL;
  int capi_z_intent = 0;
  PyObject *z_capi = Py_None;
  float *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;
  int *list = NULL;
  npy_intp list_Dims[1] = {-1};
  const int list_Rank = 1;
  PyArrayObject *capi_list_tmp = NULL;
  int capi_list_intent = 0;
  PyObject *list_capi = Py_None;
  int *lptr = NULL;
  npy_intp lptr_Dims[1] = {-1};
  const int lptr_Rank = 1;
  PyArrayObject *capi_lptr_tmp = NULL;
  int capi_lptr_intent = 0;
  PyObject *lptr_capi = Py_None;
  int *lend = NULL;
  npy_intp lend_Dims[1] = {-1};
  const int lend_Rank = 1;
  PyArrayObject *capi_lend_tmp = NULL;
  int capi_lend_intent = 0;
  PyObject *lend_capi = Py_None;
  float *g = NULL;
  npy_intp g_Dims[1] = {-1};
  const int g_Rank = 1;
  PyArrayObject *capi_g_tmp = NULL;
  int capi_g_intent = 0;
  int ier = 0;
  static char *capi_kwlist[] = {"k","x","y","z","w","list","lptr","lend",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OOOOOOOO:_ssrfpack.gradl",\
    capi_kwlist,&k_capi,&x_capi,&y_capi,&z_capi,&w_capi,&list_capi,&lptr_capi,&lend_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable k */
    f2py_success = int_from_pyobj(&k,k_capi,"_ssrfpack.gradl() 1st argument (k) can't be converted to int");
  if (f2py_success) {
  /* Processing variable x */
  ;
  capi_x_intent |= F2PY_INTENT_IN;
  capi_x_tmp = array_from_pyobj(NPY_FLOAT,x_Dims,x_Rank,capi_x_intent,x_capi);
  if (capi_x_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 2nd argument `x' of _ssrfpack.gradl to C/Fortran array" );
  } else {
    x = (float *)(PyArray_DATA(capi_x_tmp));

  /* Processing variable g */
  g_Dims[0]=3;
  capi_g_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE;
  capi_g_tmp = array_from_pyobj(NPY_FLOAT,g_Dims,g_Rank,capi_g_intent,Py_None);
  if (capi_g_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting hidden `g' of _ssrfpack.gradl to C/Fortran array" );
  } else {
    g = (float *)(PyArray_DATA(capi_g_tmp));

  /* Processing variable ier */
  /* Processing variable n */
  n = len(x);
  /* Processing variable y */
  y_Dims[0]=n;
  capi_y_intent |= F2PY_INTENT_IN;
  capi_y_tmp = array_from_pyobj(NPY_FLOAT,y_Dims,y_Rank,capi_y_intent,y_capi);
  if (capi_y_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 3rd argument `y' of _ssrfpack.gradl to C/Fortran array" );
  } else {
    y = (float *)(PyArray_DATA(capi_y_tmp));

  /* Processing variable z */
  z_Dims[0]=n;
  capi_z_intent |= F2PY_INTENT_IN;
  capi_z_tmp = array_from_pyobj(NPY_FLOAT,z_Dims,z_Rank,capi_z_intent,z_capi);
  if (capi_z_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 4th argument `z' of _ssrfpack.gradl to C/Fortran array" );
  } else {
    z = (float *)(PyArray_DATA(capi_z_tmp));

  /* Processing variable w */
  w_Dims[0]=n;
  capi_w_intent |= F2PY_INTENT_IN;
  capi_w_tmp = array_from_pyobj(NPY_FLOAT,w_Dims,w_Rank,capi_w_intent,w_capi);
  if (capi_w_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 5th argument `w' of _ssrfpack.gradl to C/Fortran array" );
  } else {
    w = (float *)(PyArray_DATA(capi_w_tmp));

  /* Processing variable list */
  list_Dims[0]=6 * n - 12;
  capi_list_intent |= F2PY_INTENT_IN;
  capi_list_tmp = array_from_pyobj(NPY_INT,list_Dims,list_Rank,capi_list_intent,list_capi);
  if (capi_list_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 6th argument `list' of _ssrfpack.gradl to C/Fortran array" );
  } else {
    list = (int *)(PyArray_DATA(capi_list_tmp));

  /* Processing variable lptr */
  lptr_Dims[0]=6 * n - 12;
  capi_lptr_intent |= F2PY_INTENT_IN;
  capi_lptr_tmp = array_from_pyobj(NPY_INT,lptr_Dims,lptr_Rank,capi_lptr_intent,lptr_capi);
  if (capi_lptr_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 7th argument `lptr' of _ssrfpack.gradl to C/Fortran array" );
  } else {
    lptr = (int *)(PyArray_DATA(capi_lptr_tmp));

  /* Processing variable lend */
  lend_Dims[0]=n;
  capi_lend_intent |= F2PY_INTENT_IN;
  capi_lend_tmp = array_from_pyobj(NPY_INT,lend_Dims,lend_Rank,capi_lend_intent,lend_capi);
  if (capi_lend_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 8th argument `lend' of _ssrfpack.gradl to C/Fortran array" );
  } else {
    lend = (int *)(PyArray_DATA(capi_lend_tmp));

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(&n,&k,x,y,z,w,list,lptr,lend,g,&ier);
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("Ni",capi_g_tmp,ier);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  if((PyObject *)capi_lend_tmp!=lend_capi) {
    Py_XDECREF(capi_lend_tmp); }
  }  /*if (capi_lend_tmp == NULL) ... else of lend*/
  /* End of cleaning variable lend */
  if((PyObject *)capi_lptr_tmp!=lptr_capi) {
    Py_XDECREF(capi_lptr_tmp); }
  }  /*if (capi_lptr_tmp == NULL) ... else of lptr*/
  /* End of cleaning variable lptr */
  if((PyObject *)capi_list_tmp!=list_capi) {
    Py_XDECREF(capi_list_tmp); }
  }  /*if (capi_list_tmp == NULL) ... else of list*/
  /* End of cleaning variable list */
  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((PyObject *)capi_z_tmp!=z_capi) {
    Py_XDECREF(capi_z_tmp); }
  }  /*if (capi_z_tmp == NULL) ... else of z*/
  /* End of cleaning variable z */
  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 */
  /* End of cleaning variable n */
  /* End of cleaning variable ier */
  }  /*if (capi_g_tmp == NULL) ... else of g*/
  /* End of cleaning variable g */
  if((PyObject *)capi_x_tmp!=x_capi) {
    Py_XDECREF(capi_x_tmp); }
  }  /*if (capi_x_tmp == NULL) ... else of x*/
  /* End of cleaning variable x */
  } /*if (f2py_success) of k*/
  /* End of cleaning variable k */
/*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 gradl ********************************/

/*********************************** intrc0 ***********************************/
static char doc_f2py_rout__ssrfpack_intrc0[] = "\
ist,pw,ier = intrc0(plat,plon,x,y,z,w,list,lptr,lend,ist)\n\nWrapper for ``intrc0``.\
\n\nParameters\n----------\n"
"plat : input float\n"
"plon : input float\n"
"x : input rank-1 array('f') with bounds (n)\n"
"y : input rank-1 array('f') with bounds (n)\n"
"z : input rank-1 array('f') with bounds (n)\n"
"w : input rank-1 array('f') with bounds (n)\n"
"list : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lptr : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lend : input rank-1 array('i') with bounds (n)\n"
"ist : input int\n"
"\nReturns\n-------\n"
"ist : int\n"
"pw : float\n"
"ier : int";
/* extern void F_FUNC(intrc0,INTRC0)(int*,float*,float*,float*,float*,float*,float*,int*,int*,int*,int*,float*,int*); */
static PyObject *f2py_rout__ssrfpack_intrc0(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(int*,float*,float*,float*,float*,float*,float*,int*,int*,int*,int*,float*,int*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  int n = 0;
  float plat = 0;
  PyObject *plat_capi = Py_None;
  float plon = 0;
  PyObject *plon_capi = Py_None;
  float *x = NULL;
  npy_intp x_Dims[1] = {-1};
  const int x_Rank = 1;
  PyArrayObject *capi_x_tmp = NULL;
  int capi_x_intent = 0;
  PyObject *x_capi = Py_None;
  float *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;
  float *z = NULL;
  npy_intp z_Dims[1] = {-1};
  const int z_Rank = 1;
  PyArrayObject *capi_z_tmp = NULL;
  int capi_z_intent = 0;
  PyObject *z_capi = Py_None;
  float *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;
  int *list = NULL;
  npy_intp list_Dims[1] = {-1};
  const int list_Rank = 1;
  PyArrayObject *capi_list_tmp = NULL;
  int capi_list_intent = 0;
  PyObject *list_capi = Py_None;
  int *lptr = NULL;
  npy_intp lptr_Dims[1] = {-1};
  const int lptr_Rank = 1;
  PyArrayObject *capi_lptr_tmp = NULL;
  int capi_lptr_intent = 0;
  PyObject *lptr_capi = Py_None;
  int *lend = NULL;
  npy_intp lend_Dims[1] = {-1};
  const int lend_Rank = 1;
  PyArrayObject *capi_lend_tmp = NULL;
  int capi_lend_intent = 0;
  PyObject *lend_capi = Py_None;
  int ist = 0;
  PyObject *ist_capi = Py_None;
  float pw = 0;
  int ier = 0;
  static char *capi_kwlist[] = {"plat","plon","x","y","z","w","list","lptr","lend","ist",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OOOOOOOOOO:_ssrfpack.intrc0",\
    capi_kwlist,&plat_capi,&plon_capi,&x_capi,&y_capi,&z_capi,&w_capi,&list_capi,&lptr_capi,&lend_capi,&ist_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable plat */
    f2py_success = float_from_pyobj(&plat,plat_capi,"_ssrfpack.intrc0() 1st argument (plat) can't be converted to float");
  if (f2py_success) {
  /* Processing variable plon */
    f2py_success = float_from_pyobj(&plon,plon_capi,"_ssrfpack.intrc0() 2nd argument (plon) can't be converted to float");
  if (f2py_success) {
  /* Processing variable x */
  ;
  capi_x_intent |= F2PY_INTENT_IN;
  capi_x_tmp = array_from_pyobj(NPY_FLOAT,x_Dims,x_Rank,capi_x_intent,x_capi);
  if (capi_x_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 3rd argument `x' of _ssrfpack.intrc0 to C/Fortran array" );
  } else {
    x = (float *)(PyArray_DATA(capi_x_tmp));

  /* Processing variable ist */
    f2py_success = int_from_pyobj(&ist,ist_capi,"_ssrfpack.intrc0() 10th argument (ist) can't be converted to int");
  if (f2py_success) {
  /* Processing variable pw */
  /* Processing variable ier */
  /* Processing variable n */
  n = len(x);
  /* Processing variable y */
  y_Dims[0]=n;
  capi_y_intent |= F2PY_INTENT_IN;
  capi_y_tmp = array_from_pyobj(NPY_FLOAT,y_Dims,y_Rank,capi_y_intent,y_capi);
  if (capi_y_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 4th argument `y' of _ssrfpack.intrc0 to C/Fortran array" );
  } else {
    y = (float *)(PyArray_DATA(capi_y_tmp));

  /* Processing variable z */
  z_Dims[0]=n;
  capi_z_intent |= F2PY_INTENT_IN;
  capi_z_tmp = array_from_pyobj(NPY_FLOAT,z_Dims,z_Rank,capi_z_intent,z_capi);
  if (capi_z_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 5th argument `z' of _ssrfpack.intrc0 to C/Fortran array" );
  } else {
    z = (float *)(PyArray_DATA(capi_z_tmp));

  /* Processing variable w */
  w_Dims[0]=n;
  capi_w_intent |= F2PY_INTENT_IN;
  capi_w_tmp = array_from_pyobj(NPY_FLOAT,w_Dims,w_Rank,capi_w_intent,w_capi);
  if (capi_w_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 6th argument `w' of _ssrfpack.intrc0 to C/Fortran array" );
  } else {
    w = (float *)(PyArray_DATA(capi_w_tmp));

  /* Processing variable list */
  list_Dims[0]=6 * n - 12;
  capi_list_intent |= F2PY_INTENT_IN;
  capi_list_tmp = array_from_pyobj(NPY_INT,list_Dims,list_Rank,capi_list_intent,list_capi);
  if (capi_list_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 7th argument `list' of _ssrfpack.intrc0 to C/Fortran array" );
  } else {
    list = (int *)(PyArray_DATA(capi_list_tmp));

  /* Processing variable lptr */
  lptr_Dims[0]=6 * n - 12;
  capi_lptr_intent |= F2PY_INTENT_IN;
  capi_lptr_tmp = array_from_pyobj(NPY_INT,lptr_Dims,lptr_Rank,capi_lptr_intent,lptr_capi);
  if (capi_lptr_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 8th argument `lptr' of _ssrfpack.intrc0 to C/Fortran array" );
  } else {
    lptr = (int *)(PyArray_DATA(capi_lptr_tmp));

  /* Processing variable lend */
  lend_Dims[0]=n;
  capi_lend_intent |= F2PY_INTENT_IN;
  capi_lend_tmp = array_from_pyobj(NPY_INT,lend_Dims,lend_Rank,capi_lend_intent,lend_capi);
  if (capi_lend_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 9th argument `lend' of _ssrfpack.intrc0 to C/Fortran array" );
  } else {
    lend = (int *)(PyArray_DATA(capi_lend_tmp));

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(&n,&plat,&plon,x,y,z,w,list,lptr,lend,&ist,&pw,&ier);
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("ifi",ist,pw,ier);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  if((PyObject *)capi_lend_tmp!=lend_capi) {
    Py_XDECREF(capi_lend_tmp); }
  }  /*if (capi_lend_tmp == NULL) ... else of lend*/
  /* End of cleaning variable lend */
  if((PyObject *)capi_lptr_tmp!=lptr_capi) {
    Py_XDECREF(capi_lptr_tmp); }
  }  /*if (capi_lptr_tmp == NULL) ... else of lptr*/
  /* End of cleaning variable lptr */
  if((PyObject *)capi_list_tmp!=list_capi) {
    Py_XDECREF(capi_list_tmp); }
  }  /*if (capi_list_tmp == NULL) ... else of list*/
  /* End of cleaning variable list */
  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((PyObject *)capi_z_tmp!=z_capi) {
    Py_XDECREF(capi_z_tmp); }
  }  /*if (capi_z_tmp == NULL) ... else of z*/
  /* End of cleaning variable z */
  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 */
  /* End of cleaning variable n */
  /* End of cleaning variable ier */
  /* End of cleaning variable pw */
  } /*if (f2py_success) of ist*/
  /* End of cleaning variable ist */
  if((PyObject *)capi_x_tmp!=x_capi) {
    Py_XDECREF(capi_x_tmp); }
  }  /*if (capi_x_tmp == NULL) ... else of x*/
  /* End of cleaning variable x */
  } /*if (f2py_success) of plon*/
  /* End of cleaning variable plon */
  } /*if (f2py_success) of plat*/
  /* End of cleaning variable plat */
/*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 intrc0 *******************************/

/*********************************** intrc1 ***********************************/
static char doc_f2py_rout__ssrfpack_intrc1[] = "\
ist,fp,ier = intrc1(plat,plon,x,y,z,f,list,lptr,lend,iflgs,sigma,iflgg,grad,ist)\n\nWrapper for ``intrc1``.\
\n\nParameters\n----------\n"
"plat : input float\n"
"plon : input float\n"
"x : input rank-1 array('f') with bounds (n)\n"
"y : input rank-1 array('f') with bounds (n)\n"
"z : input rank-1 array('f') with bounds (n)\n"
"f : input rank-1 array('f') with bounds (n)\n"
"list : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lptr : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lend : input rank-1 array('i') with bounds (n)\n"
"iflgs : input int\n"
"sigma : input rank-1 array('f') with bounds (*)\n"
"iflgg : input int\n"
"grad : input rank-2 array('f') with bounds (3,n)\n"
"ist : input int\n"
"\nReturns\n-------\n"
"ist : int\n"
"fp : float\n"
"ier : int";
/* extern void F_FUNC(intrc1,INTRC1)(int*,float*,float*,float*,float*,float*,float*,int*,int*,int*,int*,float*,int*,float*,int*,float*,int*); */
static PyObject *f2py_rout__ssrfpack_intrc1(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(int*,float*,float*,float*,float*,float*,float*,int*,int*,int*,int*,float*,int*,float*,int*,float*,int*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  int n = 0;
  float plat = 0;
  PyObject *plat_capi = Py_None;
  float plon = 0;
  PyObject *plon_capi = Py_None;
  float *x = NULL;
  npy_intp x_Dims[1] = {-1};
  const int x_Rank = 1;
  PyArrayObject *capi_x_tmp = NULL;
  int capi_x_intent = 0;
  PyObject *x_capi = Py_None;
  float *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;
  float *z = NULL;
  npy_intp z_Dims[1] = {-1};
  const int z_Rank = 1;
  PyArrayObject *capi_z_tmp = NULL;
  int capi_z_intent = 0;
  PyObject *z_capi = Py_None;
  float *f = NULL;
  npy_intp f_Dims[1] = {-1};
  const int f_Rank = 1;
  PyArrayObject *capi_f_tmp = NULL;
  int capi_f_intent = 0;
  PyObject *f_capi = Py_None;
  int *list = NULL;
  npy_intp list_Dims[1] = {-1};
  const int list_Rank = 1;
  PyArrayObject *capi_list_tmp = NULL;
  int capi_list_intent = 0;
  PyObject *list_capi = Py_None;
  int *lptr = NULL;
  npy_intp lptr_Dims[1] = {-1};
  const int lptr_Rank = 1;
  PyArrayObject *capi_lptr_tmp = NULL;
  int capi_lptr_intent = 0;
  PyObject *lptr_capi = Py_None;
  int *lend = NULL;
  npy_intp lend_Dims[1] = {-1};
  const int lend_Rank = 1;
  PyArrayObject *capi_lend_tmp = NULL;
  int capi_lend_intent = 0;
  PyObject *lend_capi = Py_None;
  int iflgs = 0;
  PyObject *iflgs_capi = Py_None;
  float *sigma = NULL;
  npy_intp sigma_Dims[1] = {-1};
  const int sigma_Rank = 1;
  PyArrayObject *capi_sigma_tmp = NULL;
  int capi_sigma_intent = 0;
  PyObject *sigma_capi = Py_None;
  int iflgg = 0;
  PyObject *iflgg_capi = Py_None;
  float *grad = NULL;
  npy_intp grad_Dims[2] = {-1, -1};
  const int grad_Rank = 2;
  PyArrayObject *capi_grad_tmp = NULL;
  int capi_grad_intent = 0;
  PyObject *grad_capi = Py_None;
  int ist = 0;
  PyObject *ist_capi = Py_None;
  float fp = 0;
  int ier = 0;
  static char *capi_kwlist[] = {"plat","plon","x","y","z","f","list","lptr","lend","iflgs","sigma","iflgg","grad","ist",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OOOOOOOOOOOOOO:_ssrfpack.intrc1",\
    capi_kwlist,&plat_capi,&plon_capi,&x_capi,&y_capi,&z_capi,&f_capi,&list_capi,&lptr_capi,&lend_capi,&iflgs_capi,&sigma_capi,&iflgg_capi,&grad_capi,&ist_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable plat */
    f2py_success = float_from_pyobj(&plat,plat_capi,"_ssrfpack.intrc1() 1st argument (plat) can't be converted to float");
  if (f2py_success) {
  /* Processing variable plon */
    f2py_success = float_from_pyobj(&plon,plon_capi,"_ssrfpack.intrc1() 2nd argument (plon) can't be converted to float");
  if (f2py_success) {
  /* Processing variable x */
  ;
  capi_x_intent |= F2PY_INTENT_IN;
  capi_x_tmp = array_from_pyobj(NPY_FLOAT,x_Dims,x_Rank,capi_x_intent,x_capi);
  if (capi_x_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 3rd argument `x' of _ssrfpack.intrc1 to C/Fortran array" );
  } else {
    x = (float *)(PyArray_DATA(capi_x_tmp));

  /* Processing variable iflgs */
    f2py_success = int_from_pyobj(&iflgs,iflgs_capi,"_ssrfpack.intrc1() 10th argument (iflgs) can't be converted to int");
  if (f2py_success) {
  /* Processing variable sigma */
  ;
  capi_sigma_intent |= F2PY_INTENT_IN;
  capi_sigma_tmp = array_from_pyobj(NPY_FLOAT,sigma_Dims,sigma_Rank,capi_sigma_intent,sigma_capi);
  if (capi_sigma_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 11st argument `sigma' of _ssrfpack.intrc1 to C/Fortran array" );
  } else {
    sigma = (float *)(PyArray_DATA(capi_sigma_tmp));

  /* Processing variable iflgg */
    f2py_success = int_from_pyobj(&iflgg,iflgg_capi,"_ssrfpack.intrc1() 12nd argument (iflgg) can't be converted to int");
  if (f2py_success) {
  /* Processing variable ist */
    f2py_success = int_from_pyobj(&ist,ist_capi,"_ssrfpack.intrc1() 14th argument (ist) can't be converted to int");
  if (f2py_success) {
  /* Processing variable fp */
  /* Processing variable ier */
  /* Processing variable n */
  n = len(x);
  /* Processing variable y */
  y_Dims[0]=n;
  capi_y_intent |= F2PY_INTENT_IN;
  capi_y_tmp = array_from_pyobj(NPY_FLOAT,y_Dims,y_Rank,capi_y_intent,y_capi);
  if (capi_y_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 4th argument `y' of _ssrfpack.intrc1 to C/Fortran array" );
  } else {
    y = (float *)(PyArray_DATA(capi_y_tmp));

  /* Processing variable z */
  z_Dims[0]=n;
  capi_z_intent |= F2PY_INTENT_IN;
  capi_z_tmp = array_from_pyobj(NPY_FLOAT,z_Dims,z_Rank,capi_z_intent,z_capi);
  if (capi_z_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 5th argument `z' of _ssrfpack.intrc1 to C/Fortran array" );
  } else {
    z = (float *)(PyArray_DATA(capi_z_tmp));

  /* Processing variable f */
  f_Dims[0]=n;
  capi_f_intent |= F2PY_INTENT_IN;
  capi_f_tmp = array_from_pyobj(NPY_FLOAT,f_Dims,f_Rank,capi_f_intent,f_capi);
  if (capi_f_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 6th argument `f' of _ssrfpack.intrc1 to C/Fortran array" );
  } else {
    f = (float *)(PyArray_DATA(capi_f_tmp));

  /* Processing variable list */
  list_Dims[0]=6 * n - 12;
  capi_list_intent |= F2PY_INTENT_IN;
  capi_list_tmp = array_from_pyobj(NPY_INT,list_Dims,list_Rank,capi_list_intent,list_capi);
  if (capi_list_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 7th argument `list' of _ssrfpack.intrc1 to C/Fortran array" );
  } else {
    list = (int *)(PyArray_DATA(capi_list_tmp));

  /* Processing variable lptr */
  lptr_Dims[0]=6 * n - 12;
  capi_lptr_intent |= F2PY_INTENT_IN;
  capi_lptr_tmp = array_from_pyobj(NPY_INT,lptr_Dims,lptr_Rank,capi_lptr_intent,lptr_capi);
  if (capi_lptr_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 8th argument `lptr' of _ssrfpack.intrc1 to C/Fortran array" );
  } else {
    lptr = (int *)(PyArray_DATA(capi_lptr_tmp));

  /* Processing variable lend */
  lend_Dims[0]=n;
  capi_lend_intent |= F2PY_INTENT_IN;
  capi_lend_tmp = array_from_pyobj(NPY_INT,lend_Dims,lend_Rank,capi_lend_intent,lend_capi);
  if (capi_lend_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 9th argument `lend' of _ssrfpack.intrc1 to C/Fortran array" );
  } else {
    lend = (int *)(PyArray_DATA(capi_lend_tmp));

  /* Processing variable grad */
  grad_Dims[0]=3,grad_Dims[1]=n;
  capi_grad_intent |= F2PY_INTENT_IN;
  capi_grad_tmp = array_from_pyobj(NPY_FLOAT,grad_Dims,grad_Rank,capi_grad_intent,grad_capi);
  if (capi_grad_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 13rd argument `grad' of _ssrfpack.intrc1 to C/Fortran array" );
  } else {
    grad = (float *)(PyArray_DATA(capi_grad_tmp));

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(&n,&plat,&plon,x,y,z,f,list,lptr,lend,&iflgs,sigma,&iflgg,grad,&ist,&fp,&ier);
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("ifi",ist,fp,ier);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  if((PyObject *)capi_grad_tmp!=grad_capi) {
    Py_XDECREF(capi_grad_tmp); }
  }  /*if (capi_grad_tmp == NULL) ... else of grad*/
  /* End of cleaning variable grad */
  if((PyObject *)capi_lend_tmp!=lend_capi) {
    Py_XDECREF(capi_lend_tmp); }
  }  /*if (capi_lend_tmp == NULL) ... else of lend*/
  /* End of cleaning variable lend */
  if((PyObject *)capi_lptr_tmp!=lptr_capi) {
    Py_XDECREF(capi_lptr_tmp); }
  }  /*if (capi_lptr_tmp == NULL) ... else of lptr*/
  /* End of cleaning variable lptr */
  if((PyObject *)capi_list_tmp!=list_capi) {
    Py_XDECREF(capi_list_tmp); }
  }  /*if (capi_list_tmp == NULL) ... else of list*/
  /* End of cleaning variable list */
  if((PyObject *)capi_f_tmp!=f_capi) {
    Py_XDECREF(capi_f_tmp); }
  }  /*if (capi_f_tmp == NULL) ... else of f*/
  /* End of cleaning variable f */
  if((PyObject *)capi_z_tmp!=z_capi) {
    Py_XDECREF(capi_z_tmp); }
  }  /*if (capi_z_tmp == NULL) ... else of z*/
  /* End of cleaning variable z */
  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 */
  /* End of cleaning variable n */
  /* End of cleaning variable ier */
  /* End of cleaning variable fp */
  } /*if (f2py_success) of ist*/
  /* End of cleaning variable ist */
  } /*if (f2py_success) of iflgg*/
  /* End of cleaning variable iflgg */
  if((PyObject *)capi_sigma_tmp!=sigma_capi) {
    Py_XDECREF(capi_sigma_tmp); }
  }  /*if (capi_sigma_tmp == NULL) ... else of sigma*/
  /* End of cleaning variable sigma */
  } /*if (f2py_success) of iflgs*/
  /* End of cleaning variable iflgs */
  if((PyObject *)capi_x_tmp!=x_capi) {
    Py_XDECREF(capi_x_tmp); }
  }  /*if (capi_x_tmp == NULL) ... else of x*/
  /* End of cleaning variable x */
  } /*if (f2py_success) of plon*/
  /* End of cleaning variable plon */
  } /*if (f2py_success) of plat*/
  /* End of cleaning variable plat */
/*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 intrc1 *******************************/

/*********************************** sgprnt ***********************************/
static char doc_f2py_rout__ssrfpack_sgprnt[] = "\
sgprnt(lunit,list,lptr,lend,sigma)\n\nWrapper for ``sgprnt``.\
\n\nParameters\n----------\n"
"lunit : input int\n"
"list : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lptr : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lend : input rank-1 array('i') with bounds (n)\n"
"sigma : input rank-1 array('f') with bounds (6 * n - 12)";
/* extern void F_FUNC(sgprnt,SGPRNT)(int*,int*,int*,int*,int*,float*); */
static PyObject *f2py_rout__ssrfpack_sgprnt(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(int*,int*,int*,int*,int*,float*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  int n = 0;
  int lunit = 0;
  PyObject *lunit_capi = Py_None;
  int *list = NULL;
  npy_intp list_Dims[1] = {-1};
  const int list_Rank = 1;
  PyArrayObject *capi_list_tmp = NULL;
  int capi_list_intent = 0;
  PyObject *list_capi = Py_None;
  int *lptr = NULL;
  npy_intp lptr_Dims[1] = {-1};
  const int lptr_Rank = 1;
  PyArrayObject *capi_lptr_tmp = NULL;
  int capi_lptr_intent = 0;
  PyObject *lptr_capi = Py_None;
  int *lend = NULL;
  npy_intp lend_Dims[1] = {-1};
  const int lend_Rank = 1;
  PyArrayObject *capi_lend_tmp = NULL;
  int capi_lend_intent = 0;
  PyObject *lend_capi = Py_None;
  float *sigma = NULL;
  npy_intp sigma_Dims[1] = {-1};
  const int sigma_Rank = 1;
  PyArrayObject *capi_sigma_tmp = NULL;
  int capi_sigma_intent = 0;
  PyObject *sigma_capi = Py_None;
  static char *capi_kwlist[] = {"lunit","list","lptr","lend","sigma",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OOOOO:_ssrfpack.sgprnt",\
    capi_kwlist,&lunit_capi,&list_capi,&lptr_capi,&lend_capi,&sigma_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable lunit */
    f2py_success = int_from_pyobj(&lunit,lunit_capi,"_ssrfpack.sgprnt() 1st argument (lunit) can't be converted to int");
  if (f2py_success) {
  /* Processing variable lend */
  ;
  capi_lend_intent |= F2PY_INTENT_IN;
  capi_lend_tmp = array_from_pyobj(NPY_INT,lend_Dims,lend_Rank,capi_lend_intent,lend_capi);
  if (capi_lend_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 4th argument `lend' of _ssrfpack.sgprnt to C/Fortran array" );
  } else {
    lend = (int *)(PyArray_DATA(capi_lend_tmp));

  /* Processing variable n */
  n = len(lend);
  /* Processing variable list */
  list_Dims[0]=6 * n - 12;
  capi_list_intent |= F2PY_INTENT_IN;
  capi_list_tmp = array_from_pyobj(NPY_INT,list_Dims,list_Rank,capi_list_intent,list_capi);
  if (capi_list_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 2nd argument `list' of _ssrfpack.sgprnt to C/Fortran array" );
  } else {
    list = (int *)(PyArray_DATA(capi_list_tmp));

  /* Processing variable lptr */
  lptr_Dims[0]=6 * n - 12;
  capi_lptr_intent |= F2PY_INTENT_IN;
  capi_lptr_tmp = array_from_pyobj(NPY_INT,lptr_Dims,lptr_Rank,capi_lptr_intent,lptr_capi);
  if (capi_lptr_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 3rd argument `lptr' of _ssrfpack.sgprnt to C/Fortran array" );
  } else {
    lptr = (int *)(PyArray_DATA(capi_lptr_tmp));

  /* Processing variable sigma */
  sigma_Dims[0]=6 * n - 12;
  capi_sigma_intent |= F2PY_INTENT_IN;
  capi_sigma_tmp = array_from_pyobj(NPY_FLOAT,sigma_Dims,sigma_Rank,capi_sigma_intent,sigma_capi);
  if (capi_sigma_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 5th argument `sigma' of _ssrfpack.sgprnt to C/Fortran array" );
  } else {
    sigma = (float *)(PyArray_DATA(capi_sigma_tmp));

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(&n,&lunit,list,lptr,lend,sigma);
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("");
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  if((PyObject *)capi_sigma_tmp!=sigma_capi) {
    Py_XDECREF(capi_sigma_tmp); }
  }  /*if (capi_sigma_tmp == NULL) ... else of sigma*/
  /* End of cleaning variable sigma */
  if((PyObject *)capi_lptr_tmp!=lptr_capi) {
    Py_XDECREF(capi_lptr_tmp); }
  }  /*if (capi_lptr_tmp == NULL) ... else of lptr*/
  /* End of cleaning variable lptr */
  if((PyObject *)capi_list_tmp!=list_capi) {
    Py_XDECREF(capi_list_tmp); }
  }  /*if (capi_list_tmp == NULL) ... else of list*/
  /* End of cleaning variable list */
  /* End of cleaning variable n */
  if((PyObject *)capi_lend_tmp!=lend_capi) {
    Py_XDECREF(capi_lend_tmp); }
  }  /*if (capi_lend_tmp == NULL) ... else of lend*/
  /* End of cleaning variable lend */
  } /*if (f2py_success) of lunit*/
  /* End of cleaning variable lunit */
/*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 sgprnt *******************************/

/*********************************** smsurf ***********************************/
static char doc_f2py_rout__ssrfpack_smsurf[] = "\
f,grad,ier = smsurf(x,y,z,u,list,lptr,lend,iflgs,sigma,w,sm,smtol,gstol,lprnt)\n\nWrapper for ``smsurf``.\
\n\nParameters\n----------\n"
"x : input rank-1 array('f') with bounds (n)\n"
"y : input rank-1 array('f') with bounds (n)\n"
"z : input rank-1 array('f') with bounds (n)\n"
"u : input rank-1 array('f') with bounds (n)\n"
"list : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lptr : input rank-1 array('i') with bounds (6 * n - 12)\n"
"lend : input rank-1 array('i') with bounds (n)\n"
"iflgs : input int\n"
"sigma : input rank-1 array('f') with bounds (*)\n"
"w : input rank-1 array('f') with bounds (n)\n"
"sm : input float\n"
"smtol : input float\n"
"gstol : input float\n"
"lprnt : input int\n"
"\nReturns\n-------\n"
"f : rank-1 array('f') with bounds (n)\n"
"grad : rank-2 array('f') with bounds (3,n)\n"
"ier : int";
/* extern void F_FUNC(smsurf,SMSURF)(int*,float*,float*,float*,float*,int*,int*,int*,int*,float*,float*,float*,float*,float*,int*,float*,float*,int*); */
static PyObject *f2py_rout__ssrfpack_smsurf(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(int*,float*,float*,float*,float*,int*,int*,int*,int*,float*,float*,float*,float*,float*,int*,float*,float*,int*)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  int n = 0;
  float *x = NULL;
  npy_intp x_Dims[1] = {-1};
  const int x_Rank = 1;
  PyArrayObject *capi_x_tmp = NULL;
  int capi_x_intent = 0;
  PyObject *x_capi = Py_None;
  float *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;
  float *z = NULL;
  npy_intp z_Dims[1] = {-1};
  const int z_Rank = 1;
  PyArrayObject *capi_z_tmp = NULL;
  int capi_z_intent = 0;
  PyObject *z_capi = Py_None;
  float *u = NULL;
  npy_intp u_Dims[1] = {-1};
  const int u_Rank = 1;
  PyArrayObject *capi_u_tmp = NULL;
  int capi_u_intent = 0;
  PyObject *u_capi = Py_None;
  int *list = NULL;
  npy_intp list_Dims[1] = {-1};
  const int list_Rank = 1;
  PyArrayObject *capi_list_tmp = NULL;
  int capi_list_intent = 0;
  PyObject *list_capi = Py_None;
  int *lptr = NULL;
  npy_intp lptr_Dims[1] = {-1};
  const int lptr_Rank = 1;
  PyArrayObject *capi_lptr_tmp = NULL;
  int capi_lptr_intent = 0;
  PyObject *lptr_capi = Py_None;
  int *lend = NULL;
  npy_intp lend_Dims[1] = {-1};
  const int lend_Rank = 1;
  PyArrayObject *capi_lend_tmp = NULL;
  int capi_lend_intent = 0;
  PyObject *lend_capi = Py_None;
  int iflgs = 0;
  PyObject *iflgs_capi = Py_None;
  float *sigma = NULL;
  npy_intp sigma_Dims[1] = {-1};
  const int sigma_Rank = 1;
  PyArrayObject *capi_sigma_tmp = NULL;
  int capi_sigma_intent = 0;
  PyObject *sigma_capi = Py_None;
  float *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;
  float sm = 0;
  PyObject *sm_capi = Py_None;
  float smtol = 0;
  PyObject *smtol_capi = Py_None;
  float gstol = 0;
  PyObject *gstol_capi = Py_None;
  int lprnt = 0;
  PyObject *lprnt_capi = Py_None;
  float *f = NULL;
  npy_intp f_Dims[1] = {-1};
  const int f_Rank = 1;
  PyArrayObject *capi_f_tmp = NULL;
  int capi_f_intent = 0;
  float *grad = NULL;
  npy_intp grad_Dims[2] = {-1, -1};
  const int grad_Rank = 2;
  PyArrayObject *capi_grad_tmp = NULL;
  int capi_grad_intent = 0;
  int ier = 0;
  static char *capi_kwlist[] = {"x","y","z","u","list","lptr","lend","iflgs","sigma","w","sm","smtol","gstol","lprnt",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OOOOOOOOOOOOOO:_ssrfpack.smsurf",\
    capi_kwlist,&x_capi,&y_capi,&z_capi,&u_capi,&list_capi,&lptr_capi,&lend_capi,&iflgs_capi,&sigma_capi,&w_capi,&sm_capi,&smtol_capi,&gstol_capi,&lprnt_capi))
    return NULL;
/*frompyobj*/
  /* Processing variable x */
  ;
  capi_x_intent |= F2PY_INTENT_IN;
  capi_x_tmp = array_from_pyobj(NPY_FLOAT,x_Dims,x_Rank,capi_x_intent,x_capi);
  if (capi_x_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 1st argument `x' of _ssrfpack.smsurf to C/Fortran array" );
  } else {
    x = (float *)(PyArray_DATA(capi_x_tmp));

  /* Processing variable iflgs */
    f2py_success = int_from_pyobj(&iflgs,iflgs_capi,"_ssrfpack.smsurf() 8th argument (iflgs) can't be converted to int");
  if (f2py_success) {
  /* Processing variable sigma */
  ;
  capi_sigma_intent |= F2PY_INTENT_IN;
  capi_sigma_tmp = array_from_pyobj(NPY_FLOAT,sigma_Dims,sigma_Rank,capi_sigma_intent,sigma_capi);
  if (capi_sigma_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 9th argument `sigma' of _ssrfpack.smsurf to C/Fortran array" );
  } else {
    sigma = (float *)(PyArray_DATA(capi_sigma_tmp));

  /* Processing variable sm */
    f2py_success = float_from_pyobj(&sm,sm_capi,"_ssrfpack.smsurf() 11st argument (sm) can't be converted to float");
  if (f2py_success) {
  /* Processing variable smtol */
    f2py_success = float_from_pyobj(&smtol,smtol_capi,"_ssrfpack.smsurf() 12nd argument (smtol) can't be converted to float");
  if (f2py_success) {
  /* Processing variable gstol */
    f2py_success = float_from_pyobj(&gstol,gstol_capi,"_ssrfpack.smsurf() 13rd argument (gstol) can't be converted to float");
  if (f2py_success) {
  /* Processing variable lprnt */
    f2py_success = int_from_pyobj(&lprnt,lprnt_capi,"_ssrfpack.smsurf() 14th argument (lprnt) can't be converted to int");
  if (f2py_success) {
  /* Processing variable ier */
  /* Processing variable n */
  n = len(x);
  /* Processing variable y */
  y_Dims[0]=n;
  capi_y_intent |= F2PY_INTENT_IN;
  capi_y_tmp = array_from_pyobj(NPY_FLOAT,y_Dims,y_Rank,capi_y_intent,y_capi);
  if (capi_y_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 2nd argument `y' of _ssrfpack.smsurf to C/Fortran array" );
  } else {
    y = (float *)(PyArray_DATA(capi_y_tmp));

  /* Processing variable z */
  z_Dims[0]=n;
  capi_z_intent |= F2PY_INTENT_IN;
  capi_z_tmp = array_from_pyobj(NPY_FLOAT,z_Dims,z_Rank,capi_z_intent,z_capi);
  if (capi_z_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 3rd argument `z' of _ssrfpack.smsurf to C/Fortran array" );
  } else {
    z = (float *)(PyArray_DATA(capi_z_tmp));

  /* Processing variable u */
  u_Dims[0]=n;
  capi_u_intent |= F2PY_INTENT_IN;
  capi_u_tmp = array_from_pyobj(NPY_FLOAT,u_Dims,u_Rank,capi_u_intent,u_capi);
  if (capi_u_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 4th argument `u' of _ssrfpack.smsurf to C/Fortran array" );
  } else {
    u = (float *)(PyArray_DATA(capi_u_tmp));

  /* Processing variable list */
  list_Dims[0]=6 * n - 12;
  capi_list_intent |= F2PY_INTENT_IN;
  capi_list_tmp = array_from_pyobj(NPY_INT,list_Dims,list_Rank,capi_list_intent,list_capi);
  if (capi_list_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 5th argument `list' of _ssrfpack.smsurf to C/Fortran array" );
  } else {
    list = (int *)(PyArray_DATA(capi_list_tmp));

  /* Processing variable lptr */
  lptr_Dims[0]=6 * n - 12;
  capi_lptr_intent |= F2PY_INTENT_IN;
  capi_lptr_tmp = array_from_pyobj(NPY_INT,lptr_Dims,lptr_Rank,capi_lptr_intent,lptr_capi);
  if (capi_lptr_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 6th argument `lptr' of _ssrfpack.smsurf to C/Fortran array" );
  } else {
    lptr = (int *)(PyArray_DATA(capi_lptr_tmp));

  /* Processing variable lend */
  lend_Dims[0]=n;
  capi_lend_intent |= F2PY_INTENT_IN;
  capi_lend_tmp = array_from_pyobj(NPY_INT,lend_Dims,lend_Rank,capi_lend_intent,lend_capi);
  if (capi_lend_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 7th argument `lend' of _ssrfpack.smsurf to C/Fortran array" );
  } else {
    lend = (int *)(PyArray_DATA(capi_lend_tmp));

  /* Processing variable w */
  w_Dims[0]=n;
  capi_w_intent |= F2PY_INTENT_IN;
  capi_w_tmp = array_from_pyobj(NPY_FLOAT,w_Dims,w_Rank,capi_w_intent,w_capi);
  if (capi_w_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting 10th argument `w' of _ssrfpack.smsurf to C/Fortran array" );
  } else {
    w = (float *)(PyArray_DATA(capi_w_tmp));

  /* Processing variable f */
  f_Dims[0]=n;
  capi_f_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE;
  capi_f_tmp = array_from_pyobj(NPY_FLOAT,f_Dims,f_Rank,capi_f_intent,Py_None);
  if (capi_f_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting hidden `f' of _ssrfpack.smsurf to C/Fortran array" );
  } else {
    f = (float *)(PyArray_DATA(capi_f_tmp));

  /* Processing variable grad */
  grad_Dims[0]=3,grad_Dims[1]=n;
  capi_grad_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE;
  capi_grad_tmp = array_from_pyobj(NPY_FLOAT,grad_Dims,grad_Rank,capi_grad_intent,Py_None);
  if (capi_grad_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(_ssrfpack_error,"failed in converting hidden `grad' of _ssrfpack.smsurf to C/Fortran array" );
  } else {
    grad = (float *)(PyArray_DATA(capi_grad_tmp));

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(&n,x,y,z,u,list,lptr,lend,&iflgs,sigma,w,&sm,&smtol,&gstol,&lprnt,f,grad,&ier);
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("NNi",capi_f_tmp,capi_grad_tmp,ier);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  }  /*if (capi_grad_tmp == NULL) ... else of grad*/
  /* End of cleaning variable grad */
  }  /*if (capi_f_tmp == NULL) ... else of f*/
  /* End of cleaning variable f */
  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((PyObject *)capi_lend_tmp!=lend_capi) {
    Py_XDECREF(capi_lend_tmp); }
  }  /*if (capi_lend_tmp == NULL) ... else of lend*/
  /* End of cleaning variable lend */
  if((PyObject *)capi_lptr_tmp!=lptr_capi) {
    Py_XDECREF(capi_lptr_tmp); }
  }  /*if (capi_lptr_tmp == NULL) ... else of lptr*/
  /* End of cleaning variable lptr */
  if((PyObject *)capi_list_tmp!=list_capi) {
    Py_XDECREF(capi_list_tmp); }
  }  /*if (capi_list_tmp == NULL) ... else of list*/
  /* End of cleaning variable list */
  if((PyObject *)capi_u_tmp!=u_capi) {
    Py_XDECREF(capi_u_tmp); }
  }  /*if (capi_u_tmp == NULL) ... else of u*/
  /* End of cleaning variable u */
  if((PyObject *)capi_z_tmp!=z_capi) {
    Py_XDECREF(capi_z_tmp); }
  }  /*if (capi_z_tmp == NULL) ... else of z*/
  /* End of cleaning variable z */
  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 */
  /* End of cleaning variable n */
  /* End of cleaning variable ier */
  } /*if (f2py_success) of lprnt*/
  /* End of cleaning variable lprnt */
  } /*if (f2py_success) of gstol*/
  /* End of cleaning variable gstol */
  } /*if (f2py_success) of smtol*/
  /* End of cleaning variable smtol */
  } /*if (f2py_success) of sm*/
  /* End of cleaning variable sm */
  if((PyObject *)capi_sigma_tmp!=sigma_capi) {
    Py_XDECREF(capi_sigma_tmp); }
  }  /*if (capi_sigma_tmp == NULL) ... else of sigma*/
  /* End of cleaning variable sigma */
  } /*if (f2py_success) of iflgs*/
  /* End of cleaning variable iflgs */
  if((PyObject *)capi_x_tmp!=x_capi) {
    Py_XDECREF(capi_x_tmp); }
  }  /*if (capi_x_tmp == NULL) ... else of x*/
  /* End of cleaning variable x */
/*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 smsurf *******************************/
/*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[] = {
  {"arcint",-1,{{-1}},0,(char *)F_FUNC(arcint,ARCINT),(f2py_init_func)f2py_rout__ssrfpack_arcint,doc_f2py_rout__ssrfpack_arcint},
  {"arclen",-1,{{-1}},0,(char *)F_WRAPPEDFUNC(arclen,ARCLEN),(f2py_init_func)f2py_rout__ssrfpack_arclen,doc_f2py_rout__ssrfpack_arclen},
  {"gradg",-1,{{-1}},0,(char *)F_FUNC(gradg,GRADG),(f2py_init_func)f2py_rout__ssrfpack_gradg,doc_f2py_rout__ssrfpack_gradg},
  {"gradl",-1,{{-1}},0,(char *)F_FUNC(gradl,GRADL),(f2py_init_func)f2py_rout__ssrfpack_gradl,doc_f2py_rout__ssrfpack_gradl},
  {"intrc0",-1,{{-1}},0,(char *)F_FUNC(intrc0,INTRC0),(f2py_init_func)f2py_rout__ssrfpack_intrc0,doc_f2py_rout__ssrfpack_intrc0},
  {"intrc1",-1,{{-1}},0,(char *)F_FUNC(intrc1,INTRC1),(f2py_init_func)f2py_rout__ssrfpack_intrc1,doc_f2py_rout__ssrfpack_intrc1},
  {"sgprnt",-1,{{-1}},0,(char *)F_FUNC(sgprnt,SGPRNT),(f2py_init_func)f2py_rout__ssrfpack_sgprnt,doc_f2py_rout__ssrfpack_sgprnt},
  {"smsurf",-1,{{-1}},0,(char *)F_FUNC(smsurf,SMSURF),(f2py_init_func)f2py_rout__ssrfpack_smsurf,doc_f2py_rout__ssrfpack_smsurf},

/*eof routine_defs*/
  {NULL}
};

static PyMethodDef f2py_module_methods[] = {

  {NULL,NULL}
};

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

#if PY_VERSION_HEX >= 0x03000000
#define RETVAL m
PyMODINIT_FUNC PyInit__ssrfpack(void) {
#else
#define RETVAL
PyMODINIT_FUNC init_ssrfpack(void) {
#endif
  int i;
  PyObject *m,*d, *s;
#if PY_VERSION_HEX >= 0x03000000
  m = _ssrfpack_module = PyModule_Create(&moduledef);
#else
  m = _ssrfpack_module = Py_InitModule("_ssrfpack", f2py_module_methods);
#endif
  Py_TYPE(&PyFortran_Type) = &PyType_Type;
  import_array();
  if (PyErr_Occurred())
    {PyErr_SetString(PyExc_ImportError, "can't initialize module _ssrfpack (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 '_ssrfpack' is auto-generated with f2py (version:2).\nFunctions:\n"
"  f,g,gn = arcint(p,p1,p2,f1,f2,g1,g2,sigma,g)\n"
"  arclen = arclen(p,q)\n"
"  grad,ier = gradg(x,y,z,f,list,lptr,lend,iflgs,sigma,nit,dgmax)\n"
"  g,ier = gradl(k,x,y,z,w,list,lptr,lend)\n"
"  ist,pw,ier = intrc0(plat,plon,x,y,z,w,list,lptr,lend,ist)\n"
"  ist,fp,ier = intrc1(plat,plon,x,y,z,f,list,lptr,lend,iflgs,sigma,iflgg,grad,ist)\n"
"  sgprnt(lunit,list,lptr,lend,sigma)\n"
"  f,grad,ier = smsurf(x,y,z,u,list,lptr,lend,iflgs,sigma,w,sm,smtol,gstol,lprnt)\n"
".");
  PyDict_SetItemString(d, "__doc__", s);
  _ssrfpack_error = PyErr_NewException ("_ssrfpack.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]));


    {
      extern float F_FUNC(arclen,ARCLEN)(void);
      PyObject* o = PyDict_GetItemString(d,"arclen");
      PyObject_SetAttrString(o,"_cpointer", F2PyCapsule_FromVoidPtr((void*)F_FUNC(arclen,ARCLEN),NULL));
#if PY_VERSION_HEX >= 0x03000000
      PyObject_SetAttrString(o,"__name__", PyUnicode_FromString("arclen"));
#else
      PyObject_SetAttrString(o,"__name__", PyString_FromString("arclen"));
#endif
    }
    






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

/*eof initcommonhooks*/


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

  return RETVAL;
}
#ifdef __cplusplus
}
#endif
