Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!rutgers!njin!princeton!phoenix!pucc!BVAUGHAN From: BVAUGHAN@pucc.Princeton.EDU (Barbara Vaughan) Newsgroups: comp.lang.fortran Subject: Re: Question on DATA and SAVE. Message-ID: <7019@pucc.Princeton.EDU> Date: 30 Jan 89 22:24:29 GMT References: <2482@garth.UUCP> Reply-To: BVAUGHAN@pucc.Princeton.EDU Organization: Princeton University, NJ Lines: 18 Disclaimer: Author bears full responsibility for contents of this article In article <2482@garth.UUCP>, smryan@garth.UUCP (s m ryan) writes: >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. Back in the old days, pre F77, some Fortran compilers caused reinitial- ization of local variables; others didn't. SAVE was not part of the Fortran vocabulary. Even now, some F77 compilers allow you to specify as a compile option that local variables should automatically be saved, in which case the SAVE statement need not be used. If you want to know why an existing program might have this peculiarity, I hope this answer helps. If you want to know whether a reasonable person would write code like this, the answer is 'no'. Barbara Vaughan