home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uimrl7.mrl.uiuc.edu!ercolessi
- From: ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi)
- Subject: Re: Dynamic Memory Allocation in FORTRAN, Question
- References: <Dec.20.02.22.20.1992.7312@spade.rutgers.edu> <1992Dec20.233539.4905@sol.ctr.columbia.edu>
- Message-ID: <BzL8tz.H5u@news.cso.uiuc.edu>
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Reply-To: ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi)
- Organization: MRL - UIUC
- Date: Mon, 21 Dec 1992 02:41:57 GMT
- Lines: 33
-
- In article <1992Dec20.233539.4905@sol.ctr.columbia.edu>, shenkin@still3.chem.columbia.edu (Peter
- Shenkin) writes:
- |>In article <Dec.20.02.22.20.1992.7312@spade.rutgers.edu>
- |> xiong@spade.rutgers.edu (Xiong) writes:
- |>>Hi, I am wondering if it is possible to allocate memory dynomically in
- |>>FORTRAN as in C?
- |>
- |>No.
-
- We are a bit negative, aren't we? :-)
-
- Well, if you stick to the FORTRAN standard the answer is no
- [of course, Fortran is another story].
- But there might be vendor extensions that may allow dynamic
- or almost-dynamic arrays. One of them is the AUTOMATIC
- declaration, that is quite popular on RISC architectures
- (e.g., SGI, IBM RS/6000, DEC MIPS). Storage space for variables
- declared to be AUTOMATIC in a certain subroutine is created
- when the subroutine is entered, and deleted upon exit.
- So it's not as flexible as in C, in the sense that the lifetime
- of the variable must coincide with the subroutine execution,
- and the variable size must be known at compile time.
- Still, if your purpose is to avoid wasting memory, it does
- the job nicely.
-
- There may be other schemes implemented by other vendors,
- and one can also attempt a mixed language implementation but
- this goes beyond the original question.
- --
- Furio Ercolessi
- Materials Research Laboratory | Intl School for Advanced Studies
- Univ. of Illinois at Urbana-Champaign | Trieste, Italy
- furio@uiuc.edu | furio@sissa.it
-