home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!corton!molene!brutus!molagnon
- From: molagnon@brutus.ifremer.fr (Michel Olagnon, Ifremer DITI GO, 98.22.41.44)
- Newsgroups: comp.lang.fortran
- Subject: Re: F77, array passing question, dimensions.
- Message-ID: <1992Aug27.095851.14372@molene.ifremer.fr>
- Date: 27 Aug 92 09:58:51 GMT
- References: <1992Aug26.032018.20430@news.clarkson.edu>
- Sender: news@molene.ifremer.fr
- Reply-To: molagnon@brutus.ifremer.fr
- Organization: Ifremer
- Lines: 36
-
- In article 20430@news.clarkson.edu, russell@sun.soe.clarkson.edu (David Russell) writes:
- >
- > Given an array dimensioned to lets say 10 in a calling routine,
- >and given the fact that only the first three values are needed in
- >the called routine, is there any advantage or disadvantage to
- >dimensioning the array to only 3 in the called routine.
- >
- >....
- >
- >ie. Is there any savings in time, space, performance,......
- >--
-
- Many of the Fortran compilers that I have known show dramatic improvement
- when I/O is performed on the array in the called routine, thus needing no
- implied do-loop.
- My programs often replace
- write (lu) (x (i), i=1, n)
- with
- call wrtsub (lu, x, n)
- ....
- end
- subroutine wrtsub (lu, x, n)
- real x (n)
- write (lu) x
- return
- end
-
- For large n, I had cutdowns by a factor of 6.
-
- Of course, another advantage may be array-bound checking in debugging the subroutine.
-
- ---
- | Michel OLAGNON | EMAIL : Michel.Olagnon@ifremer.fr |
- | IFREMER - Centre de Brest | |
- | B.P. 70 | PHONE : +33 98 22 41 44 |
- | F-29280 PLOUZANE - FRANCE | FAX : +33 98 22 41 35 |
-