I'm working with Fortran90, but I don't have a lot of familiarity with it.
In some point of the code, I would like to create an array of n linearly equally spaced points between t0 and tf, so I tried this:
t = t0+(/(i,i=0,n-1)/)*(tf-t0)/(n-1)
Which is the same thing as:
do while(i<=n)
t(i) = i-1
i=i+1
end do
t = t*(tf-t0)/(n-1)+t0
However, if n is too large (n=2000001 or bigger), the first option doesn't work. I get the error:
forrtl: severe (170): Program Exception - stack overflow
Why is that? What can I do to make the implied do loops work for n large?