Populates a spline instance spl
representing the non-periodic
data y(x).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n | |||
real, | intent(in), | dimension (n) | :: | x | ||
real, | intent(in), | dimension (n) | :: | y | ||
type(spline), | intent(out) | :: | spl |
subroutine new_spline (n, x, y, spl)
implicit none
integer, intent (in) :: n
real, dimension (n), intent (in) :: x, y
type (spline), intent (out) :: spl
real, dimension (n) :: temp
integer :: ierr
spl%n = n
allocate (spl%x(spl%n),spl%y(spl%n))
spl%x = x
spl%y = y
allocate (spl%y2(spl%n))
spl%valid = .false.
spl%tension = 1.0
call fitp_curv1 (spl%n, spl%x, spl%y, 0.0, 0.0, 3, spl%y2, temp, spl%tension, ierr)
spl%valid = ierr == 0
end subroutine new_spline