When declaring variables is there a difference when using a double colon?
real(8) :: a
real(8) b
Both of these apparently do the same thing. Is there any difference between these besides style?
I know we can initialize variables and add attributes as follows
real(8), intent(in), parameter :: a = 4, b = 2
but besides that, is there any difference when just declaring a plain old real
or integer
with no attributes and not initializing?
Also, does this have anything to do with the SAVE
attribute? A while back in some of my code was behaving unexpectedly and I was saving the results of a function between calls, which forced me to explicitly set the variable to zero each time the function was called, even though the SAVE
attribute was not set by me.