pearu / f2py

Automatically exported from code.google.com/p/f2py
Other
54 stars 38 forks source link

AttributeError: 'Subroutine' object has no attribute 'is_public' and 'Function...' #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, 
thank you so much for your effort.
I observed most of all problems are removed for me.
But I still have a problem on modules.
Error message 'is_public' are shown in cases.

=============================================
What steps will reproduce the problem?

1. copy this small test program as fatest.py
------------fatest.py ---------------------------
#!/usr/bin/env python
import sys,os
#sys.path.append('/home/takao/ecal/TOOLS/f2py')
from fparser.api import parse
nargv = len(sys.argv) -1
argset= sys.argv[1:]
print argset
for ffile in argset:
    print ffile
    tree = parse(ffile,isfree=False,isstrict=False,ignore_comments=False)
    print tree.content
sys.exit()
---------------------------------------

2.run
$fatest.py m_rdctrl.F, which is included in an attached file.

Then I got
-----------------------------------
takao@takaot61:~/ecal/TEST$ ~/ecal/TOOLS/fatest.py m_rdctrl.F 
Not implemented: Defined_Binary_Op
Not implemented: Defined_Binary_Op
Defined_Operator not defined used by Generic_Spec
['m_rdctrl.F']
m_rdctrl.F
WARNING while processing 'm_rdctrl.F' (mode='fix90')..
    4:C # is commented # 1 "subs/m_rdctrl.F"
    5:      module m_rdctrl
    6:      use m_struc_def
    7:C     implicit none
    8:
    9:C ... Fixed parameters <== no information about the module
'm_struc_def' in use statement
   10:      integer,parameter:: NULLI =-99999
   11:      real(8),parameter::    NULLR =-99999
WARNING while processing 'm_rdctrl.F' (mode='fix90')..
  268:Cu   09 Aug 07
  269:C ----------------------------------------------------------------------
  270:      use m_toksw <== no information about the module 'm_toksw' in
use statement
  271:      use m_gtv
  272:C     implicit none
WARNING while processing 'm_rdctrl.F' (mode='fix90')..
  269:C ----------------------------------------------------------------------
  270:      use m_toksw
  271:      use m_gtv
  272:C     implicit none
  273:C ... Passed parameters <== no information about the module 'm_gtv'
in use statement
  274:      character*(*):: prgn
  275:      character(6):: vstrn(2)
While processing
  Line('module m_rdctrl',(5, 5),'')
with <function analyze at 0x7fec0534f578> the following exception was raised:
Traceback (most recent call last):
  File "/home/takao/ecal/TOOLS/f2py/fparser/parsefortran.py", line 86, in
analyze
    self.block.analyze()
  File "/home/takao/ecal/TOOLS/f2py/fparser/utils.py", line 191, in new_func
    func(self)
  File "/home/takao/ecal/TOOLS/f2py/fparser/block_statements.py", line 216,
in analyze
    stmt.analyze()
  File "/home/takao/ecal/TOOLS/f2py/fparser/utils.py", line 191, in new_func
    func(self)
  File "/home/takao/ecal/TOOLS/f2py/fparser/block_statements.py", line 309,
in analyze
    stmt.analyze()
  File "/home/takao/ecal/TOOLS/f2py/fparser/utils.py", line 191, in new_func
    func(self)
  File "/home/takao/ecal/TOOLS/f2py/fparser/block_statements.py", line 617,
in analyze
    if self.is_public():
AttributeError: 'Subroutine' object has no attribute 'is_public'
FATAL ERROR: STOPPED ANALYSING <closed file 'm_rdctrl.F', mode 'r' at
0x7fec05371c68> CONTENT
-----------------------------------
I also attached other *.F files which caused similer error.
Try fatest.py *.F

regards, 
takao 

Original issue reported on code.google.com by TakaoKot...@gmail.com on 6 Mar 2010 at 10:41

Attachments:

GoogleCodeExporter commented 9 years ago
I have fixed all bugs in fparser that are related to this issue.

Original comment by pearu.peterson on 7 Mar 2010 at 11:17