[Numpy-discussion] Attempting to wrap a Fortran-77 subroutine using f2py but I haven't been able to understand what is causing the error

Samuel Dupree sdupree at speakeasy.net
Mon Oct 19 12:03:13 EDT 2020


Melissa,

Thank you for answering my post. I made the changes you recommended and 
the code compiles successfully. But I do have one question. The arrays 
being passed in the CALL to FCN were treated as assumed shaped arrays in 
the called subroutine. Are assumed shaped arrays a problem for f2py?

Sam Dupree.


On October/19/2020 09:16:02, Melissa Mendonça wrote:
> Hello, Sam, sorry for taking so long to answer!
>
> The problem seems to be that you are using
>
> cf2py depend(in) Y, YP
>
> instead of
>
> cf2py depend(n) Y, YP <- (note that there was a spurious i in that 
> depend expression)
>
> and that the callback FCN needs the dimension n as an argument. I was 
> able to compile your code correctly after making these changes.
>
> If you have any further questions let me know, I hope this helps.
>
> Cheers,
>
> Melissa
>
>
> On Wed, Oct 14, 2020 at 4:03 AM Samuel Dupree <sdupree at speakeasy.net 
> <mailto:sdupree at speakeasy.net>> wrote:
>
>     I'm attempting to wrap a Fortran-77 source member using f2py. I'm
>     running he Anaconda distribution for Python 3.7.6 on a Mac Pro (2019)
>     under Mac OS X Catalina (ver. 10.15.6). The version of NumPy I'm
>     running
>     is 1.18.3.
>
>     I've attached a copy of the Fortran source code to this note (see
>     rkfn78.for). The command I'm using to wrap this code is
>
>     f2py3 -c rkfn78.for --fcompiler=gfortran --f77flags="-c -O -Wall"
>     -m rkfn78
>
>     The output I get is captured in the file rkfn78_build_output.txt.
>
>     I don't understand the cause behind the error message I get, so any
>     advice would be welcomed.
>
>     Sam Dupree.
>     _______________________________________________
>     NumPy-Discussion mailing list
>     NumPy-Discussion at python.org <mailto:NumPy-Discussion at python.org>
>     https://mail.python.org/mailman/listinfo/numpy-discussion
>     <https://mail.python.org/mailman/listinfo/numpy-discussion>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
-- 
mail-signature
------------------------------------------------------------------------

<IYA-2009.jpg>
<mmb_emblem-2.gif>   Samuel H. Dupree, Jr.sdupree at speakeasy.net
    10501 Rising Ridge Road
    Apartment 201 http://users.speakeasy.net/~sdupree/
    Fredericksburg, VA 22407, USA

     HOME: 540-693-1240            iPhone: 215-530-8753         FAX: 
866-514-9629

/          "The Greatest Show on Earth" is not on Earth. It's in Space!/

------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20201019/f5525e62/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IYA-2009.jpg
Type: image/jpeg
Size: 10005 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20201019/f5525e62/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mmb_emblem-2.gif
Type: image/gif
Size: 3793 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20201019/f5525e62/attachment-0001.gif>


More information about the NumPy-Discussion mailing list