[f2py] Allocatable Arrays In Output...

Andrea Gavana andrea.gavana at gmail.com
Fri Apr 7 11:48:05 EEST 2006


Hello NG,

    I am fighting against the possibility to have allocatable arrays as
outputs. Basically, what I do is:

subroutine MySub(N, MyInput, MyOutput)

    integer(N), intent(in) :: Input
    real(4), allocatable, intent(out) :: MyOutput

    ! So some processing on a file to get NOUT = size(MyOutput)

    ! Allocate the output vector
    allocate(MyOutput(NOUT))

    ! Fill the output vector by reading data from a file
    read(iunit) MyOutput

    close(1)
    return

end subroutine MySub

Well, Python always returns me the error message:

array_from_pyobj:intent(hide) must have defined dimensions.
rank=1 dimensions=[ -1 ]
<snip>
_opt.error: failed in converting hidden `MyOutput' of _opt.solve to
C/Fortran array

Is there a way I can have an allocatable array as output? This is :
- Intel Visual Fortran 9.0 (I also have Compaq 6.5)
- Windows XP
- Python 2.3.5
- f2py 2.45.241_1926

Thank you very much for your suggestions.

Andrea.

--
"Imagination Is The Only Weapon In The War Against Reality."

http://xoomer.virgilio.it/infinity77/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cens.ioc.ee/pipermail/f2py-users/attachments/20060407/40c114f9/attachment.html


More information about the f2py-users mailing list