home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!giaeb!simon
- From: simon@giaec.cc.monash.edu.au (simon shields)
- Subject: dynamic arrays in fortran
- Message-ID: <simon.712365484@giaeb>
- Keywords: f77,HP-UX,720
- Sender: news@monu6.cc.monash.edu.au (Usenet system)
- Organization: Monash University, Melb., Australia.
- Date: Tue, 28 Jul 1992 23:18:04 GMT
- Lines: 81
-
- SYSTEM: HP-UX giaec A.08.07 A 9000/720 2001133857
- Hi Thanks for all the replies on my question concerning adjustable
- arrays.
-
- They all basically told me that the compiler was right because
- adjustable arrays will only work if the array with its size are sent
- as a parameter. i.e.
-
- integer siz
- parameter (siz=100)
- real arr(siz)
- call adj_arrays(arr,siz)
- ..
- ..
- subroutine adj_arrays(arr,siz)
- integer siz
- parameter (siz=100)
- real arr(siz)
-
- In the hp manual page 2-31 it has a paragraph titled "Dynamic Arrays"
- it says quote
- "An array that is a nonstatic local variable is called a dynamic
- array. For a dynamic array sorage is allocated by the current
- subprogram dynamically on the stack. This dynamic array feature is
- an HP extension to the ANSI 77 standard..."
-
- then it gives the example
-
-
- program main
- i=10
- call routine (i)
- end
-
- subroutine routine (i)
- integer dyn_array(i)
- dyn_array(i)=i
- end
-
- I tried this, it produced
- eg.f:
- MAIN main:
- routine:
- Declaration error on/above line 10 of eg.f; for dyn_array; adjustable dimension on non-argument
-
- f77: Error. No assembly.
- f77: Errors detected, no link
-
- Which is what you'd expect for standard F77, so i tried
- $STANDARD_LEVEL SYSTEM
- program main
- i=10
- call routine (i)
- end
-
- subroutine routine (i)
- integer dyn_array(i)
- dyn_array(i)=i
- end
-
- $STANDARD_LEVEL SYSTEM - is a compiler option page 7-71
- "indicates Fortran 77 plus additional system dependent features
- added to the language."
-
- i get
- eg.f:
- Warning on line 1 of eg.f: unknown inline compiler option
- MAIN main:
- routine:
- Declaration error on/above line 10 of eg.f; for dyn_array; adjustable dimension on non-argument
-
- f77: Error. No assembly.
- f77: Errors detected, no link
-
- So I guess thats my problem. The compiler on our system
- HP-UX giaec A.08.07 A 9000/720 2001133857
- doesn't know the compiler directive.
-
- Thanks again for all those that helped.
- Possibly the only people that could unravel this problem is HP.
-
-