home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!lhdsy1!jpr
- From: jpr@lhdsy1.lahabra.chevron.com (John C. Prestridge)
- Newsgroups: comp.lang.fortran
- Subject: Help for rs6k passed arrays (old fortran)?
- Message-ID: <6556@lhdsy1.lahabra.chevron.com>
- Date: 3 Sep 92 18:08:20 GMT
- Organization: Chevron, La Habra, CA
- Lines: 38
-
-
- Excuse me if this question was asked before.
-
- In some old fortran programs, the array dimension is passed to the subroutine
- with a argument size of 1, For Example:
-
- DIMENSION A(10)
- DATA A/ 10*0.0 /
- CALL ABC(A)
- .
- .
- END
- SUBROUTINE ABC(A)
- DIMENSION A(1)
- A(1) = 1.0
- A(5) = 3.1 <-- a warning is generated for each a(i) where i>1
- A(7) = 5.5 <-- a warning is generated
- A(9) = 7.4 <-- a warning is generated
- A(10)= 10.0 <-- a warning is generated
- RETURN
- END
-
- In many machines, the compilation of such a routine would not give compilation
- errors and/or warnings, but on the rs6000 a warning is given about a CONSTANT
- SUBSCRIPT IS OUT OF BOUNDS for each such occurrence in the code. In many large
- codes there are very large numbers of such occurrences. Is there some method
- to tell the compiler that the code is an earlier FORTRAN, so that such warnings
- would not be generated?
-
- Thanks for your help ... John Prestridge
- (jpr@chevron.com)
-
-
- --
- -------------------------------------------------------------------------
- John Prestridge Internet: jpr@chevron.com
- Chevron Oil Field Research Company
- P.O. Box 446, La Habra, CA 90633-0446
-