diff options
author | Alexander Heger <alexander.heger@monash.edu> | 2015-09-12 12:30:52 +1000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-10-16 11:59:53 -0600 |
commit | 81bdad0401275890d31bf2edc274fdb8e9ef950a (patch) | |
tree | bf513cbc8094029e3795b6df96eafc344bfcdf83 /numpy/f2py | |
parent | 972dbd00152aaec53369fc82913286a0f93b5ca6 (diff) | |
download | numpy-81bdad0401275890d31bf2edc274fdb8e9ef950a.tar.gz |
BUG: allow extension of common blocks in numpy.f2py
Lack of this feature resulted in the generation of incorrect *.pyf
files.
For example, the pyf file created by:
subroutine sub3 (some arguments)
real a, b, c, d
common /coeff/ a, b
common /coeff/ c, d
<do stuff>
return
end
Should contain both common statements the declaration of all four
variables a, b, c, and d.
Closes #5876.
Diffstat (limited to 'numpy/f2py')
-rwxr-xr-x | numpy/f2py/crackfortran.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py index 8c0247342..6f52a9a61 100755 --- a/numpy/f2py/crackfortran.py +++ b/numpy/f2py/crackfortran.py @@ -1372,11 +1372,8 @@ def analyzeline(m, case, line): if 'common' in groupcache[groupcounter]: commonkey = groupcache[groupcounter]['common'] for c in cl: - if c[0] in commonkey: - outmess( - 'analyzeline: previously defined common block encountered. Skipping.\n') - continue - commonkey[c[0]] = [] + if c[0] not in commonkey: + commonkey[c[0]] = [] for i in [x.strip() for x in markoutercomma(c[1]).split('@,@')]: if i: commonkey[c[0]].append(i) |