Re: ALLOCATABLE arrays
From: Lawson Wakefield (lawson_at_see.my.sig)
Date: 01/06/04
- Next message: John Lansberry: "Re: integer(8) problem with CVF 6.6B"
- Previous message: Gus Gassmann: "Re: ALLOCATABLE arrays"
- In reply to: Herman D. Knoble: "Re: ALLOCATABLE arrays"
- Next in thread: Jugoslav Dujic: "Re: ALLOCATABLE arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 6 Jan 2004 16:41:18 +0000
In article <b7mlvvkdaq74vgvgji1bm5jlbr6scuo8fq@4ax.com>, Herman D.
Knoble <SkipKnobleLESS@SPAMpsu.edu> writes
>Lawson: Apologies if I misunderstand you post here. The bound(s) of an
>automatic array
>need not be defined in a module. E.g., see first case of working examples in
>file:
>
>http://ftp.cac.psu.edu/pub/ger/fortran/hdk/AutomaticArray.f90
>
>Skip Knoble, Penn State
No I didn't say that they *need* to be defined in a module. What I
actually said was that they must be a "specification expression", which
in practice can be various things, one of which happens to be a variable
in a module (which was the case referred to by Gus). Mike's post
incorrectly implied that the bounds had to depend on an argument to the
procedure.
Lawson Wakefield
Interactive Software Services Ltd.
The Fortran GUI specialists
web: http://www.winteracter.com/iss
email: see our web page
>
>On Tue, 6 Jan 2004 14:48:18 +0000, Lawson Wakefield <lawson@see.my.sig> wrote:
>
>-|In article <btbnj7$4qu$06$1@news.t-online.com>, Michael Metcalf
>-|<metcalfm@acm.org> writes
>-|>
>-|>"Gus Gassmann" <hgassman@mgmt.dal.ca> wrote in message
>-|>news:3FF953CD.BB2A1853@mgmt.dal.ca...
>-|>>
>-|>> Do I read this right?
>-|>>
>-|>> Suppose I declare
>-|>>
>-|>> subroutine test
>-|>> integer :: i
>-|>> dimension i(k)
>-|>>
>-|>> where k is set in a module somewhere. Is it then the case that
>-|>> a) i gets allocated automatically on entry to test and deallocated
>-|>> on exit
>-|>> b) this operation takes (essentially) zero time?
>-|>>
>-|>> Is that really all there is to it? I'm afraid to look a gift horse
>-|>> in the mouth, but this sounds too good to be true!
>-|>>
>-|>It is. The shape of an automatic array must depend on an argument to the
>-|>procedure that it is local to. It is created on a stack at each invocation.
>-|>The main use is for temporary storage ("Fortran 90/95 Explained", Section
>-|>6.4).
>-|
>-|Are you absolutely sure about that Mike? Specifically, the requirement
>-|that the shape of an automatic array must rely on an argument to the
>-|procedure would not appear to apply. My understanding is that the
>-|bound(s) of an automatic array must be a specification expression. As
>-|such this also allows for variables which are defined in a module, as
>-|Gus suggests. Certainly, the latter usage works with a remarkably wide
>-|range of Fortran 9x compilers if is not in fact allowed.
>-|
>-|Lawson Wakefield
>-|Interactive Software Services Ltd.
>-|The Fortran GUI specialists
>-|web: http://www.winteracter.com/iss
>-|email: see our web page
>
>
> Herman D. (Skip) Knoble, Research Associate
> (a computing professional for 38 years)
> Email: SkipKnobleLESS@SPAMpsu.edu
> Web: http://www.personal.psu.edu/hdk
> Penn State Information Technology Services
> Academic Services and Emerging Technologies
> Graduate Education and Research Services
> Penn State University
> 214C Computer Building
> University Park, PA 16802-21013
> Phone:+1 814 865-0818 Fax:+1 814 863-7049
- Next message: John Lansberry: "Re: integer(8) problem with CVF 6.6B"
- Previous message: Gus Gassmann: "Re: ALLOCATABLE arrays"
- In reply to: Herman D. Knoble: "Re: ALLOCATABLE arrays"
- Next in thread: Jugoslav Dujic: "Re: ALLOCATABLE arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|