Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!netnews.upenn.edu!msuinfo!news From: fox@DASHER.NSCL.MSU.EDU Newsgroups: comp.lang.fortran Subject: Re: global data Message-ID: <1991Jan7.131620.27789@msuinfo.cl.msu.edu> Date: 7 Jan 91 13:14:48 GMT Sender: news@msuinfo.cl.msu.edu Distribution: usa Organization: National Superconducting Cyclotron Lab Lines: 43 In article <1991Jan4.165223.7212@maverick.ksu.ksu.edu>, mac@harris.cis.ksu.edu (Myron A. Calhoun) writes... >In article <1991Jan4.022750.24875@ariel.unm.edu> you write: >>I use PARAMETERs to specify the bounds on array indices, and >>then pass these constants along with the arrays so that the >>subprograms know how to dimension them. Of course, with one- >>dimensional arrays there's absolutely no problem (because I >>don't need to pass array bounds anyway), but multi-dimensional >>arrays can be a real pain. > >>Does anyone know how to make these PARAMETERs global so that >>subprograms have instant access to them, thereby obviating >>the need for all those arguments? Common doesn't seem to >>work on PARAMETERs. > >Routines in my large f77 programs commonly have THREE include statements: > > INCLUDE 'parameters' > INCLUDE 'declarations' > INCLUDE 'commons' > >for the global parameters, declarations, and common statements. I use >three so that additional declarations (INTEGER, DATA, etc.) can be >inserted where they belong between or following the INCLUDE's. > >I, too, would like to see a "global" PARAMETER statements, but since >FORTRAN permits separate compilations, such globals probably are just >not possible. >--Myron. >-- .. and since INCLUDE is not part of the FORTRAN-77 standard, there's no portable way to get the effect of a global parameter statement. A question to those following FORTRAN-9x.. how is this problem dealt with (if at all) in that language? Ron Ron Fox | FOX@MSUNSCL.BITNET | Where the name NSCL | FOX@CYCVAX.NSCL.MSU.EDU | goes on before Michigan State University | MSUHEP::CYCVAX::FOX | the quality East Lansing, MI 48824-1321 | | goes in. USA