Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!bionet!agate!eos!data.nas.nasa.gov!xenon.arc.nasa.gov!dueker From: dueker@xenon.arc.nasa.gov (The Code Slinger) Newsgroups: comp.lang.fortran Subject: Re: FORTRAN and (un)SAVEd vars Keywords: FORTRAN 77, SAVE Message-ID: <1991Feb28.164256.23516@nas.nasa.gov> Date: 28 Feb 91 16:22:42 GMT References: <1991Feb28.004447.3728@nas.nasa.gov> <4849@goanna.cs.rmit.oz.au> Sender: news@nas.nasa.gov Reply-To: dueker@xenon.arc.nasa.gov Organization: Computer Sciences Corp Lines: 37 News-Software: VAX/VMS VNEWS 1.3-4 ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes... >dueker@xenon.arc.nasa.gov (The Code Slinger) writes: >> Among other(!) problems, some variables in some of these routines expect to >> retain their values from invocation to invocation. This, of course, is not >> guaranteed (except maybe on certain systems). >> >> We'd like to find out if anybody knows of a program that will process >> FORTRAN 77 code and determine if any of the variables in a given subroutine >> should be SAVEd. > >If your concern is just to get the code running, why not just SAVE >*all* the variables? Well, we'd thought of that, but a high percentage of these routines have many, many variables, and we are concerned about efficiency. Also, we did manage to find one variable that never had an initial value (including not having a DATA statement for it!). So, at least in that particular case, a SAVE statement would not have helped. Also, one person e-mailed me about a software package that is much like a lint program for FORTRAN code. We've seen that, and even had the opportunity to "test-drive" it for a short while. At the time, we were just interested in a call-tree, and found that the package saw non-existent subroutine calls. For example, the string 'CALL' was in a FORMAT statement, and the lint program thought that was a subroutine call, and extracted a VERY strange subroutine name from the format specs following it. Chris ------------------------------------------------------------------------ "Ah, Benson, you are so mercifully free of the ravages of intellegence!" "Oh, thank you, Master!" - from the movie, TIME BANDITS ------------------------------------------------------------------------ dueker@xenon.arc.nasa.gov | Chris Dueker (The Code Slinger) duke@well.sf.ca.us | Mtn. View, CA (Sillycon Valley!)