program rk4
real x(200), y(200), h, k1, k2, k3, k4
integer i
read*,x(0),y(0),h
do i=0,10
k1=x(i)-y(i)+2
x(i+1)=x(i)+h
k2=(x(i)+h/2)-(y(i)+(h/2)*k1))+2
k3=(x(i)+h/2)-(y(i)+(h/2)*k2))+2
k4=(x(i+1))-(y(i)+h*(k3))+2
y(i+1)=y(i)+(h/6)*(k1+2*k2+2*k3+k4)
print*, 'x=', x(i+1), 'y=', y(i+1)
enddo
end
At line 9 and 10:
k2=(x(i)+h/2)-(y(i)+(h/2)*k1))+2
k3=(x(i)+h/2)-(y(i)+(h/2)*k2))+2
I'm getting "Unclassifiable statement at (1)", with (1) pointing to k2 and k3. I can't see what I'm doing wrong as k1 and k4 follows a similar structure and it seems like there isn't anything wrong with them.