Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uxc!uxc.cso.uiuc.edu!uxg.cso.uiuc.edu!uxe.cso.uiuc.edu!hirchert From: hirchert@uxe.cso.uiuc.edu Newsgroups: comp.lang.fortran Subject: Re: Question on DATA and SAVE. Message-ID: <50500102@uxe.cso.uiuc.edu> Date: 30 Jan 89 14:16:00 GMT References: <2482@garth.UUCP> Lines: 22 Nf-ID: #R:garth.UUCP:2482:uxe.cso.uiuc.edu:50500102:000:1048 Nf-From: uxe.cso.uiuc.edu!hirchert Jan 30 08:16:00 1989 S. M. Ryan (smryan@garth.UUCP) asks >Does anyone have an opinion or knowledge of whether it is meaningful to >initialise a local variable of a subprogram with a DATA but not SAVE the >variable? It would seem the variable can become undefined on entry so that >the DATA would be ignored. I have heard of two uses: 1. Since, the variable will not become undefined on the next entry if it is not redefined on this entry, such variables can be used as "constants". This is most appropriate for table lookups or other array "constants". [BTW, the Fortran 8x draft included real array constants, so this aspect is not needed in F8x.] 2. Since the variable is guaranteed to be defined on the first entry, this may be appropriate for subprograms that are referenced only once during the execution of a program (e.g. initialization or termination logic). BTW, in the Fortran 8x draft, DATA implied SAVE, so this question would be moot in F8x. Kurt W. Hirchert hirchert@ncsa.uiuc.edu National Center for Supercomputing Applications