[SciPy-user] [f2py] hide ?

David Huard david.huard at gmail.com
Thu Apr 26 09:57:37 EDT 2007


Here are some things that could be wrong.

1. You declare a as intent(in, out), this means that a is modified in place,
ie, the subroutine does not return a value.
>>> essai.essai(a, b, KW, nx, ny, nz)
will hence return none.

2. Declare the dimension explicitely in the cf2py comments
cf2py integer dimension(nx,ny,nz), intent(in) :: b

3. If you want to hide the shape integers, you need to tell it to.
cf2py integer, intent(hide) :: nx=shape(b,0)
cf2py integer, intent(hide) :: ny=shape(b,1)
cf2py integer, intent(hide) :: nz=shape(b,2)

My advice would be to start with the plain fortran function without cf2py
comments, and add them one at a time.

David

2007/4/26, fred <fredmfp at gmail.com>:
>
> fred a écrit :
> >
> > Ok, let's talk about array now ;-)
> >
> > The following sample code fails if I use nvx arg in essai(),
> Re,
>
> Nobody can help me on this issue, please ?
>
> Cheers,
>
> --
> http://scipy.org/FredericPetit
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20070426/45111d52/attachment.html>


More information about the SciPy-User mailing list