I am sure this has been asked many time, but are data maybe simple type like integer initialised at run time?
I have a feeling they are set to 0.0.
I am using: Visual Fortran Compiler XE 126.96.36.199 [Intel(R) 64
No, you should not assume anything about a default initialisation. Only if you explicitly set the value via a DATA statement or via an assignment in the declaration, can you be sure that the variable will have a particular value at start-up.
Even if it seems so nonetheless, it may be that one day there is rubbish left in the memory location that does not represent zero and that rubbish causes your program to fail.
The question is sort of the other way round. In the example as it stands both itest and rtest are assigned a value of 0 and the program runs to completion. The real variable rtest can be managed by initializing it to snan but there is no equivalent for integers. Is it possible to detect whether or not an integer module variable has been initialized?
I tried, it doesn't work. I suspect that the problem is that any bit-pattern in an integer represents a valid integer so there isn't an equivalent of snan. In theory it should be possible to keep a flag behind the scenes that carries the initialization state but in practice that might be just too unwieldy.