dfspvn Subroutine

private subroutine dfspvn(t, Jhigh, Index, x, Ileft, Vnikx, j, deltam, deltap)

Calculates the value of all possibly nonzero B-splines at X of order MAX(JHIGH,(J+1)(INDEX-1)) on T.

Revision history

  • 780801 DATE WRITTEN
  • 891214 Prologue converted to Version 4.0 format. (BAB)
  • 900328 Added TYPE section. (WRB)
  • JW : made threadsafe. See also dbspvn

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: t(*)
integer, intent(in) :: Jhigh
integer, intent(in) :: Index
real(kind=wp), intent(in) :: x
integer, intent(in) :: Ileft
real(kind=wp) :: Vnikx(*)
integer, intent(inout) :: j

JW : added

real(kind=wp), intent(inout), dimension(20) :: deltam

JW : added

real(kind=wp), intent(inout), dimension(20) :: deltap

JW : added


Called by

proc~~dfspvn~~CalledByGraph proc~dfspvn bspline_defc_module::dfspvn proc~dcv bspline_defc_module::dcv proc~dcv->proc~dfspvn proc~defcmn bspline_defc_module::defcmn proc~defcmn->proc~dfspvn proc~dfcmn bspline_defc_module::dfcmn proc~dfcmn->proc~dfspvn proc~dfspvd bspline_defc_module::dfspvd proc~dfcmn->proc~dfspvd proc~dfspvd->proc~dfspvn proc~defc bspline_defc_module::defc proc~defc->proc~defcmn proc~dfc bspline_defc_module::dfc proc~dfc->proc~dfcmn

Source Code

   subroutine dfspvn(t, Jhigh, Index, x, Ileft, Vnikx, j, deltam, deltap)

      real(wp),intent(in) :: t(*)
      integer,intent(in) :: Jhigh
      integer,intent(in) :: Index
      real(wp),intent(in) :: x
      integer,intent(in) :: Ileft
      real(wp) :: Vnikx(*)
      integer, intent(inout) :: j !! JW : added
      real(wp), dimension(20), intent(inout) :: deltam, deltap !! JW : added

      real(wp) :: vm, vmprev
      integer :: imjp1, ipj, jp1, jp1ml, l

      if (Index /= 2) then
         j = 1
         Vnikx(1) = 1.0_wp
         if (j >= Jhigh) return
      end if

      do
         ipj = Ileft + j
         deltap(j) = t(ipj) - x
         imjp1 = Ileft - j + 1
         deltam(j) = x - t(imjp1)
         vmprev = 0.0_wp
         jp1 = j + 1
         do l = 1, j
            jp1ml = jp1 - l
            vm = Vnikx(l)/(deltap(l) + deltam(jp1ml))
            Vnikx(l) = vm*deltap(l) + vmprev
            vmprev = vm*deltam(jp1ml)
         end do
         Vnikx(jp1) = vmprev
         j = jp1
         if (j >= Jhigh) exit
      end do

   end subroutine dfspvn