[f2py] line length

Al Niessner Al.Niessner at jpl.nasa.gov
Mon Aug 9 23:16:02 EEST 2010


I am going to pretend this is a bug because it happens with all f90 code
too. Here is my command (source attached):

f2py -c kinds.f90 constants.f90 checks.f90 
<...snip...>
Reading fortran codes...
	Reading file 'kinds.f90' (format:free)
	Reading file 'constants.f90' (format:free)
	Reading file 'checks.f90' (format:free)
<...snip...>
get_parameters: got "unexpected EOF while parsing (<string>, line 1)" on
'6.283185307179586476925286766559005768394_pr'
In: :untitled:constants.f90:constants
get_parameters: got "unexpected EOF while parsing (<string>, line 1)" on
'3.141592653589793238462643383279502884197_pr'
In: :untitled:constants.f90:constants
get_parameters: got "unexpected EOF while parsing (<string>, line 1)" on
'1.570796326794896619231321691639751442099_pr'
In: :untitled:constants.f90:constants
<...snip...>

Since they are marked as format::free, I would not expect these errors.

On Mon, 2010-08-09 at 12:50 -0700, Pearu Peterson wrote:
> On Mon, Aug 9, 2010 at 7:02 PM, Al Niessner <Al.Niessner at jpl.nasa.gov> wrote:
> >
> > I get a lot of these messages:
> >
> > get_parameters: got "EOL while scanning string literal (<string>, line
> > 1)" on 'kind("(1e0'
> 
> This may also indicate a bug. If telling f2py that the file is in free format
> (see below) does not eliminate these messages, send me an example file
> that reproduces this issue.
> 
> > I can tell gfortran to allow more than 72 characters with
> > -ffixed-line-length-none. However, I have not seen a switch in the f2py
> > for that layer. Am I missing it or is there a better way to signal f2py
> > to ignore the fixed format?
> 
> Here are two ways to tell f2py that the Fortran source is in free format:
> 
> 1) Add the following line
> 
> ! -*- f90 -*-
> 
> as the first line of .f file.
> 
> 2) or rename .f files to .f90 files.
> 
> HTH,
> Pearu
> 
> _______________________________________________
> f2py-users mailing list
> f2py-users at cens.ioc.ee
> http://cens.ioc.ee/mailman/listinfo/f2py-users

-- 
Al Niessner
818.354.0859

--------
|  dS  | >= 0
--------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: checks.f90
Type: text/x-fortran
Size: 582 bytes
Desc: not available
Url : http://cens.ioc.ee/pipermail/f2py-users/attachments/20100809/ef92a3bb/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: constants.f90
Type: text/x-fortran
Size: 371 bytes
Desc: not available
Url : http://cens.ioc.ee/pipermail/f2py-users/attachments/20100809/ef92a3bb/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kinds.f90
Type: text/x-fortran
Size: 174 bytes
Desc: not available
Url : http://cens.ioc.ee/pipermail/f2py-users/attachments/20100809/ef92a3bb/attachment-0002.bin 


More information about the f2py-users mailing list