home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / fortran / 3409 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  1.7 KB

  1. Path: sparky!uunet!lhdsy1!jpr
  2. From: jpr@lhdsy1.lahabra.chevron.com (John C. Prestridge)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Help for rs6k passed arrays (old fortran)?
  5. Message-ID: <6556@lhdsy1.lahabra.chevron.com>
  6. Date: 3 Sep 92 18:08:20 GMT
  7. Organization: Chevron, La Habra, CA
  8. Lines: 38
  9.  
  10.  
  11. Excuse me if this question was asked before.
  12.  
  13. In some old fortran programs, the array dimension is passed to the subroutine
  14. with a argument size of 1,   For Example:
  15.                 
  16.        DIMENSION A(10)
  17.        DATA A/ 10*0.0 /
  18.        CALL ABC(A)
  19.        .
  20.        .
  21.        END
  22.        SUBROUTINE ABC(A)
  23.        DIMENSION A(1) 
  24.        A(1) =  1.0 
  25.        A(5) =  3.1         <-- a warning is generated for each a(i) where i>1
  26.        A(7) =  5.5         <-- a warning is generated
  27.        A(9) =  7.4         <-- a warning is generated
  28.        A(10)= 10.0         <-- a warning is generated
  29.        RETURN
  30.        END
  31.  
  32. In many machines, the compilation of such a routine would not give compilation
  33. errors and/or warnings, but on the rs6000 a warning is given about a CONSTANT
  34. SUBSCRIPT IS OUT OF BOUNDS for each such occurrence in the code.  In many large
  35. codes there are very large numbers of such occurrences.  Is there some method
  36. to tell the compiler that the code is an earlier FORTRAN, so that such warnings 
  37. would not be generated?    
  38.  
  39. Thanks for your help ...              John Prestridge
  40.                                       (jpr@chevron.com) 
  41.  
  42.  
  43. -- 
  44.  -------------------------------------------------------------------------
  45.    John Prestridge                           Internet:   jpr@chevron.com
  46.    Chevron Oil Field Research Company                             
  47.    P.O. Box 446, La Habra, CA 90633-0446                        
  48.