Re: Type specification and initialization expressions
- From: "James Giles" <jamesgiles@xxxxxxxxxxxxxxxx>
- Date: Thu, 31 Jan 2008 20:37:46 GMT
Tobias Burnus wrote:
Hello,
Is the following code valid or not?
implicit none
REAL(kind(0.0d0)), dimension(kind(xyz)) :: xyz
REAL, PARAMETER :: xxx(kind(xxx)) = 1.0
This is accepted by NAG f95 and gfortran (and both have then size(xyz)
== kind(0d0)), but it is unclear for me whether this is valid.
I don't think it is since KIND(xyz) is not defined until after xyz is
declared. I don't think *during* the declaration counts as *after*.
The following has been discussed before and I think was determined
to be non-standard for the same reason:
Real :: X(5), Y(size(x))
Even if such things were standard, I would avoid then for legibility
reassons.
--
J. Giles
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
.
- Follow-Ups:
- Re: Type specification and initialization expressions
- From: James Giles
- Re: Type specification and initialization expressions
- References:
- Type specification and initialization expressions
- From: Tobias Burnus
- Type specification and initialization expressions
- Prev by Date: Re: Automatically transform or expand do loop in a subroutine
- Next by Date: Re: Type specification and initialization expressions
- Previous by thread: Type specification and initialization expressions
- Next by thread: Re: Type specification and initialization expressions
- Index(es):