Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: def@charm.physics.ucsb.edu (David E. Flynt)
Subject: ********
Date: 7 Nov 1994 20:02:12 GMT	[thread overview]
Message-ID: <39m144$dpc@yuggoth.ucsb.edu> (raw)

The following piece of code yields bad (wrong sign) 
output for dcosd() and cosd() on any Alpha/AXP running 
0SF1 v2.0, but gives the correct output when run on any 
DECstation.

The problem depends on the source file 
or how the file is compiled.  For instance, the problem
goes away on the Alpha when using the "-g" flag with 
f77.  The problem also goes away when I try to reduce the
program by eliminating unrelated source lines (see test.for).

Can anybody explain this?

---------------------------cplbug.for-----------------------------------------
      program gar
c
c crg 941014
c
	IMPLICIT REAL*8 (A-H,O-Z)
c
	parameter (np=18)
c
        dimension part(2,np)
c
c Now begin fits
c
        nobs=1
        alpha1=3.5
        delta1=81.3
c
c
        ipar=3
               call motion(alpha1,delta1,
     &                      part(1,ipar),part(2,ipar))
c
	end


      subroutine motion(alpha,delta,apart,dpart)
c
      implicit real *8 (a-h,o-z)
c
	pi   = 4.d0*datan(1.d0)
        twopi=2.*pi
	pio2 = pi/2.
        pio180=pi/180.
c
        sx = dcosd(delta)
        sy = dsind(alpha) * dcosd(delta)
cq        type *,' sx ',sx
cq        type *,' sy ',sy
        sz=                 dsind(delta)
c
c
           zx=dcos(delta*pio180)
              write(*,1077)sx,zx,delta
 1077         format(' sx zx delta ',4f12.5)
c
        sx2=sx
        sy2=sy
        sz2=sz
c
	thetar= datan2( dsqrt(sx2*sx2+sy2*sy2) , sz2 )
	phir  = datan2( sy2,sx2 )
c
	tg = 0.5
	pg = -1. 
c
        px = 1. *(dcos(thetar)*dcos(phir)*tg) -(dsin(phir)*pg)
        py = 1. *(dcos(thetar)*dsin(phir)*tg) +(dcos(phir)*pg)
        pz =-1. *dsin(thetar)           *tg
c
        px2=px
        py2=py
        pz2=pz
c
        apart = -dsind(alpha)*px2 + dcosd(alpha)*py2
        dpart = 0.

        return
        end

-----------------------------end cplbug.for-----------------------------------

--------------------------------test.for---------------------------------------
	program test

	IMPLICIT REAL*8 (A-H,O-Z)
c
        alpha1=3.5
        delta1=81.3
c
	pi   = 4.d0*datan(1.d0)
        twopi=2.*pi
	pio2 = pi/2.
        pio180=pi/180.
c
	sx = dcosd(delta1)
	zx=dcos(delta1*pio180)
        write(*,1077)sx,zx,delta1
 1077   format(' sx zx d ',4f12.5)
c       
c
        end

-------------------------------end  bug.for------------------------------------
--------
David E. Flynt
UCSB




--
David E. Flynt
ucsb


             reply	other threads:[~1994-11-07 20:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-07 20:02 David E. Flynt [this message]
1994-11-07 23:43 ` ******** Steve Lionel
  -- strict thread matches above, loose matches on Subject: below --
1997-05-02  4:00 !!!!!!!!!!!!!!! hinda ann kolansky
1994-09-19 14:37 ******** Cliff Browning
1994-06-06 21:04 [ Barbara Gavin
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