示例#1
0
PyMODINIT_FUNC initfcopy(void) {
  int i;
  PyObject *m,*d, *s;
  m = fcopy_module = Py_InitModule("fcopy", f2py_module_methods);
  PyFortran_Type.ob_type = &PyType_Type;
  import_array();
  if (PyErr_Occurred()) 
    {PyErr_SetString(PyExc_ImportError, "can't initialize module fcopy (failed to import numpy)"); return;}
  d = PyModule_GetDict(m);
  s = PyString_FromString("$Revision: $");
  PyDict_SetItemString(d, "__version__", s);
  s = PyString_FromString("This module 'fcopy' is auto-generated with f2py (version:2_3484).\nFunctions:\n"
"  fcopy(ain,n,aout)\n"
".");
  PyDict_SetItemString(d, "__doc__", s);
  fcopy_error = PyErr_NewException ("fcopy.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*)"fcopy");
#endif

}
示例#2
0
PyObject *PyInit_mvn(void) {
#else
#define RETVAL
PyMODINIT_FUNC initmvn(void) {
#endif
  int i;
  PyObject *m,*d, *s;
#if PY_VERSION_HEX >= 0x03000000
  m = mvn_module = PyModule_Create(&moduledef);
#else
  m = mvn_module = Py_InitModule("mvn", f2py_module_methods);
#endif
  Py_TYPE(&PyFortran_Type) = &PyType_Type;
  import_array();
  if (PyErr_Occurred())
    {PyErr_SetString(PyExc_ImportError, "can't initialize module mvn (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 'mvn' is auto-generated with f2py (version:2).\nFunctions:\n"
"  value,inform = mvnun(lower,upper,means,covar,maxpts=d*1000,abseps=1e-06,releps=1e-06)\n"
"  error,value,inform = mvndst(lower,upper,infin,correl,maxpts=2000,abseps=1e-06,releps=1e-06)\n"
"COMMON blocks:\n""  /dkblck/ ivls\n"".");
  PyDict_SetItemString(d, "__doc__", s);
  mvn_error = PyErr_NewException ("mvn.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*/

  F2PyDict_SetItemString(d, "dkblck", PyFortranObject_New(f2py_dkblck_def,f2py_init_dkblck));
/*eof initcommonhooks*/


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

  return RETVAL;
}
示例#3
0
PyObject *PyInit_futil(void) {
#else
#define RETVAL
PyMODINIT_FUNC initfutil(void) {
#endif
  int i;
  PyObject *m,*d, *s;
#if PY_VERSION_HEX >= 0x03000000
  m = futil_module = PyModule_Create(&moduledef);
#else
  m = futil_module = Py_InitModule("futil", f2py_module_methods);
#endif
  Py_TYPE(&PyFortran_Type) = &PyType_Type;
  import_array();
  if (PyErr_Occurred())
    {PyErr_SetString(PyExc_ImportError, "can't initialize module futil (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 'futil' is auto-generated with f2py (version:2).\nFunctions:\n"
"  arr = dqsort(arr,overwrite_arr=0)\n"
"  replist,repnum,nlist = dfreps(arr)\n"
".");
  PyDict_SetItemString(d, "__doc__", s);
  futil_error = PyErr_NewException ("futil.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*)"futil");
#endif

  return RETVAL;
}
示例#4
0
PyObject *
PyFortranObject_New(FortranDataDef* defs, f2py_void_func init) {
    int i;
    PyFortranObject *fp = NULL;
    PyObject *v = NULL;
    if (init!=NULL)                           /* Initialize F90 module objects */
        (*(init))();
    if ((fp = PyObject_New(PyFortranObject, &PyFortran_Type))==NULL) return NULL;
    if ((fp->dict = PyDict_New())==NULL) return NULL;
    fp->len = 0;
    while (defs[fp->len].name != NULL) fp->len++;
    if (fp->len == 0) goto fail;
    fp->defs = defs;
    for (i=0;i<fp->len;i++)
        if (fp->defs[i].rank == -1) {                      /* Is Fortran routine */
            v = PyFortranObject_NewAsAttr(&(fp->defs[i]));
            if (v==NULL) return NULL;
            PyDict_SetItemString(fp->dict,fp->defs[i].name,v);
        } else
            if ((fp->defs[i].data)!=NULL) { /* Is Fortran variable or array (not allocatable) */
                if (fp->defs[i].type == NPY_STRING) {
                    int n = fp->defs[i].rank-1;
                    v = PyArray_New(&PyArray_Type, n, fp->defs[i].dims.d,
                                    NPY_STRING, NULL, fp->defs[i].data, fp->defs[i].dims.d[n],
                                    NPY_FARRAY, NULL);
                }
                else {
                    v = PyArray_New(&PyArray_Type, fp->defs[i].rank, fp->defs[i].dims.d,
                                    fp->defs[i].type, NULL, fp->defs[i].data, 0, NPY_FARRAY,
                                    NULL);
                }
                if (v==NULL) return NULL;
                PyDict_SetItemString(fp->dict,fp->defs[i].name,v);
            }
    Py_XDECREF(v);
    return (PyObject *)fp;
 fail:
    Py_XDECREF(v);
    return NULL;
}
示例#5
0
PyObject *PyInit_iriFort(void) {
#else
#define RETVAL
PyMODINIT_FUNC initiriFort(void) {
#endif
  int i;
  PyObject *m,*d, *s;
#if PY_VERSION_HEX >= 0x03000000
  m = iriFort_module = PyModule_Create(&moduledef);
#else
  m = iriFort_module = Py_InitModule("iriFort", f2py_module_methods);
#endif
  Py_TYPE(&PyFortran_Type) = &PyType_Type;
  import_array();
  if (PyErr_Occurred())
    {PyErr_SetString(PyExc_ImportError, "can't initialize module iriFort (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 'iriFort' is auto-generated with f2py (version:2).\nFunctions:\n"
"  outf,oarr = iri_sub(jf,jmag,alati,along,iyyyy,mmdd,dhour,heibeg,heiend,heistp,oarr)\n"
"COMMON blocks:\n""  /block7/ d1,xkk,fp30,fp3u,fp1,fp2\n""  /block6/ hmd,nmd,hdx\n""  /block5/ enight,e(4)\n""  /block4/ hme,nme,hef\n""  /const/ umr\n""  /block2/ b0,b1,c1\n""  /block1/ hmf2,nmf2,hmf1,f1reg\n""  /block8/ hs,tnhs,xsm(4),mm(5),dti(4),mxsm\n""  /argexp/ argmax\n""  /iounit/ konsol\n""  /blo11/ b2top,tc3,itopn,alg10,hcor1\n""  /blo10/ beta,eta,delta,zeta\n""  /const1/ humr,dumr\n""  /blote/ ahh(7),ate1,stte(6),dte(5)\n""  /const2/ icalls,nmono,iyearo,idaynro,rzino,igino,ut0\n""  /block3/ hz,t,hst\n""  /qtop/ y05,h05top,qf,xnetop,xm3000,hhalf,tau\n""  /findrlat/ flon,ryear\n"".");
  PyDict_SetItemString(d, "__doc__", s);
  iriFort_error = PyErr_NewException ("iriFort.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*/

  F2PyDict_SetItemString(d, "block7", PyFortranObject_New(f2py_block7_def,f2py_init_block7));
  F2PyDict_SetItemString(d, "block6", PyFortranObject_New(f2py_block6_def,f2py_init_block6));
  F2PyDict_SetItemString(d, "block5", PyFortranObject_New(f2py_block5_def,f2py_init_block5));
  F2PyDict_SetItemString(d, "block4", PyFortranObject_New(f2py_block4_def,f2py_init_block4));
  F2PyDict_SetItemString(d, "const", PyFortranObject_New(f2py_const_def,f2py_init_const));
  F2PyDict_SetItemString(d, "block2", PyFortranObject_New(f2py_block2_def,f2py_init_block2));
  F2PyDict_SetItemString(d, "block1", PyFortranObject_New(f2py_block1_def,f2py_init_block1));
  F2PyDict_SetItemString(d, "block8", PyFortranObject_New(f2py_block8_def,f2py_init_block8));
  F2PyDict_SetItemString(d, "argexp", PyFortranObject_New(f2py_argexp_def,f2py_init_argexp));
  F2PyDict_SetItemString(d, "iounit", PyFortranObject_New(f2py_iounit_def,f2py_init_iounit));
  F2PyDict_SetItemString(d, "blo11", PyFortranObject_New(f2py_blo11_def,f2py_init_blo11));
  F2PyDict_SetItemString(d, "blo10", PyFortranObject_New(f2py_blo10_def,f2py_init_blo10));
  F2PyDict_SetItemString(d, "const1", PyFortranObject_New(f2py_const1_def,f2py_init_const1));
  F2PyDict_SetItemString(d, "blote", PyFortranObject_New(f2py_blote_def,f2py_init_blote));
  F2PyDict_SetItemString(d, "const2", PyFortranObject_New(f2py_const2_def,f2py_init_const2));
  F2PyDict_SetItemString(d, "block3", PyFortranObject_New(f2py_block3_def,f2py_init_block3));
  F2PyDict_SetItemString(d, "qtop", PyFortranObject_New(f2py_qtop_def,f2py_init_qtop));
  F2PyDict_SetItemString(d, "findrlat", PyFortranObject_New(f2py_findrlat_def,f2py_init_findrlat));
/*eof initcommonhooks*/


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

  return RETVAL;
}