Re: ALLOCATABLE arrays

From: Herman D. Knoble (SkipKnobleLESS_at_SPAMpsu.edu)
Date: 01/06/04


Date: Tue, 06 Jan 2004 11:04:14 -0500

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

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



Relevant Pages

  • Re: Automatic arrays from VB6 to lahey fortran
    ... VB6 crashes hard). ... > end Subroutine Automatic ... What's an automatic array in Fortran? ...
    (comp.lang.fortran)
  • Re: weird problem Fortran 77
    ... > Or if I only declare a, ... Your array a is an automatic array as defined by Fortran 90. ... caused by a compiler bug if you're working with a Fortran 90 compiler. ...
    (comp.lang.fortran)
  • Re: text-2-binary I/O switch issue
    ... init arrays ... That is a Fortran 90 construct known as an automatic array. ... this feature as an extension, but the feature is distinctly *NOT* ...
    (comp.lang.fortran)
  • Re: Fortran and C - a simple example that is working
    ... -|contains both the Fortran and C parts and directional comments. ... -| Penn State Information Technology Services ... Penn State Information Technology Services ... Penn State University ...
    (comp.lang.fortran)
  • Re: Fortran or C
    ... good for string handling, like TCL. ... -|So that would "limit" me to fortran as you say. ... -|> Penn State Information Technology Services ... Penn State Information Technology Services ...
    (comp.lang.fortran)