Re: [f2py] line length
Al Niessner <[email protected]> Wed, 11 Aug 2010 10:44:42 -0700
| Newsgroups | gmane.comp.python.f2py.user |
|---|---|
| Message-ID | <[email protected]> |
Here it is. I use this command f2py -c kinds.f90 mathsub.f -m mathsub Then when I 'import mathsub' I get the missing _rng symbol. Enjoy. On Tue, 2010-08-10 at 21:56 -0700, Pearu Peterson wrote: > On Wed, Aug 11, 2010 at 12:48 AM, Al Niessner <[email protected]> wrote: > > > > rng is defined as 'REAL(pr) FUNCTION RNG(nts_in)' in mathsub.f. So, in > > the process of debugging this, I created another small test with RNG in > > checks.f90 that you already have. I could not get it to compile -- yes I > > did a 'use kinds' in the checks module -- until I mad it REAL(8) > > FUNCTION RNG(nts_in)'. I can send you the example if you want, but I am > > pretty sure this is an f2py thing. > > Yes, I always look forward for receiving minimal but complete examples > that demonstrate f2py bugs. > > Pearu > > _______________________________________________ > f2py-users mailing list > f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] > http://cens.ioc.ee/mailman/listinfo/f2py-users -- Al Niessner 818.354.0859 -------- | dS | >= 0 -------- _______________________________________________ f2py-users mailing list f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] http://cens.ioc.ee/mailman/listinfo/f2py-users
kinds.f90
(text/x-fortran, 174 B)
MODULE Kinds INTEGER, PARAMETER :: dp = KIND( 1.0d0 ) ! Double precision, real INTEGER, PARAMETER :: pr = dp ! Default precision, real END MODULE Kinds
mathsub.f
(text/x-fortran, 771 B)
MODULE math_mod
USE Kinds
IMPLICIT NONE
CONTAINS
REAL(pr) FUNCTION RNG(nts_in)
IMPLICIT NONE
INTEGER, INTENT(IN) :: nts_in(2)
REAL(pr), PARAMETER :: base1 = 32717e0_pr,
& base2 = 32713e0_pr,
& magic = 3125e0_pr
INTEGER, PARAMETER :: ibase1 = 32717,
& ibase2 = 32713
INTEGER :: k,nts(2)
REAL(pr) :: x
! - - - - - - - - - - - - - - - - - - - - - - - - -
nts = nts_in
x = REAL(nts(1),KIND=pr)*magic
k = INT(x/base1)
RNG = REAL(k,KIND=pr)/32768e0_pr
END FUNCTION RNG
END MODULE math_mod