Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.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, corrected Message-ID: Date: 25 Feb 91 21:21:39 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: u714092@mustang.larc.nasa.gov's message of 25 Feb 91 07:40:58 sorry, my last article got scrambled; network problems here ... here is what I meant to post; 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. >-- the method suggested by local computer folk is to have a Fortran main program call a C function which dynamically allocates an array, then calls a Fortran program. the main Fortran program is needed to get Fortran I/O and other utility code loaded and accessible run-time. 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||