Re: DO D1%I=1,10
From: Richard E Maine (nospam_at_see.signature)
Date: 01/13/05
- Next message: Michael Metcalf: "Re: DO D1%I=1,10"
- Previous message: Gareth Owen: "Re: DO D1%I=1,10"
- In reply to: Joost: "DO D1%I=1,10"
- Next in thread: Joost: "Re: DO D1%I=1,10"
- Reply: Joost: "Re: DO D1%I=1,10"
- Reply: beliavsky_at_aol.com: "Re: DO D1%I=1,10"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 13 Jan 2005 08:07:09 -0800
In article <1105630873.454085.95720@f14g2000cwb.googlegroups.com>,
"Joost" <jv244@cam.ac.uk> wrote:
> is this standard f95 ?
[code using d1%I as a DO variable elided]
No.
> D1%I seems a scalar integer variable,
True. But that's not all that the requirement for a DO variable says.
You left out the word "named". The DO variable is also required to be a
named variable. D1%I is not a named variable. Note that a name is a
specific syntactic construct... the one about consisting of letters,
digits, and underscores, with the first character being a letter. In
particular, names do not include % characters.
The most obvious solution is to use a separate variable for your DO
variable, copying it into the structure as needed, perhaps as the first
line of the DO loop (and maybe after the loop if you also need to catch
the ending value).
An alternative is to make the structure a target and then declare
an integer pointer, say, P and set
P => D1%I
Then you have your named variable P. But that might be a bit of overkill
(and have performance implications).
-- Richard Maine | Good judgment comes from experience; email: my first.last at org.domain | experience comes from bad judgment. org: nasa, domain: gov | -- Mark Twain
- Next message: Michael Metcalf: "Re: DO D1%I=1,10"
- Previous message: Gareth Owen: "Re: DO D1%I=1,10"
- In reply to: Joost: "DO D1%I=1,10"
- Next in thread: Joost: "Re: DO D1%I=1,10"
- Reply: Joost: "Re: DO D1%I=1,10"
- Reply: beliavsky_at_aol.com: "Re: DO D1%I=1,10"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|