Re: Array Constructors
- From: *** Hendrickson <***.hendrickson@xxxxxxx>
- Date: Wed, 28 Feb 2007 15:49:13 GMT
cjk32@xxxxxxxxx wrote:
On 28 Feb, 12:50, "Michael Metcalf" <michaelmetc...@xxxxxxxxxxxxxx>
wrote:
<c...@xxxxxxxxx> wrote in message
news:1172660739.879054.15000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,Please note that the do variable of an implied-do in a DATA statement or an
Can anyone confirm that when a variable is used in an implied do loop
in an array constructor, is its value always restored afterwards.
array constructor has a scope that is just the implied-do. It is different
from any other entity with the same name (i.e., you have two variables
called i in your snippet, so to think about 'restoring' is not correct).
(See also MR&C, Section 5.15.)
That was my initial thought, but IVF complaining if *a* variable, i,
wasn't declared somewhere in the same scope in unsettled me somewhat.
Arjen makes a good point, but if I try it with a non integer variable,
IVF complains again, saying that an integer is required. I guess this
is just a bug in the IVF compiler.
Are you using IMPLICIT NONE? If so, then all variables need to
be declared, even those with statement or construct level scope.
*** Hendrickson
.
I assume 'MR&C' refers to an official fortran spec. Is that available
online anywhere?
Regards,
Chris
- Follow-Ups:
- Re: Array Constructors
- From: Klaus Wacker
- Re: Array Constructors
- From: Richard Maine
- Re: Array Constructors
- References:
- Array Constructors
- From: cjk32
- Re: Array Constructors
- From: Michael Metcalf
- Re: Array Constructors
- From: cjk32
- Array Constructors
- Prev by Date: optional argument versus subroutine overloading
- Next by Date: Re: optional argument versus subroutine overloading
- Previous by thread: Re: Array Constructors
- Next by thread: Re: Array Constructors
- Index(es):