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
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!
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.