Path: utzoo!utgpu!water!watmath!clyde!ho95e!wcs
From: wcs@ho95e.ATT.COM (Bill.Stewart)
Newsgroups: comp.sys.hp
Subject: Re: HP Fortran problems
Message-ID: <1921@ho95e.ATT.COM>
Date: 12 Dec 87 20:59:56 GMT
References: <429@auvax.UUCP> <370006@hpunsca.HP.COM>
Reply-To: wcs@ho95e.UUCP (46133-Bill.Stewart,2G218,x0705,)
Organization: AT&T Bell Labs 46133, Holmdel, NJ
Lines: 36

:>I would like to install a very large astronomical image processing
:>system on an HP9000 series 500 workstation. The image processing
:>system's code is largely written in F66 style and contains many
:>coding gems of the form
:>    REAL TEST
:>    DATA TEST/'ABCD'/
:>i.e. it uses the old F66 way of storing character data.  [...........]
:> Therefore HP's compiler is clearly not upwardly compatible with f66 code.
	No, you're wrong there.  The problem is that the code you're
working with is  incompatible with the Fortran  66 standard; it's
something  that probably  worked  on an  IBM  360/370.  Since  F66
doesn't  support character  data types,  Hollerith data  could be
stored in  integers, normally  INT*4 holding 4  characters, since
this is what works best on an IBM.  Even that was non-portable (if
you moved binary  data to a machine with a  different byte order,
it might get scrambled.)  If you use REAL, you're much more likely
to lose (does  REAL default to REAL*4 or REAL*8?  IEEE? Are REALs
handled by the CPU or a separate Floating Point Unit?)

One of my co-workers is translating some code that ran on a
Harris machine with 24-bit integers, and the orginal authors
took advantage(?) of the benefits (?) of packing 3 characters
to an INT*3.  You're lucky it's at least REAL*4.


In article <370006@hpunsca.HP.COM> chuck@hpunsca.HP.COM (Chuck Munro) writes:
:	REAL TEST
:	DATA TEST/4hABCD/      !  Simply edit this statement

If you're lucky, this will work.  Just don't do anything that assumes
anything special about the order the bytes are stored in (e.g. if TEST2
contains 4hEFGH, don't assume the D and E are adjacent, and don't use
any EQUIVALENCE statements is you care which bytes are first.)
-- 
#				Thanks;
# Bill Stewart, AT&T Bell Labs 2G218, Holmdel NJ 1-201-949-0705 ihnp4!ho95c!wcs