Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!news.larc.nasa.gov!eagle.larc.nasa.gov!u714092 From: u714092@mustang.larc.nasa.gov (prichard devon ) Newsgroups: comp.lang.fortran Subject: Re: Read dimension Message-ID: Date: 25 Feb 91 12:40:58 GMT References: <61477@eerie.acsu.Buffalo.EDU> <1012@uncw.UUCP> Sender: news@news.larc.nasa.gov (USENET Network News) Organization: Lockheed Engineering & Sciences Co. Lines: 34 In-Reply-To: session@uncw.UUCP's message of 24 Feb 91 19:43:33 GMT In article <1012@uncw.UUCP> session@uncw.UUCP (Zack C. Sessions) writes: xiaofei@acsu.buffalo.edu (Xiaofei Wang) writes: >main program >parameter(m=10,n=5) >real a(m,n) >call subroutine(a,b) >end >I don't want to put m=10 n=5 to the program, I would like to >read into the program. so that I don't have to change program >every time. However a(m,n) has to be defined before read. >-- I am most familiar with VAX FORTRAN, but I think this applies to one of the computer gurus suggested to me to write the brunt of the code in Fortran, but the main routine in C. the C function dynamically allocates the array in the Fortran subroutine argument list, at which point its straight Fortran processing. I haven't tried this yet, but it oughta work. its definitely the simplest method for dynamic array allocation I've seen. of course, there may be funny memory conflicts due to linking Fortran and C code... -- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| | Devon Prichard "The atrocious crime of being a young | | u714092@eagle.larc.nasa.gov, man... I shall neither attempt to | | prichard@ias.larc.nasa.gov palliate nor deny." | | William Pitt, House of Commons, 1741 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||