haley@unmvax.cs.unm.edu (08/03/90)
Ok, heres an interesting one. Is this a bug or something else?
On an RS2030, RISC/OS 4.10, F772.0 :
This code works
------------------------------------------------------------------------------
program nl
implicit double precision (a,b)
namelist /fishing/ a,b
c
c defaults
c
a = 1.
b = 2.
write(6,*) 'Before a = ',a,' b = ',b
open(unit=4, file = 'name.inp', err=130)
read(4,NML=fishing,end=110,err=120)
write(6,*) 'After a = ',a,' b = ',b
close(4)
stop
110 write(*,*) 'EOF'
stop
120 write(*,*) 'error'
stop
130 write(*,*) 'error opening'
stop
end
------------------------------------------------------------------------------
with 'name.inp' having contents:
$ fishing b=1D-3 $END
We compile and execute and get
Before a = 1.000000 b = 2.000000
After a = 1.000000 b = 1.0000000E-03
Which is correct.
HOWEVER if we add one line of code putting a and b in a common.....
----------------------------------------------------------------------------
program nl
implicit double precision (a,b)
common /fish/a,b
namelist /fishing/ a,b
----------------------------------------------------------------------------
We compile and execute using the same name.inp and get
Before a = 1.000000 b = 2.000000
After a = 1.0000000E-3 b = 2.000000
So, the question is, why? Is this illegal FORTRAN in some way? Is it because
we are using double precisions (I did not check it for reals or other data
types)? Any ideas?
----------------------------------------------------------------------------
Tim Haley haley@unmvax.cs.unm.edu
Part-Time Student
Full-Time WorkerBee @Ball Systems Engineering Division
Often Confusedlilian@mips.COM (Lilian Leung) (08/14/90)
In article <1990Aug3.002936.12125@unmvax.cs.unm.edu>, haley@unmvax.cs.unm.edu writes: > > Ok, heres an interesting one. Is this a bug or something else? > ... > > HOWEVER if we add one line of code putting a and b in a common..... > ---------------------------------------------------------------------------- > program nl > implicit double precision (a,b) > common /fish/a,b > namelist /fishing/ a,b > ---------------------------------------------------------------------------- Yes, that was a bug in F772.0. Please get version F772.0A or F772.10 and try it again. This bug should be fixed in those versions already. -- UUCP: {ames,decwrl,prls,pyramid}!mips!lilian (or lilian@mips.com) DDD: 408-991-7848 Lilian Leung (or 408-720-1700, Ext. 848) USPS: MIPS Computer Systems, 930 Arques, Sunnyvale, CA 94086-3650