Malcolm Cohen wrote:
> Malcolm Cohen wrote:
>> (2) At lines 40-42 the actual argument is T1 (or an extension thereof)
>> with MASS_KIND equal to KIND(0d0). However, the procedure expects T1
>> (or an extension thereof) with MASS_KIND equal to KIND(0.0).
>
> John Reid quibbles:
>> Surely KIND(0.0) is just the default value of the parameter MASS_KIND.
>
> No it is not "just" the default value of the type parameter MASS_KIND, it
> also happens to be the value of the type parameter MASS_KIND of the dummy
> argument AMPH of the procedure (S) being referenced.
>
>> The array TOAD is of type T3 with MASS_KIND value KIND(1.0d0) which makes
> TOAD%T1 of type T1 with MASS_KIND value KIND(1.0d0).
>
> And?
>
> The point is that it is not compatible with the dummy argument. Nor is
> TOAD%T2. Nor is TOAD.
Is the declaration of TOAD:
type(t3(mass_kind=kind(1.0d0),nlen=50,number=3,slen=80 ))::toad(arlen)
legal? 7.5.7.2 says
"An extended type includes all of the type parameters, all of the
components, and the nonoverridden (7.5.7.3) type-bound procedures of its
parent type. These are inherited by the extended type from the parent
type. They retain all of the attributes that they had in the parent
type. Additional type parameters, components, and procedure bindings may
be declared in the derived-type definition of the extended type."
I think only slen is a parameter of the type t3.
John.
>
> Actually it's not just the kind type parameter that is wrong it is also the
> length type parameters. The dummy is declared CLASS(T1) which is equivalent
> to CLASS(T1(KIND(0.0),1,1)), but the actual argument also has length type
> parameters NLEN=50 NUMBER=3.
>
> Cheers,
>
|