Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!umich!yale!husc6!cmcl2!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.fortran Subject: Re: Fortran 77 Style Guide Message-ID: <59134@lanl.gov> Date: 4 Aug 90 02:24:17 GMT References: <348@ccrwest.UUCP> Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 39 From article <348@ccrwest.UUCP>, by desj@ccrwest.UUCP (David desJardins): > In article <59012@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >>[...] Anyway, _wherever_ you >>do it, you _should_ initialize _all_ common data. > > I find it hard to believe that you really mean this (especially as > you are writing from LANL). On Crays at least, and probably on a lot > of other machines, initialized storage is included, byte for byte, in > the executable (a.out) file. In fact, if any item in the common block > is initialized, the whole block is included. Yes, I know. It's one of the things that I've been asked to look into. I do local site analysis on SEGLDR, the loader on UNICOS. Still, I don't see why you don't want the arrays initialized. There _are_ ohter mechanisms that DATA syayements you know. For example, there is a SEGLDR directive that is _supposed_ to initialize all memory that isn't otherwise initialized to a number you can supply at load time - uninitialized data are still compressed out of the executable and the initialization is done by the startup routine (unfortunately, it's not implemented yet - another thing to "look into" - which means _I_ probably have to fix it.) > [...] If the initialization is not necessary for the > functioning of the program, it seems likely to mislead the reader, who > will probably think that the initialized value has some particular > purpose. It _does_ have a purpose. It is to prevent accidental use of meaningless data. I initialize stuff to NANs or (on the Cray) to infinity. Integers are a bit harder. Still, I want accidental use of meaningless data to stand out as clearly as possible. > [...] And, as noted above, it is probably better to initialize > large arrays in code rather than with DATA statements anyway. Yes, that's a way too. (It is, in fact what the SEGLDR directive is supposed to do.) Like I say, you should _always_ initialize your data. J. Giles