[daip] MODVF problem on Intel Mac

Eric Greisen egreisen at nrao.edu
Fri Jul 24 19:27:04 EDT 2009


cgm wrote:
> Hi Eric,
> 
>> Try the attached with your compiler.   I have put in tests to avoid 
>> the error and set 0's to omitted parameters (so you do not need the 2 
>> trailing 0s) and an repeat of the values actually read.  I also allow
>> blank lines and lines beginning with $ or # to be comments and I added 
>> JTRIM to deal with bad characters.
>> Let me know if this works and I will make it public.
> 
> Thanks for that.
> 
> There's a typo in that the format statement (1020) at line 632 should be
> 1010 so that the write at line 582 has something to point to.
> 
> Unfortunately this doesn't fix the problem, although it will certainly help
> in other cases.
> 
> We've found an oddity in that the value of ERRNUM is already 27 at the
> beginning of GETNUM and this is causing the problem, even though the line
> appears to be parsed correctly.  We'll have to track down where this is
> being set.  A quick kludge, setting ERRNUM=0 on entering GETNUM seems to
> "fix" the problem and it looks as though MODVF runs OK, although it may 
> be a symptom of something nastier.  Have you seen anything like this 
> before?
> We'll investigate further and let you know what we find.

I have put in the ERRNUM=0 line since it should have been in the program
anyway.  I fear that programmers have depended on compilers initializing 
variables to 0 which I think we request when we can but our rules are to 
init all variables.  Clearly not all code follows the rules until we 
trip over something.  How it could be uninitialized and yet the magic 27 
is very hard to fathom.  Unless the same memory is used over and over 
and it was once set to 27 but that seems rather unlikely.  I have 
checked for other tasks and made the init statement in a couple of 
others as well.  Tomorrow's MNJ should give a standard version.

Thanks for following up on this.

Eric Greisen




More information about the Daip mailing list