Skip to content

Commit

Permalink
BUG: Fix the order of declaring variables in f2py generated code. The…
Browse files Browse the repository at this point in the history
… bug was noticable with ifort but not with gfortran.
  • Loading branch information
pearu committed May 6, 2011
1 parent 1f2e751 commit 6df2ac2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions numpy/f2py/func2subr.py
Expand Up @@ -90,7 +90,6 @@ def createfuncwrapper(rout,signature=0):
v['dimension'][i] = dn
rout['args'].extend(extra_args)
need_interface = bool(extra_args)


ret = ['']
def add(line,ret=ret):
Expand Down Expand Up @@ -141,10 +140,15 @@ def add(line,ret=ret):
if isscalar(vars[a]):
add(var2fixfortran(vars,a,f90mode=f90mode))
dumped_args.append(a)
for a in args:
if a in dumped_args: continue
if isintent_in(vars[a]):
add(var2fixfortran(vars,a,f90mode=f90mode))
dumped_args.append(a)
for a in args:
if a in dumped_args: continue
add(var2fixfortran(vars,a,f90mode=f90mode))

add(l)

if need_interface:
Expand Down

0 comments on commit 6df2ac2

Please sign in to comment.