I wanted to use fderiv.f90 for obtaining first and second order derivatives but unfortunatelly can't succeed yet. I've written this extra-simple code to exclude any unexpected factors:
real(8) x(100), y(100), f(100), cf(3,100)
print *, x(i),f(i)
end program der
As one can see it calculates two arrays - of an argument and of a function which is simply argument squared so it's clear that the derivative should be twice argument. But instead of this I get some artificial numbers. Is it a bug or I do something wrong? I perform compiling of course with fderiv.f90 and spline.f90 attached.
Thanks in advance, Anton
John Kay Dewhurst
You have to declare the array as cf(4,100). Then all is well.
It turned out that the real reason was that I used some old one of spline.f90. I tried to declare cf(4,100) as you suggested but it didn't help. Then I changed spline.f90 to the one from elk 1.1.4 package and it became OK! But your reply motivated me to check this, so thank you!