f2py

    0热度

    1回答

    我有一个子程序,我在Fortran中编写与f2py编译和编译失败。我不会在这里发布完整的子程序但MWE是: SUBROUTINE mwe(Vars, nxc, nyc, vCorr) IMPLICIT NONE real(kind=8), dimension(:,:,:,:) :: Vars integer :: nxc, nyc integer :: dims(4), nv, nt, n

    1热度

    1回答

    如果我打算将一个布尔型的NumPy数组与f2py一起传递给Fortran变量,应该如何输入?我已尝试integer*1和logical*1,但这些都表明数组已被复制。 例如,如果我编译文件,foo.f95,包含: subroutine foo(x, n) logical*1 x(n) !f2py intent(in) x !f2py intent(hide), dep

    2热度

    1回答

    我想用F2PY来包装一个以函数和假定形状数组为参数的fortran子程序。这会导致错误。我正在使用GNU Fortran(GCC)4.8.5 20150623(Red Hat 4.8.5-11)和F2PY版本2与Scientific Linux 7.3。 一个最小的例子是一个文件“callback.f90”: !file callback.f90 subroutine sub(arr,func)

    1热度

    1回答

    我想用f2py编译一个fortran模块。这是下面的代码 module my_log_mod implicit none interface my_log module procedure my_log_array module procedure my_log_vector end interface my_log priva

    0热度

    1回答

    我想在我的系统中使用f2py安装一些Python模块,这些模块与海洋模型(在Fortran 90中)有关。我正面临f2py的一些问题。具体而言,即使我安装了所需的库和包含文件,f2py也无法与NetCDF库链接。我在64位机器上的Ubuntu16.04上使用Python 2.7与Anaconda 2。我正在使用gfortran。 为了测试它的工作情况,我编写了一个小代码 - 一个包含一个小子程序的

    0热度

    1回答

    f2py为了建立使用python2 f2py扩展模块,我一直在使用一个Makefile类似于: default: fortran_lib.so %.so:: %.f90 f2py -c -m $* $< 为了完整起见,这里也是一个虚拟fortran_lib.f90文件 subroutine square(d) implicit none !f2py intent(inout)

    0热度

    1回答

    说我有一个模块通过f2py编译负指数编译: test.f90 module test implicit none integer, parameter :: q = 2 real(8), parameter, dimension(-q:q) :: vec = (/ 1, 2, 3, 4, 5 /) contains subroutine writevec() write(

    0热度

    1回答

    我正在运行OpenSuse 42.3,并且我使用pip install numpy安装了numpy 1.13.1。 我运行命令: f2py -c PDFF.f -m PDFF 我得到的错误: 错误:文件 '/usr/lib64/python2.7/site-packages/numpy/f2py/src/fortranobject.c' 不不存在 如果我在该目录上执行了ls,则在f2py的/

    0热度

    1回答

    我在包装一些Fortran子程序以用于python3脚本时遇到了一个问题。自从我试图在子例程中使用OpenMP后,此问题才出现。 例如,如果我使用f2py -c -m --fcompiler=gfortran --compiler=mingw32 --f90flags='-fopenmp' test test.f90 -lgomp编译模块'test.pyd',其中'test.f90'是包含并行循环

    1热度

    1回答

    我正在使用带有Python 3内核的Jupyter笔记本。 如果我运行: import scipy.optimize scipy.optimize.minimize( lambda _: 1, 0, method='COBYLA', options={'iprint': 1, 'disp': True, 'maxiter': 2}) 我期望能获得打印到I