Hello,
I just found a big bug in a code after trying a different compiler: I
had assumed that a local procedure variable of derived type would be
automatic and reset (default initialized) upon entry to the procedure.
Upon trying to fix this I realized it is not easy to default initialize
such a local variable in Fortran 95 (presumably in Fortran 2003 I would
use an empty type constructor x=TYPE_CONSTRUCTOR() in the procedure
header). I ended up writing a dummy procedure which has an INTENT(OUT)
dummy of that type, which makes it default initialized upon calling the
procedure. Ugly! I guess one can use a FUNCTION result as well. Is
there a better way?
Aleks
|