Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!seismo!ukma!morgan From: morgan@ms.uky.edu (Wes Morgan) Newsgroups: comp.lang.fortran Subject: Strange EQUIVALENCES and data inits Keywords: VAX FORTRAN --> UNIX F77 Message-ID: <14121@s.ms.uky.edu> Date: 12 Feb 90 20:02:49 GMT Organization: U of Ky, Math. Sciences, Lexington KY Lines: 45 I am attempting to port the PD MATLAB package to a 3B20 with f77. The following chunk of code refuses to compile: DOUBLE PRECISION MASK(14),XX,MM real mas(2,14) equivalence (mask(1),mas(1)) data mas/ $ z'ffffffff',z'fff0ffff', $ z'ffffffff',z'ff00ffff', $ z'ffffffff',z'f000ffff', $ z'ffffffff',z'0000ffff', $ z'ffffffff',z'0000fff0', $ z'ffffffff',z'0000ff00', $ z'ffffffff',z'0000f000', $ z'ffffffff',z'00000000', $ z'fff0ffff',z'00000000', $ z'ff00ffff',z'00000000', $ z'f000ffff',z'00000000', $ z'0000ffff',z'00000000', $ z'0000fff0',z'00000000', $ z'0000ff80',z'00000000'/ My errors have been "initializing noncharacter datum with a character string" and "invalid types in initialization". It would appear that the original author is trying to force bit patterns into a real array. My first attempt was to change the equivalence args to (mask(1),mas(1,1)); that crashed and burned. My second thought was to redefine mas as character*32, rather than real. That, too, bit the dirt. Could some fortran wizard out there kindly fill me in on a) What the author is *really* attempting to do here, and b) How to make the f77 compiler swallow this mess? Many thanks, Wes Morgan -- The opinions expressed above are not those of UKECC unless so noted. Wes Morgan \ {rutgers,rayssd,uunet}!ukma!ukecc!morgan University of Kentucky \ or morgan@engr.uky.edu Engineering Computing Center \ or morgan%engr.uky.edu@UKMA.BITNET