(j3.2006) derived types with type parameters are different

Aleksandar Donev donev1
Mon Jul 28 13:10:41 EDT 2008


On Monday 28 July 2008 09:44, Bill Long wrote:

> This is a syntax error. ?The ",kind" or ",len" are not optional syntax,
Well, then, why not just fix the error and add LEN instead of pretending to eb 
a compiler and spitting out syntax errors. We all make mistakes...

> assuming this is intended to be a type parameter declaration.
Of course they are, since you've responded to the posts I am sure you've read 
the previous messages...


> > ? ? ? ? ? ?SUBROUTINE S2(X, M)
> > ? ? ? ? ? ? ?TYPE T(N)
> > ? ? ? ? ? ? ? ?INTEGER :: N
> > ? ? ? ? ? ? ? ?SEQUENCE

> > ? ? ? ?SUBROUTINE S2(X, M)
> > ? ? ? ? ?TYPE T(N)
> > ? ? ? ? ? ?INTEGER, KIND :: N
> > ? ? ? ? ? ?SEQUENCE


> This is an error. The type parameter for T is a KIND type parameter, and
> thus M must be a named constant here. ?But it is a dummy argument.
Again, isn't it obvious that the example should have the KIND deleted in the 
actual procedure?

Once those are fixed, what does the Cray compiler do? The main point here is 
whether there is a difference between the way KIND and LENgth parameters are 
handled.

Best,
Aleks

-- 
Aleksandar Donev, Ph.D.
Lawrence Postdoctoral Fellow @ Lawrence Livermore National Laboratory
High Performance Computational Materials Science and Chemistry
E-mail: donev1 at llnl.gov
Phone: (925) 424-6816  Fax: (925) 423-0785
Address: P.O.Box 808, L-367, Livermore, CA 94551-9900
Web: http://cherrypit.princeton.edu/donev




More information about the J3 mailing list