我写了一个非常简单的模块(test.f90)
module tt
implicit none
character(:),allocatable :: hh
contains
subroutine test()
implicit none
integer :: i
end subroutine
end module tt
我现在想使用f2py
.
我使用以下命令:
gfortran-9 -c test.f90 -Wall
f2py -m g -c test.f90
但我得到以下错误。这些错误似乎与可分配字符串相关,我目前无法找到删除它的解决方案。
/var/folders/fg/53phbn8n6nd3vrhm3sh_36w40000gn/T/tmpjtueazku/src.macosx-10.7-x86_64-3.6/g-f2pywrappers2.f90:25:17:
25 | allocate(d(s(1)))
| 1
Error: Shape specification for allocatable scalar at (1)
/var/folders/fg/53phbn8n6nd3vrhm3sh_36w40000gn/T/tmpjtueazku/src.macosx-10.7-x86_64-3.6/g-f2pywrappers2.f90:16:22:
16 | if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
| 1
Error: 'array' argument of 'size' intrinsic at (1) must be an array
/var/folders/fg/53phbn8n6nd3vrhm3sh_36w40000gn/T/tmpjtueazku/src.macosx-10.7-x86_64-3.6/g-f2pywrappers2.f90:29:24:
29 | s(i) = size(d,i)
| 1
Error: 'array' argument of 'size' intrinsic at (1) must be an array