Re: [f2py] integers = 2226756?

[email protected] Thu, 24 Mar 2011 06:26:06 +0000
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
This is strange. I'm not able to reproduce it with gfortran=4:4.5.2-2  
python-numpy=1:1.4.1-5 in Debian. It can put in int8-int64 without  
problems. What compiler are you using? What version of f2py? It might be  
worthwhile looking at the automatically generated C code (what you get  
running f2py without -c) to see what's happening.
The "f2py_rout_test_test" in particular would be of interest.

Kevin

On , Michael Colonno <mcolonno-FGKo4X94FMn2fBVCVOL8/[email protected]> wrote:

> Hi ~

> I have what I hope is a very simple issue with integers. My extremely  
> simple F90 code:

> subroutine test(N)

> implicit none

> !f2py integer, intent(in) :: N
> integer :: N

> print *, "N = ", N

> end subroutine

> I compile this with F2PY and get in Python:

> >>> import test
> >>> test.test(13)
> N = 2226756
> >>> N = 7
> >>> test.test(N)
> N = 2226756

> I get the same value for any value I input. If I change the argument N to  
> a real, I get the correct value. Is there some kind of incompatibility  
> re: integers from Python? Please let me know if I'm going crazy.

> Thanks,
> ~Mike C.

_______________________________________________
f2py-users mailing list
f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
http://cens.ioc.ee/mailman/listinfo/f2py-users