[f2py] callback parsing bug

Curtis Jensen cjensen@bioeng.ucsd.edu
Fri, 17 Aug 2001 11:25:32 -0700


Pearu,
I've run into a parsing problem with the callback functions.  With the
attached Fortran file, I get the following errors when using f2py (ver
2.315)

f2py mycb.f -m mycb
Reading fortran codes...
        Reading file 'mycb.f'
Post-processing...
        Block: mycb
                        Block: mycb
Traceback (innermost last):
  File "/usr/local/Python/lib/python1.5/site-packages/f2py2e/f2py2e.py",
line 249, in ?
    postlist=callcrackfortran(files,options)
  File "/usr/local/Python/lib/python1.5/site-packages/f2py2e/f2py2e.py",
line 212, in callcrackfortran
    postlist=crackfortran.crackfortran(files)
  File
"/usr/local/Python/lib/python1.5/site-packages/f2py2e/crackfortran.py",
line 1802, in crackfortran
    postlist=postcrack(grouplist[0])
  File
"/usr/local/Python/lib/python1.5/site-packages/f2py2e/crackfortran.py",
line 1094, in postcrack
    g=postcrack(g,tab=tab+'\t')
  File
"/usr/local/Python/lib/python1.5/site-packages/f2py2e/crackfortran.py",
line 1112, in postcrack
    block['body']=analyzebody(block,args,tab=tab)
  File
"/usr/local/Python/lib/python1.5/site-packages/f2py2e/crackfortran.py",
line 1227, in analyzebody
    b=postcrack(b,as,tab=tab+'\t')
  File
"/usr/local/Python/lib/python1.5/site-packages/f2py2e/crackfortran.py",
line 1112, in postcrack
    block['body']=analyzebody(block,args,tab=tab)
  File
"/usr/local/Python/lib/python1.5/site-packages/f2py2e/crackfortran.py",
line 1227, in analyzebody
    b=postcrack(b,as,tab=tab+'\t')
  File
"/usr/local/Python/lib/python1.5/site-packages/f2py2e/crackfortran.py",
line 1108, in postcrack
    block['vars']=analyzevars(block)
  File
"/usr/local/Python/lib/python1.5/site-packages/f2py2e/crackfortran.py",
line 1482, in analyzevars
    elif isstring(vars[n]):
  File
"/usr/local/Python/lib/python1.5/site-packages/f2py2e/auxfuncs.py", line
31, in isstring
    def isstring(var): return var['typespec']=='character' and (not
isexternal(var))
KeyError: typespec


However, if I comment out the "implicit none" line, then everything
works fine.  I only have trouble with the "implicit none" line when
using external functions.  I would like to keep the "implicit none"
capability.  Unfortunatly, I don't know the f2py code well enough to
find the bug for you.  
Thanks.

-- 
Curtis Jensen
cjensen@bioeng.ucsd.edu
http://www-bioeng.ucsd.edu/~cjensen/
FAX (425) 740-1451