home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!nih-csl.dcrt.nih.gov!helix.nih.gov!rvenable
- From: rvenable@helix.nih.gov (Richard M. Venable)
- Subject: Re: Dimensioning arrays passed in a parameter list.
- Message-ID: <1992Nov8.021607.16636@alw.nih.gov>
- Sender: postman@alw.nih.gov (AMDS Postmaster)
- Organization: National Institutes of Health, Bethesda
- References: <1992Nov7.160034.6836@netcom.com>
- Date: Sun, 8 Nov 1992 02:16:07 GMT
- Lines: 44
-
- In article <1992Nov7.160034.6836@netcom.com> jchauvin@netcom.com (John H. Chauvin) writes:
- >
- >I am currently porting a FORTRAN 66 program from an IBM 3090 to a Silicon
- >Graphics workstation. Can someone tell me the correct FORTRAN 77 procedure
- >for dimensioning arrays passed in a call parameter list: For example:
- >
- >. DIMENSION A(50),B(50)
- > .
- > .
- > .
- > .
- > CALL XYZ(A,B)
- > .
- > .
- >
- > SUBROUTINE XYZ(A,B)
- > DIMENSION A(1),B(1) <====== Is this correct?
- > DIMENSION A(*),B(*) <====== Or Is this right?
- > .
- > .
- >
- >
- >How do I handle passing two or three dimensional arrays? (A(1,1,1) or A(*,*,*)?)
-
- Most implementations I've seen support using the '*', but only for the last
- dimension. Another way to deal with that problem is to pass the dimensions
- of array arguments as additional arguments:
-
- CALL XYZ(N,A,B)
- :
- :
- SUBROUTINE XYZ(N,A,B)
- DIMENSION A(N,*), B(N)
-
- Note that only arrays passed as arguments may be dimensioned in this way, and
- not other arrays in the subroutine.
-
-
- <---------------------------------------------------------------------->
- < Rick Venable (O O) | "Back off, I'm a scientist." >
- < FDA/CBER Biophysics Lab )|( | -- Bill Murray in >
- < rvenable@helix.nih.gov (=) | 'Ghostbusters' >
- <---------------------------------------------------------------------->
-
-