Hi,
I made a small test program for allocatable array, as following
I made a small test program for allocatable array, as following
Code:
real, allocatable :: a(:)
allocate(a(2))
a(1) = 1.0
a(2) = 2.0
a(3) = 3.0 ! This can be accessed!!!
write(*, *) a(1), a(2)
write(*, *) a(3)
[\code]
The result is:
[code]
1.00000000000000 2.00000000000000
3.00000000000000
[\code]