Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!maverick.ksu.ksu.edu!harris.cis.ksu.edu!mac From: mac@harris.cis.ksu.edu (Myron A. Calhoun) Newsgroups: comp.lang.fortran Subject: Re: global data Summary: "Global" PARAMETERS Message-ID: <1991Jan4.165223.7212@maverick.ksu.ksu.edu> Date: 4 Jan 91 16:52:23 GMT Expires: 18 January 1991 References: <1991Jan4.022750.24875@ariel.unm.edu> Sender: news@maverick.ksu.ksu.edu (The News Guru) Distribution: usa Organization: Kansas State University, Dept. of Computing and Information Sciences Lines: 33 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. -- # Myron A. Calhoun, Ph.D. E.E.; Associate Professor (913) 539-4448 home # INTERNET: mac@cis.ksu.edu (129.130.10.2) 532-6350 work # UUCP: ...{rutgers, texbell}!ksuvax1!harry!mac 532-7353 fax # AT&T Mail: attmail!ksuvax1!mac W0PBV @ K0VAY.KS.USA.NA