Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!unixhub!slacvm!meb From: MEB@SLACVM.SLAC.STANFORD.EDU (meb@slacvm.slac.stanford.edu) Newsgroups: comp.lang.fortran Subject: Re: Read dimension Message-ID: <91056.110541MEB@SLACVM.SLAC.STANFORD.EDU> Date: 25 Feb 91 19:05:41 GMT References: <61477@eerie.acsu.Buffalo.EDU> Organization: Stanford Linear Accelerator Center Lines: 41 In article <61477@eerie.acsu.Buffalo.EDU>, xiaofei@acsu.buffalo.edu (Xiaofei Wang) says: (that he wants to use variably dimensioned arrays without declaring specific dimensions until run time). I have little to add to preceding responses, and wouldn't have sent this this if the originator had not had "buffalo" in his email address. One of my programming "pleasures" about 20 years ago, when I was working in the Research Computing Office at Ball State Universiyt, involved the understanding and maintenance of a rather large program which we called "Buffalo," but was named something like the Multivariate Analysis of Variance and Covariance Program Package, distributed by the University of Buffalo. It dealt in a quite general fashion with the simultaneous problems of: - no dynamic storage allocation - no virtual memory - variously sized (memory/partition capacity) target machines - various numbers of variously shaped matrices, depending on number of cases, number of variables, type of analysis, etc. The programmer who installed Buffalo was required to provide a single value before compiling the MAIN (driver) program; that value was the DIMENSION of a REAL vector (nominally as large as the installation could accommodate). The same value also was coded as the first (only?) value in a COMMON block. After reading in the necessary problem-specification values, Buffalo would compute the necessary dimensions, cumulative offsets, etc., and perform the analyses with one- two-dimensional arrays that were all allocated within that single vector by calls of the sort: (in caller) CALL SUB(M,N,VEC(IOFF1),VEC(IOFF2),...) (in called) SUBROUTINE SUB(M,N,MAT1,MAT2,...) DIMENSION MAT1(M,N),MAT2(N,N) It wasn't fun to debug, but it didn't need very much. That program taught me much of what I know about FORTRAN storage allocation.