Issue 38 in f2py: power operator in array dimension

12 views
Skip to first unread message

f2...@googlecode.com

unread,
Jun 12, 2013, 8:45:27 AM6/12/13
to f2py-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 38 by Matthias...@gmail.com: power operator in array dimension
http://code.google.com/p/f2py/issues/detail?id=38

I don't know whether this is actually an f2py issue, but:

if you try to compile the following code with:

$> f2py -c -m test test.f90

subroutine array(n, A, B)
implicit none
integer n
double precision A(n,n)
double precision B(n*n) !B(n**2)
!f2py intent(in) n
!f2py intent(out) A
!f2py intent(out) B
A(:,:) = 1.0
B(:) = 2.0
print *, n
end subroutine

This code works with a multiplication in the dimension of B (i.e. B(n*n))
but it does not work with the power operator (i.e. B(n**2)). As far as I
know using the power works in common Fortran.

The error msg that I get is:

"
In function ‘f2py_rout_test_array’:
error: invalid type argument of unary ‘*’ (have ‘int’)
"

=================
What version of the product are you using? On what operating system?

I am using f2py Version: 2, numpy Version 1.6.1 Python 2.7.3 on Ubuntu 12.04


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

f2...@googlecode.com

unread,
Jun 12, 2013, 4:24:35 PM6/12/13
to f2py-...@googlegroups.com
Updates:
Status: WontFix

Comment #1 on issue 38 by pearu.peterson: power operator in array dimension
http://code.google.com/p/f2py/issues/detail?id=38

This is actually expected behavior. Namely, f2py interprets expressions in
array
dimension specifications as C expressions, not Fortran expressions.
It is a simplification that can be worked around using signature files.
Reply all
Reply to author
Forward
0 new messages