Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!alberta!mts.ucs.UAlberta.CA!Al_Dunbar From: userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) Newsgroups: comp.lang.fortran Subject: Re: Read dimension Message-ID: Date: 26 Feb 91 04:10:18 GMT References: <61477@eerie.acsu.Buffalo.EDU> <1012@uncw.UUCP> Organization: MTS Univ of Alberta Lines: 36 In article , u714092@mustang.larc.nasa.gov (prichard devon ) writes: >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... > Only thing wrong with this that I can see is the flame you are going to get from Bill Silvert on the "expensive functionality" of this approach. -------------------+------------------------------------------- Al Dunbar | Edmonton, Alberta | Disclaimer: "I disclaim disclaimers" CANADA | -------------------+-------------------------------------------