Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  фывапр
Language: FORTRAN
Code:
!
subroutine DF10(X, Y, DY, Error)
! Вычисление множества значений производной
! функции Y(X) в точках X1 ... XN по трем точкам.
real, intent(in):: X(:), Y(:)
real:: DY(:)
integer Error
real:: d21, d32, d31
integer i, n
!begin
  n=size(X)
  if(n<3) then
    Error=65; return
  end if
  d21=(Y(2)-Y(1))/(X(2)-X(1))
  d32=(Y(3)-Y(2))/(X(3)-X(2))
  d31=(Y(3)-Y(1))/(X(3)-X(1))
  DY(1)=d21-d32+d31
  DY(2)=d21+d32-d31
  do i=3, n-1
    d21=d32
    d32=(Y(i+1)-Y(i))/(X(i+1)-X(i))
    d31=(Y(i+1)-Y(i-1))/(X(i+1)-X(i-1))
    DY(i)=d21+d32-d31
  end do
  DY(n)=-d21+d32+d31
  Error=0
  return
end subroutine DF10          
          
          
Comments: