[Numpy-discussion] f2py with allocatable arrays
Paul Anton Letnes
Tue Jul 3 23:51:29 CDT 2012
On 4. juli 2012, at 02:23, Sturla Molden wrote:
> Den 03.07.2012 20:38, skrev Casey W. Stark:
>> Sturla, this is valid Fortran, but I agree it might just be a bad
>> idea. The Fortran 90/95 Explained book mentions this in the
>> allocatable dummy arguments section and has an example using an array
>> with allocatable, intent(out) in a subrountine. You can also see this
>> in the PDF linked from
> Ok, so it's valid Fortran 2003. I never came any longer than to Fortran
> 95 :-) Make sure any Fortran code using this have the extension .f03 --
> not .f95 or .f90 -- or it might crash horribly.
To be pedantic: to my knowledge, the common convention is .f for fixed and .f for free form source code. As is stated in the link, "..the Fortran standard itself does not define any extension..."
As one example, ifort doesn't even want to read files with the .f95 suffix. You'll have to pass it a flag stating that "yep, that's a fortran file all right".
I use the .f90 suffix everywhere, but maybe that's just me.
More information about the NumPy-Discussion