Link Python and Fortran

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Link Python and Fortran

Yi Qi
Hi:

So nice to join the group. I am a python programmer.
I wonder could anyone share with me some direction on how to link Python and Fortran. I have some oceanographic wave model written in Fortran, and I am thinking a way to wrap it into Python program I am coding. I google something called F2PY, but it is actually not very straightforward.

Many thinks in advance.

Apollo

_______________________________________________
Baypiggies mailing list
[hidden email]
To change your subscription options or unsubscribe:
http://mail.python.org/mailman/listinfo/baypiggies
Reply | Threaded
Open this post in threaded view
|

Re: Link Python and Fortran

Matthew Turk-3
Hi Apollo,

f2py is a good way to go, even though it has a learning curve.
Additionally, the 'fwrap' project that is coming out of Kurt Smith and
the Cython group is promising but not done yet.  Forthon is another
option.  In general, I would recommend f2py unless you need to
statically link your Python installation -- you can annotate the
fortran code and it will automatically generate the necessary support
code.

Good luck!

-Matt

On Tue, Mar 30, 2010 at 3:25 PM, Yi Qi <[hidden email]> wrote:

> Hi:
>
> So nice to join the group. I am a python programmer.
> I wonder could anyone share with me some direction on how to link Python and
> Fortran. I have some oceanographic wave model written in Fortran, and I am
> thinking a way to wrap it into Python program I am coding. I google
> something called F2PY, but it is actually not very straightforward.
>
> Many thinks in advance.
>
> Apollo
>
> _______________________________________________
> Baypiggies mailing list
> [hidden email]
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies
>
_______________________________________________
Baypiggies mailing list
[hidden email]
To change your subscription options or unsubscribe:
http://mail.python.org/mailman/listinfo/baypiggies
Reply | Threaded
Open this post in threaded view
|

Re: Link Python and Fortran

Brent Pedersen-2
In reply to this post by Yi Qi
On Tue, Mar 30, 2010 at 3:25 PM, Yi Qi <[hidden email]> wrote:

> Hi:
>
> So nice to join the group. I am a python programmer.
> I wonder could anyone share with me some direction on how to link Python and
> Fortran. I have some oceanographic wave model written in Fortran, and I am
> thinking a way to wrap it into Python program I am coding. I google
> something called F2PY, but it is actually not very straightforward.
>
> Many thinks in advance.
>
> Apollo
>
> _______________________________________________
> Baypiggies mailing list
> [hidden email]
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies
>

hi, i havent used it, but sounds like you could check out fwrap
http://conference.scipy.org/abstract?id=19
http://hg.cython.org/fwrap-dev/
_______________________________________________
Baypiggies mailing list
[hidden email]
To change your subscription options or unsubscribe:
http://mail.python.org/mailman/listinfo/baypiggies
Reply | Threaded
Open this post in threaded view
|

Re: Link Python and Fortran

Stephen McInerney
In reply to this post by Yi Qi
Yi,

You might like to download the Python(x,y) bundled distro of Python+Eclipse+MinGW
(with gfortran compiler) + many other libraries (NumPy etc) + documentation.
That allows wrapping Fortran for Python.
URL: http://www.pythonxy.com/

In any case, F2PY is already part of NumPy since 2007. Beyond that I know nothing about it.

Stephen



Date: Tue, 30 Mar 2010 15:25:11 -0700
From: [hidden email]
To: [hidden email]
Subject: [Baypiggies] Link Python and Fortran

Hi:

So nice to join the group. I am a python programmer.
I wonder could anyone share with me some direction on how to link Python and Fortran. I have some oceanographic wave model written in Fortran, and I am thinking a way to wrap it into Python program I am coding. I google something called F2PY, but it is actually not very straightforward.

Many thinks in advance.

Apollo


Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up now.
_______________________________________________
Baypiggies mailing list
[hidden email]
To change your subscription options or unsubscribe:
http://mail.python.org/mailman/listinfo/baypiggies