why fortran gives me wrong output?

02-17-2003, 05:41 PM
i am usign fortran to do schumaker spline. in the program attached, i have 40 grid points and when i use the subroutine xknots to find the knots in the spline, after the do loop, it gives me the wrong values of the grid points.
i can have the correct grid points before the do loop but after the loop it is not correct.

you can run the program, and it will show on screen the correct value for the grid points 5 and the last one.
then it will show the correct values in the subroutine. after the do loop the value becomes incorrect.

i am so confused by this result. i would greatly appreciate your help.