Dear all,
I have been wasting some time to understand an error
which was rather trivial, I forgot to initialize
an index in a subroutine. As a result, no compiler gave me
any error but when executed the code gave me
different results for different compilers/computers.
My question is thus: is there a fortran instruction which forces
all the variables (arrays included)
to be zero when first created (or allocated)?
If I am not wrong using the option -zero when compiling with ifort does it but only for scalars, moreover I would prefer to force it in the code
itself.
Do you have any suggestion?
cheers,
Paolo
I have been wasting some time to understand an error
which was rather trivial, I forgot to initialize
an index in a subroutine. As a result, no compiler gave me
any error but when executed the code gave me
different results for different compilers/computers.
My question is thus: is there a fortran instruction which forces
all the variables (arrays included)
to be zero when first created (or allocated)?
If I am not wrong using the option -zero when compiling with ifort does it but only for scalars, moreover I would prefer to force it in the code
itself.
Do you have any suggestion?
cheers,
Paolo