I am a bit confused about what /zero does, as I think it is unnecessary with FTN95 as this is the default action.
Zeroing variables and arrays is not required by the Fortran standard and so assuming /zero can result in a lack of portability.
Is 'zeroing' variables/arrays the default for static variables, so /zero is default ?
This excludes /undef where variables/arrays are initialised differently.
Does this also exclude ALLOCATE arrays, which are not zeroed ?
Does this also exclude automatic arrays or local variables, which are not zeroed ?
So, can there be a clear answer about what is the default for 32-bit and 64-bit FTN95 :
static variables and arrays: are they zeroed ? (I assume yes?)
dynamic (local) variables and arrays: are they zeroed when allocated on the stack (I assume NO but possibly yes?)
allocate arrays: are they zeroed when allocated (I assume NO?)
If you code assuming NO all is ok.
A common problem in old codes is the array subscripts were assumed not reset (/save) or are now initialised to zero, which creates out-of-bounds errors. Changing /zero won't fix these. Perhaps /save is what is required in these cases.
I have seen the following used in old code. Note local s is not initialised. I would not recommend it.
function suma (array,n)
real array(n)
do I = 1,n
s = s + array(I)
end do
suma = s
end