(j3.2006) Problem with default expressions for kind type parameters?

Rafik Zurob rzurob
Fri Sep 21 22:17:36 EDT 2012


Van Snyder wrote on 21/09/2012 10:01:19 PM:
> In 04-162, I advocated allowing parameters, i.e., named "constant"
> declarations, inside type definitions.  For the above, instead of "note
> to self," one would have
> 
> type :: dt ( k )
>   integer, kind :: k = kind(0.0e0)
>   integer, parameter :: dk = selected_real_kind(digits(0.0_k)+1)
>   real(k) :: s
>   real(dk) :: d
> end type

That would work too, and is better than relying on a comment.  If the 
initialization of these constants depended on kind type parameters, that 
initialization would also have to be delayed to variable declaration time. 
 So in essence, they'd be very similar to kind type parameters.

Regards

Rafik




More information about the J3 mailing list