I am a C++ programmer working for the first time on some legacy Fortran code. My question is whether Fortran guarantees anything about whether local variables are initialized to 0 at the beginning of a subroutine - or is the initial value whatever is at some chunch of memory, i.e. garbage?
Is this the same for the values in a "Dimension"ed variable?
I have (at the beginning of a subroutine):
One branch of the code sets SIGN(5,1) to 1.0, the other branch doesn't mention SIGN(5,1). Later this value is queried and tested against 1.0 or 0.0. So either it defaults to 0.0 or this code contains an error.
Pertaining to the same variable SIGN above, later the code loops with a counter COLUMN and starts assigning values to
where COLUMN starts as 1 and increment to 8.
Isn't this blowing the array bounds? I didn't think (at least older Fortran) would allow and even automate dynamic array sizing. Is this program writing to memory that doesn't belonging to it?
Thanks a lot for your help,