Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!uunet!deimos.cis.ksu.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxe.cso.uiuc.edu!hirchert From: hirchert@uxe.cso.uiuc.edu Newsgroups: comp.lang.fortran Subject: Re: Using RCS with Fortran Message-ID: <50500164@uxe.cso.uiuc.edu> Date: 10 Nov 89 01:31:34 GMT References: <600@caldwr.UUCP> Lines: 34 Nf-ID: #R:caldwr.UUCP:600:uxe.cso.uiuc.edu:50500164:000:1763 Nf-From: uxe.cso.uiuc.edu!hirchert Nov 9 09:04:00 1989 Richard Maine (maine@elxsi.dfrf.nasa.gov) writes: >Just put the 5 ids in 5 separate common blocks (perhaps named >something brilliant like rcs1,rcs2..rcs5) instead of trying to put them >all in the same one. Your problem is that you cannot have data statements >for one common block in multiple subroutines. The fact that you are >trying to initialize different parts of the common block in the different >routines is irrelevant. This is a very common (no pun intended) limitation >on many systems, not just the Sun. > >Of course, per ANSI standard, data statemnts for variables in common are >never legal, except in block data, which won't do you much good. The Sun >happens to allow a little more here than ANSI demands, but there are >major compilers that don't allow anything beyond the standard. > >So if you care about portability or standards, you will have to try a >whole different approach (I have no good suggestions off the top of my >head, though there are bound to be ways - as a last resort you could >make an entry in each subroutine that is called at program startup, >which would work, but is really ugly and questionable style - there's >gota be a better way than that). How about putting the initialization for common block RCSn in a block data subprogram named BDATn and putting one block data in with each subroutine? (This might be as ugly as the entry point suggestion, but it avoids the run-time overhead of all those calls.) By the way, note that the name of the variable in common block RCSn can also be RCSn. (This is one of the few cases where FORTRAN allows one name to be used for two different purposes in a single program unit.) Kurt W. Hirchert hirchert@ncsa.uiuc.edu National Center for Supercomputing Applications