Type specification and initialization expressions
- From: Tobias Burnus <burnus@xxxxxxxx>
- Date: Thu, 31 Jan 2008 04:38:34 -0800 (PST)
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.
For the following I am rather sure that it is valid:
REAL, DIMENSION(2,2), PARAMETER :: xyz2 = RESHAPE((/ 1,2,3,4 /),
SHAPE(xyz2))
REAL, PARAMETER :: yyy = kind(yyy)
while the following should be invalid:
REAL(8), PARAMETER :: zzz(size(zzz)) = 1 ! Obviously - which
dimension one should get?
real, parameter :: z = transfer(1234, z)
My starting point was "7.1.7 Initialization expression" (esp. last
paragraph).
Tobias
.
- Follow-Ups:
- Re: Type specification and initialization expressions
- From: Steve Lionel
- Re: Type specification and initialization expressions
- From: James Giles
- Re: Type specification and initialization expressions
- Prev by Date: Re: Did anyone manage to get MATRAN compiled with g95?
- Next by Date: Re: The concept of a record
- Previous by thread: Automatically transform or expand do loop in a subroutine
- Next by thread: Re: Type specification and initialization expressions
- Index(es):
Relevant Pages
|
|