[SciPy-Dev] F2PY: failed to create intent(cache|hide)|optional array-- must have defined dimensions but got (0, )

Andreas H. lists@hilboll...
Sun Mar 11 03:45:47 CDT 2012


I know the f2py list might be more suitable for this question, but since
that mailing list doesn't seem to work with my mailaccount (strange
enough), I hope someone can help here:

I'm trying to wrap the Fortran function sphere.f from FITPACK_. However,
when I try to call the resulting function like this::


I get the following error:

   ValueError: failed to create intent(cache|hide)|optional array-- must
have defined dimensions but got (0,)

Can someone point me to what's wrong? I cannot find my mistake ...


.. _FITPACK: http://www.netlib.org/dierckx/

       !  nt,tt,np,tp,c,fp,ier = spherfit_smth(teta,phi,r,[w,s,eps])

       fortranname sphere

       integer intent(hide) :: iopt=0
       integer intent(hide),depend(teta),check(m>=2) :: m=len(teta)
       real*8 dimension(m) :: teta
       real*8 dimension(m),depend(m),check(len(phi)==m) :: phi
       real*8 dimension(m),depend(m),check(len(r)==m) :: r
       real*8 optional,dimension(m),depend(m),check(len(w)==m) :: w = 1.0
       real*8 optional,check(0.0<=s),depend(m) :: s = m
       integer intent(hide),depend(m),check(ntest>=8) :: ntest = 8+sqrt(m/2)
       integer intent(hide),depend(m),check(npest>=8) :: npest = 8+sqrt(m/2)
       real*8 optional,check(0.0<eps && eps<1.0) :: eps = 1e-16
       integer intent(out) :: nt
       real*8 dimension(nt),intent(out) :: tt
       integer intent(out) :: np
       real*8 dimension(np),intent(out) :: tp
       real*8 dimension((ntest-4)*(npest-4)),
            depend(ntest,npest),intent(out) :: c
       real*8 intent(out) :: fp
       real*8 dimension(lwrk1),intent(cache,hide),depend(lwrk1) :: wrk1
       integer intent(hide),depend(m,ntest,npest) &
            :: lwrk1=calc_spherfit_lwrk1(m,ntest,npest)
       real*8 dimension(lwrk2),intent(cache,hide),depend(lwrk2) :: wrk2
       integer intent(hide),depend(ntest,npest) &
            :: lwrk2=calc_spherfit_lwrk2(ntest,npest)
       integer dimension(kwrk),depend(kwrk),intent(cache,hide) :: iwrk
       integer intent(hide),depend(m,ntest,npest) &
            :: kwrk=m+(ntest-7)*(npest-7)
       integer intent(out) :: ier
     end subroutine spherfit_smth

More information about the SciPy-Dev mailing list