Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!strath-cs!expya!exua!JRowe From: JRowe@exua.exeter.ac.uk (John Rowe) Newsgroups: comp.lang.fortran Subject: Re: beyond the debate.....HELP!!! (and my opinions...) Message-ID: Date: 5 Dec 90 02:14:18 GMT References: <48577@eerie.acsu.Buffalo.EDU> Sender: JRowe@exua.exeter.ac.uk Organization: Computer Unit. - University of Exeter. UK Lines: 30 In-reply-to: JRowe@exua.exeter.ac.uk's message of 4 Dec 90 17:47:18 GMT Re changing your subroutine to accept values from a two dimensional array. Oops! In my hurry to leave to get somewhere I forgot two minor points: First, obvious I know, but if you change the way you store an array in your subroutine it will work fine only if you also change anything else it calls as well, and anything associated with the array (ie anything equivalenced). Second, if you do this you may as well move the goal posts and make the array in your subprogram two dimensional, ie go from: FUNCTION FRED (ARRAY) to: FUNCTION FRED2(ARRAY2,MLOCAL) REAL ARRAY(N) REAL ARRAY2(MLOCAL,N) When the array is really one dimensional make MLOCAL 1, when it's two dimensional make MLOCAL it's first dimension. Then replace references to ARRAY(K) by ARRAY2(1,K). This is then entirely equivalent to my previous example and is called like this: RESULT = FRED2(A(J,1),M) which passes the Jth column of A to FRED2. Looks nicer and is preferable but _still_ messes up the way your data is stored and will still probably run slower. It all comes down to "IMHO, No, you can't do it, what you sugested was best." John Rowe Today's Corny moral: Never post when you're in a hurry to get somewhere. Brought to you by Super Global Mega Corp .com