Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!wuarchive!ukma!psuvax1!hsdndev!cmcl2!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.fortran Subject: Re: SAVEing FORTRAN variables Message-ID: <14845@lanl.gov> Date: 15 Feb 91 19:40:40 GMT References: <1991Feb15.172635.17261@craycos.com> Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 40 From article <1991Feb15.172635.17261@craycos.com>, by pmk@craycos.com (Peter Klausler): > [...] > Variables that are initially defined with a DATA statement are static, and > don't need a SAVE statement. No. ANSI X3.9-1978, page B-5, lines 7-11: Initially defined entities in a subprogram may become undefined at the execution of a RETURN or END statement if they are assigned any value, including their initial value, during the execution of the the executable program (see 8.9 and 15.8.4). And on page 15-15, lines 1-11: 15.8.4 Definition Status. Execution of a RETURN statement (or END statement) within a subprogram causes all entities within the subprogram to become undefined, except for the following: [...] (3) Initially defined entities that have neither been redefined or become undefined. [...] The purpose appears to be to allow (at least) the following interpretations of initialized (but unSAVEd - PAGAN? :-) variables: 1) On each entry, the value is again initialized according to the DATA statement; 2) On each entry (except the first), the value is retained from the previous instantiation (as if it had been SAVEd); 3) on each entry (except the first), the value is completely unpredictable (just like any other unSAVEd variable). J. Giles