From: t-mas@uhibpd.phys.uh.edu (Thomas Wright Sysop. UHIBPD)
Subject: Re: Possible Alpha f77 Problem
Date: 2 Aug 1994 06:08:11 GMT [thread overview]
Message-ID: <31knsb$40g@masala.cc.uh.edu> (raw)
In-Reply-To: 31gt09$i8d@umigw.miami.edu
In article <31gt09$i8d@umigw.miami.edu>,
todd spindler <TSpindler@rsmas.miami.edu> wrote:
>
>I tried the following program on a Dec Alpha running OSF/1 1.3,
>Dec Fortran T3.4-451:
>
> program bogus
> real aaa /-10./
> write(*,*) 'log(-10) =', log(aaa)
> end
>
>The problem is that I don't get an error message for calculating the log
>of a negative number. Fortran simply returns the argument value, and
>prints the following line:
>
>log(-10) = -10.00000
>
>What gives? Ultrix Fortran returns an error message, as does VMS Fortran.
>Is this a bug or a feature?
>
>--
>Todd Spindler |Rosenstiel School of Marine & Atmospheric Science
>TSpindler@rsmas.miami.edu|Dept. of Meteorol & Phys Oceanography /U of Miami
>---------------------------------------------------------------------------
>Beyond the ken of mortal men, beneath the wind and waves, / Lies a land of
>shells and sand, of chasms, crags, and caves, / Where coral castles climb
>and soar, where swaying seaweeds grow, / While all around, without a sound,
>the ocean currents flow... _Sign of the Seahorse_ by Graeme Base
I have a similar yet different problem...
This program gives different results (one correct, one incorrect) on
different machines (one is a DEC 5000/200 running ULTRIX 4.2, and the other is
an DEC ALPHA AXP 3000/300x running OSF/1 v2.0) running different versions of
f77 (v3.1 on the 5000, and v3.3 on the 3000). Is this a bug in the f77 v3.3
DEC fortran compiler?
------------------------------------------------------------------------------
PROGRAM TRACK
COMMON/ABC/A(10,10),ID(2)
ID(1)=1
ID(2)=5
DO 100 I=1,2
M=ID(1)
N=ID(2)
DO 200 J=1,3
A(J,M)=1.0
WRITE(*,*) I, J, M, N, A(J,M)
A(J,N)=2.0
WRITE(*,*) I, J, M, N, A(J,M)
200 CONTINUE
100 CONTINUE
END
-------------------------------------------------------------------------------
this is the transcript on the 5000:
-------------------------------------------------------------------------------
uhibpd.phys.uh.edu> f77 track.f
uhibpd.phys.uh.edu> a.out
1 1 1 5 1.000000
1 1 1 5 1.000000
1 2 1 5 1.000000
1 2 1 5 1.000000
1 3 1 5 1.000000
1 3 1 5 1.000000
2 1 1 5 1.000000
2 1 1 5 1.000000
2 2 1 5 1.000000
2 2 1 5 1.000000
2 3 1 5 1.000000
2 3 1 5 1.000000
uhibpd.phys.uh.edu>
-------------------------------------------------------------------------------
the output is correct
this is the transcript from the 3000:
-------------------------------------------------------------------------------
UHHEP> f77 track.f
UHHEP> a.out
1 1 1 5 1.000000
1 1 1 5 2.000000
1 2 1 5 1.000000
1 2 1 5 2.000000
1 3 1 5 1.000000
1 3 1 5 2.000000
2 1 1 5 1.000000
2 1 1 5 2.000000
2 2 1 5 1.000000
2 2 1 5 2.000000
2 3 1 5 1.000000
2 3 1 5 2.000000
UHHEP>
-------------------------------------------------------------------------------
A(J,N) is overwriting A(J,M)
another trans. from the 3000:
-------------------------------------------------------------------------------
UHHEP> f77 -O track.f
UHHEP> a.out
1 1 1 5 1.000000
1 1 1 5 2.000000
1 2 1 5 1.000000
1 2 1 5 2.000000
1 3 1 5 1.000000
1 3 1 5 2.000000
2 1 1 5 1.000000
2 1 1 5 2.000000
2 2 1 5 1.000000
2 2 1 5 2.000000
2 3 1 5 1.000000
2 3 1 5 2.000000
UHHEP>
-------------------------------------------------------------------------------
still wrong...
but with -check bounds:
-------------------------------------------------------------------------------
UHHEP> f77 -check bounds track.f
UHHEP> a.out
1 1 1 5 1.000000
1 1 1 5 1.000000
1 2 1 5 1.000000
1 2 1 5 1.000000
1 3 1 5 1.000000
1 3 1 5 1.000000
2 1 1 5 1.000000
2 1 1 5 1.000000
2 2 1 5 1.000000
2 2 1 5 1.000000
2 3 1 5 1.000000
2 3 1 5 1.000000
UHHEP>
-------------------------------------------------------------------------------
the output is correct... why? And why won't it work with no options?
here, with -check all:
-------------------------------------------------------------------------------
UHHEP> f77 -check all track.f
UHHEP> a.out
1 1 1 5 1.000000
1 1 1 5 1.000000
1 2 1 5 1.000000
1 2 1 5 1.000000
1 3 1 5 1.000000
1 3 1 5 1.000000
2 1 1 5 1.000000
2 1 1 5 1.000000
2 2 1 5 1.000000
2 2 1 5 1.000000
2 3 1 5 1.000000
2 3 1 5 1.000000
UHHEP>
-------------------------------------------------------------------------------
it works too...
Any ideas?
Thomas Wright
t-mas@uhibpd.phys.uh.edu
System Administrator for UHIBPD and UHHEP... COMBINED!! (can your beer do this)
P.S. I installed DEC F77 v3.4 and the problem disappered...
next prev parent reply other threads:[~1994-08-02 6:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-07-31 19:11 Possible Alpha f77 Problem todd spindler
1994-08-01 15:43 ` Steve Lionel
1994-08-01 18:47 ` Jim Brown
1994-08-02 6:08 ` Thomas Wright Sysop. UHIBPD [this message]
1994-08-02 13:31 ` Craig Neth USG
1994-08-02 20:13 ` Thomas Wright Sysop. UHIBPD
1994-08-02 21:38 ` Craig Neth USG
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox