🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.dec
Article #1723

Re: Odd performance with f77 and common variables as parameters

#1723
From: axt654
Date: Fri, 13 Jul 1990 15:28
37 lines
2551 bytes
In article <173@chara.UUCP>, don@chara.UUCP (Donald J. Barry) writes:
> Running UWS 1.31 and the associated fortran and compilers on a DS 3100, I'm
> finding it rather difficult to port a creaky fortran application over.  The
> code is roughly 6000 lines, still uses arithmetic if's, switches, etc, and
> even has a few (gasp) hollerith constants here and there.  Its fortran 77
> and compiles and runs with no problems on both Microsoft Fortran 5.1 and 
> a Univac compiler.  The problem seems to be one of passing arrays declared
> in common as arguments to subroutines (I know, it's terrible programming, but
> the trick is really needed in this case).  Specifically, I have a function
> of the sort
>       MAP(array1,array2,int,array3,array4,int2)
> where all the arrays, and sometimes one or both of the scalars is also in
> named common.  Only the arrays suffer side effects from the call.  If 
> I replace one of the scalars with a copy of it, rather than using the 
> original in common, the output changes.  I have not yet tried making
> copies of all the arrays because of the many permutations that this
> routine is used with.  
> 
> Is this a known compiler problem?  Has anyone developed any workarounds?
>    Don Barry
>    Center for High Angular Resolution Astronomy
>    Georgia State University
> -- 
> Donald J. Barry       (404) 651-2932         | don%chara@gatech.edu
> Center for High Angular Resolution Astronomy | President, Astronomical
> Georgia State University, Atlanta, GA 30303  | Society of the Atlantic

I am also using 1.31 of this compiler and don't seem to be hitting the problem. 
I declare 5 dimensional several megabyte arrays and pass subsections of lower
dimension to subroutines without problem. I can only guess that some sort of
assumption may be being made about byte-order, the PC and DS 3100 have opposite
byte order. I certainly don't think it's a compiler limitation as my arrays
are also common blocked, and the code isn't even all that ugly - how else do
you structure arrays of arrays of two dimensional objects?

Andrew Tridgell
tridge@aerodec.anu.oz.au
Technical Details
Message-ID: <2373.269de8a0@csc.anu.oz>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!munnari.oz.au!csc!axt654
References: <173@chara.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!munnari.oz.au!csc!axt654
From: axt654@csc.anu.oz
Newsgroups: comp.sys.dec
Subject: Re: Odd performance with f77 and common variables as parameters
Message-ID: <2373.269de8a0@csc.anu.oz>
Date: 13 Jul 90 15:28:32 GMT
References: <173@chara.UUCP>
Organization: Computer Services, Australian National University
Lines: 37