[Ifeffit] Ifeffit 1.2.10

Matt Newville newville at cars.uchicago.edu
Wed Sep 19 22:50:20 CDT 2007


Hi Paul, Bruce,

> gfortran -g -O2 -fPIC -c misc_rand.f
> misc_rand.f:131.15:
>
>       umask = lmask + 1
>             1
> Error: Arithmetic overflow at (1)
> make[3]: *** [misc_rand.o] Error 1

Hmm, sorry to hear that.  FWIW, my understanding of the problem had been that
setting an integer *parameter* to the value -2**31 was invalid but
that evaluating
to this value was acceptable.   Perhaps if relying on overflow:
       umask = lmask + 1

didn't work, then the more explicit
      umask = -lmask - 1

or perhaps something like
       umask = -2**30
       umask = umask + umask

would work.  It's possible these attempts would be optimized away, so
it might take
trial and error to find something that works correctly with all versions.

I don't think I have a gfortran 4.2.1 available.  The  'umask = lmask
+1' approach
worked with gfortran  4.1.2,  but it did not work with 4.1.1  (where
worked = 'gives
numerically same as g77').

OTOH, using  umask = -lmask - 1   worked with both gfortran 4.1.1 and 4.1.2.
Perhaps that will work in general?

Bruce wrote:
>
> I just installed Ifeffit on my new linux machine using gfortran.  I
> ran into the same issue.  My solution (and I mean that in the sense of
> getting past the road block -- I have no idea if I did the right thing
> algorithmically) was to uncomment the definition of the umask variable
> and change the trailing digit from 8 to 7.  I also commented out the
> line with:
>
>       umask = lmask + 1
>
> Things compiled and seem to work.

My understanding is that it really needs to be -2**31, as it's doing bit
operations.  A quick test shows that these give very different results
(if you're
testing, the differences don't show up until  1000 or so numbers).  I'm not
sure we'd notice, but I'd rather use it as intended.

--Matt



More information about the Ifeffit mailing list