"PGF90-S-0099 Illegal use of derived type"

Hi,

When I use pgf90 to compile a fortran90 program, I get the following
error: “PGF90-S-0099 Illegal use of derived type”. In my program, I defined a local variable “type(dd_real) sum", where “dd_real” is a derived
type, and the assignment operator “=” has been overloaded for “dd_real", The error occured at this statement : “sum=ZERO”, where “ZERO” is a constant with “dd_real” type. But if I change the variable name “sum”
to other e.g. “ssum”, no error reported. I wonder if the local variable
name “sum” conflicts with the intrinsic procedure “sum”. Then I do another
test, such as

subroutine test()

integer sum

sum=4
sum=sum+4

end

no error occured. What’s wrong with the derived type?

Thanks a lot.

xg

Hi xg,

The 5.1 compiler has a bug (TPR 3303) which causes a conflict when user-defined type variables have the same name as an intrinsic function. This issue has been fixed in the 5.2-2 release of the compiler.

The work around is to use the entity style declaration of “sum”.

      type(dd_real) :: sum

Hope this helps,
Mat