> On Aug 4, 2017, at 3:59 PM, Anton Shterenlikht <[log in to unmask]> wrote:
>
> Is this program conforming?
>
> type vector( rk, length )
> integer, kind :: rk
> integer, len :: length
> real( kind=rk ) :: val( length )
> end type vector
> type( vector( kind(0.0d0), 1000 ) ) :: arr
> write (*,*) arr % val % kind
> write (*,*) arr % rk
> end
>
> I think it is.
It should work. The (compiler) mistake is more obvious if the test adds one more write statement:
type vector( rk, length )
integer, kind :: rk
integer, len :: length
real( kind=rk ) :: val( length )
end type vector
type( vector( kind(0.0d0), 1000 ) ) :: arr
write (*,*) arr % val % kind
write (*,*) kind( arr % val)
write (*,*) arr % rk
end
Cheers,
Bill
> I think the 2 output values must be identical.
>
> Compiler 1 outputs 2 identical values.
> Compiler 2 outputs 2 different values.
>
> Anton
Bill Long [log in to unmask]
Principal Engineer, Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425
|