Path: utzoo!attcan!uunet!wuarchive!uwm.edu!ux1.cso.uiuc.edu!hirchert From: hirchert@ux1.cso.uiuc.edu (Kurt Hirchert) Newsgroups: comp.lang.fortran Subject: Re: COMMON and SAVE statements Message-ID: <1990Aug7.141214.20334@ux1.cso.uiuc.edu> Date: 7 Aug 90 14:12:14 GMT References: <65861@lll-winken.LLNL.GOV> <1990Aug6.215727.21612@ux1.cso.uiuc.edu> <6814@vax1.acs.udel.EDU> Organization: National Center for Supercomputing Applications Lines: 22 In article <6814@vax1.acs.udel.EDU> gilmore@vax1.udel.edu (Scott Gilmore) writes: >In article <1990Aug6.215727.21612@ux1.cso.uiuc.edu> hirchert@ux1.cso.uiuc.edu (Kurt Hirchert) writes: >>Also, as someone else pointed out, if you declare your COMMON block in your >>main program, you don't need to SAVE them explicitly. > >What about BLOCK DATA subprograms? Does this implicit save behavior also >apply to them? >-- >Scott Gilmore gilmore@vax1.udel.edu >Mechanical Engineering and Center for Composite Materials, U. of Delaware No. If a variable or array in a COMMON block is initialized (through a BLOCK DATA) and not subsequently redefined, it will remain defined even if not SAVEd, but that's all. In other words, if you are using a value in COMMON as a kind of global constant, it will work, but the mere fact that you initialize a COMMON block is not enough in general to make it retain values between CALLs. (In the overlay model, this means that an unSAVEd COMMON can still be moved out to a branch overlay with the initialization of that COMMON being done each time the overlay is loaded.) -- Kurt W. Hirchert hirchert@ncsa.uiuc.edu National Center for Supercomputing Applications