Say I have the below code:
program test
call foo
call foo
contains
subroutine foo
integer(8),dimension(:),allocatable:: var1
allocate(var1(10))
...
return
end subroutine foo
end
will the variable var1 get allocated twice? (I guess YES). If it is allocated for each call, will the memory allocated during the first call becomes free?