Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.fortran Subject: Re: Fortran vs. C for numerical work (SUMMARY) Message-ID: <4450@goanna.cs.rmit.oz.au> Date: 6 Dec 90 08:41:05 GMT References: <1990Nov21.220816.15220@rice.edu> <2173@tuvie> <1990Dec3.191100.22176@ariel.unm.edu> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 42 In article <1990Dec3.191100.22176@ariel.unm.edu>, john@ghostwheel.unm.edu (John Prentice) writes: > In article <4421@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: > >In article <1990Nov30.183032.5420@ccu.umanitoba.ca>, salomon@ccu.umanitoba.ca (Dan Salomon) writes: > >> The problem > >> was that the FORTRAN procedure accepted arrays with not only any size > >> of dimensions, but also with any number of dimensions. > >I don't recall that being legal in F77. To be sure, I've met compilers > >that didn't bother to check, and I think there was a special case for > >DATA statements, but argument passing? > Assuming I am reading the original posting correctly, there is nothing > to preclude this in Fortran. Specifically, imagine the following code: > real*8 a > pointer (a,ipnt) <======================== My question was specifically about F77, by which I meant the 1978 ANSI Fortran standard. "pointer" is not part of that language. I have seen some disgusting stuff in the Harwell library where the programmers did REAL X(N) CALL FOO(X(1), X(3), ...) and FOO used the first argument as a pointer to the beginning of an array, and the *difference* between the second argument and the first as the "stride" between array elements. That meant that you could do CALL FOO(M(I,1), M(I,2), ...) CALL FOO(M(1,I), M(2,I), ...) FOO, of course, had been coded in assembler. I had the extremely unpleasant task of trying to port a program using this stuff to a B6700, where there wasn't any assembler, nor was there any hardware support for subtracting pointers. The question stands: is passing a scalar (D=0) or an array taking D subscripts to a subprogram expecting an array taking E.ne.D subscripts legal in standard Fortran 77? -- The Marxists have merely _interpreted_ Marxism in various ways; the point, however, is to _change_ it. -- R. Hochhuth. Brought to you by Super Global Mega Corp .com