From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e7db62ae55f7ab54 X-Google-Attributes: gidfee84,public X-Google-Thread: 1164f8,e7db62ae55f7ab54 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-08-02 01:54:38 PST Path: bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!godot.cc.duq.edu!news.duke.edu!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!swrinde!news.uh.edu!uhibpd.phys.uh.edu!t-mas From: t-mas@uhibpd.phys.uh.edu (Thomas Wright Sysop. UHIBPD) Newsgroups: comp.unix.osf.osf1,comp.sys.dec Subject: Re: Possible Alpha f77 Problem Date: 2 Aug 1994 06:08:11 GMT Organization: UHIBPD University of Houston Message-ID: <31knsb$40g@masala.cc.uh.edu> References: <31gt09$i8d@umigw.miami.edu> NNTP-Posting-Host: uhibpd.phys.uh.edu Xref: bga.com comp.unix.osf.osf1:2830 comp.sys.dec:4775 In article <31gt09$i8d@umigw.miami.edu>, todd spindler 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...