[R] Thanks to this list ....

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Thu Jul 14 12:20:10 CEST 2022

I set out to appeal to this list for help with disentangling
a bewildering anomaly that was produced by some dynamically loaded
Fortran code.

In composing an email to explain the nature of the anomaly, I *FINALLY*
spotted the loony!  I had an expression in a nested do loop:

    j = npro + (r-1)*nvym1 + s

where r and s were the indices of two of the nested loops (explicitly
declared to be integer at the start of the subroutine in question).

When I copied the foregoing expression into the email I at last noticed
that the variable "nvym1" *should* have been "nyvm1".  See the subtle
difference?  :-)

The variable nvym1 was never initialised, so it took on strange values
plucked out of RAM, I guess.  Whence the anomaly.  Once I corrected that
trivial typo, things were OK.

Thanks everybody!!! :-)


Rolf Turner

P.S. What I can't figure out (and won't waste any time trying) is
why the first four values of j were as they should have been, and things
did not go to hell in a handcart until the code got to the 5th value
of j.  I guess the computer gods were just amusing themselves at my

R. T.

Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

More information about the R-help mailing list