[SciPy-user] f2py complex number problem

Ryan Krauss ryanlists at gmail.com
Fri Dec 9 13:27:20 CST 2005


I am trying to learn f2py and am running into a problem.  I need to
take the sin, cos, sinh, and cosh of complex numbers.  My FORTRAN is
quite rusty but this isn't working:

      subroutine test(s,out)
      double complex s, out
Cf2py intent(in) s
Cf2py intent(out) out
      out=cos(s)-cosh(s)+sin(s)-sinh(s)
      END


f2py output ends with:
test.f: In subroutine `test':
test.f:5:
         out=cos(s)-cosh(s)+sin(s)-sinh(s)
                    ^
Reference to intrinsic `COSH' at (^) invalid -- one or more arguments
have incorrect type
test.f:5:
         out=cos(s)-cosh(s)+sin(s)-sinh(s)
                                   ^
Reference to intrinsic `SINH' at (^) invalid -- one or more arguments
have incorrect type
test.f: In subroutine `test':
test.f:5:
         out=cos(s)-cosh(s)+sin(s)-sinh(s)
                    ^
Reference to intrinsic `COSH' at (^) invalid -- one or more arguments
have incorrect type
test.f:5:
         out=cos(s)-cosh(s)+sin(s)-sinh(s)
                                   ^
Reference to intrinsic `SINH' at (^) invalid -- one or more arguments
have incorrect type
error: Command "/usr/bin/g77 -Wall -fno-second-underscore -fPIC -O3
-funroll-loops -march=pentium4 -mmmx -msse2 -msse -malign-double
-fomit-frame-pointer -I/usr/include/python2.4 -I/tmp/tmppPluVK/src
-I/usr/include/python2.4 -c -c test.f -o /tmp/tmppPluVK/test.o" failed
with exit status 1


What do I need to do differently?

Ryan



More information about the SciPy-user mailing list