Variables not initialized in Fortran 2003
fortran
Solution
You could try using -zero or /Qzero -- these will initialize local scalars to zero -- but you really should be explicitly setting initial values. Depending on the compiler to do it for you is, as you have found out, a good way to introduce bugs. Note that the option names may be different for different compilers. The ones mentioned are for Intel Visual Fortran.
Problem
Why the variables are not initializing to zero in fortran 2003 when compared with f90? I have a variable in a function from a file. its initialized to 0. I want to use it another function then it shows a garbage value. even for global variables also. Is there any option I need to set for fortran 2003 compiler?