I need to break 0 to 1 into 10, 100, and 1000 sections i.e 0.0 0.1 0.2 0.3 ... in the first part of my code but it is not working as intended, here is the part of code which relates to this:
Program Euler_Huene
implicit none
real, dimension(4,0:10) :: yeh1 = 0.0 !4th row is for x amounts
real, dimension(4,0:100) :: yeh2 = 0.0
real, dimension(4,0:1000) :: yeh3 = 0.0
real, dimension(4,0:10) :: yhh1 = 0.0
real, dimension(4,0:100) :: yhh2 = 0.0
real, dimension(4,0:1000) :: yhh3 = 0.0
real, parameter :: h1 = 0.1, h2 = 0.01, h3 = 0.001
do i = 0, 999
if (i < 10) then
yeh1(4,i+1) = yeh1(4,i) + h1
yhh1(4,i+1) = yhh1(4,i) + h1
end if
if (i < 100) then
yeh2(4,i+1) = yeh2(4,i) + h2
yhh2(4,i+1) = yhh2(4,i) + h2
end if
if (i < 1000) then
yeh3(4,i+1) = yeh3(4,i) + h3
yhh3(4,i+1) = yhh3(4,i) + h3
end if
end do
The part for breaking 0 to 1 to 10 sections work but the others don't. This is what I get from code : yhh3(4,900)=0.899992, yhh2(4,90)=8.99999, yhh1(4,9)=0.9 but all of them should be 0.9 right?