Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ames!decwrl!sdd.hp.com!ucsd!network.ucsd.edu!celit!ccrwest!desj From: desj@ccrwest.UUCP (David desJardins) Newsgroups: comp.lang.fortran Subject: Re: Fortran 77 Style Guide Message-ID: <348@ccrwest.UUCP> Date: 3 Aug 90 23:51:04 GMT References: <26B89BE1.4349@ics.uci.edu> <59012@lanl.gov> Organization: IDA Center for Communications Research Lines: 32 In article <59012@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >> 6) Initialize COMMON blocks only in BLOCK DATA subprograms. > >[...] 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. This makes it *extremely* undesirable to write code like INTEGER ARRAY(10**8) LOGICAL FLAG COMMON /FOO/ ARRAY, FLAG DATA FLAG/.FALSE./ much less to initialize the array itself. (The above is a natural thing to write if you want to initialize a table the first time it is used, but not subsequently.) Doing this causes you to discover rapidly just how much (or how little) disk space is available to you :-). For that matter, I disagree with the whole premise that arrays should be initialized. 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. And, as noted above, it is probably better to initialize large arrays in code rather than with DATA statements anyway. -- David desJardins