Dear friends, I have a problem declaring an integer variable. A sketch of my code goes something like this:
integer :: a(10), i
do i = 1, 10
a(i) = a(i - 1) + 2 ! where a(0) = 0
However, I don’t know how to declare a(0) = 0, because when declaring it before the loop I get this error when compiling, " Array reference at (1) is out of bounds (0 < 1) in dimension 1."
Could you please help me fix this problem? Thank you very much.