Alternate version of db1ink_alt, where the first and
last kx-1 knots are specified by the user.
Note
The spline order kx must be at least 3.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(:) | :: | x |
vector of abscissae of length |
|
| integer(kind=ip), | intent(in) | :: | nx |
number of data points, |
||
| real(kind=wp), | intent(in), | dimension(:) | :: | fcn |
vector of ordinates of length |
|
| integer(kind=ip), | intent(in) | :: | kx |
spline order ( |
||
| integer(kind=ip), | intent(in) | :: | ibcl |
selection parameter for left boundary condition:
constrain the |
||
| integer(kind=ip), | intent(in) | :: | ibcr |
selection parameter for right boundary condition:
constrain the |
||
| real(kind=wp), | intent(in) | :: | fbcl |
left boundary values governed by |
||
| real(kind=wp), | intent(in) | :: | fbcr |
right boundary values governed by |
||
| real(kind=wp), | intent(in), | dimension(:) | :: | tleft |
|
|
| real(kind=wp), | intent(in), | dimension(:) | :: | tright |
|
|
| real(kind=wp), | intent(out), | dimension(:) | :: | tx |
knot array of length |
|
| real(kind=wp), | intent(out), | dimension(:) | :: | bcoef |
b spline coefficient array of length |
|
| integer(kind=ip), | intent(out) | :: | iflag |
status flag (see dbint4) |
pure subroutine db1ink_alt_2(x,nx,fcn,kx,ibcl,ibcr,fbcl,fbcr,tleft,tright,tx,bcoef,iflag) implicit none real(wp),dimension(:),intent(in) :: x !! \(x\) vector of abscissae of length `nx`, distinct !! and in increasing order integer(ip),intent(in) :: nx !! number of data points, \( n_x \ge \max(2,k_x-2) \) real(wp),dimension(:),intent(in) :: fcn !! \(y\) vector of ordinates of length `nx` integer(ip),intent(in) :: kx !! spline order (`kx >= 3`) integer(ip),intent(in) :: ibcl !! selection parameter for left boundary condition: !! constrain the `ibcl`-th derivative at `x(1)` to `fbcl` !! (`1 <= ibcl <= kx-1`, e.g. `ibcl = 2` for a natural spline) integer(ip),intent(in) :: ibcr !! selection parameter for right boundary condition: !! constrain the `ibcr`-th derivative at `x(nx)` to `fbcr` !! (`1 <= ibcr <= kx-1`, e.g. `ibcr = 2` for a natural spline) real(wp),intent(in) :: fbcl !! left boundary values governed by `ibcl` real(wp),intent(in) :: fbcr !! right boundary values governed by `ibcr` real(wp),dimension(:),intent(in) :: tleft !! `t(1:kx-1)` in increasing order supplied by the user. real(wp),dimension(:),intent(in) :: tright !! `t(nx+4:nx+kx+2)` in increasing order supplied by the user. real(wp),dimension(:),intent(out) :: tx !! knot array of length `nx+kx+2` real(wp),dimension(:),intent(out) :: bcoef !! b spline coefficient array of length `nx+2` integer(ip),intent(out) :: iflag !! status flag (see [[dbint4]]) integer(ip) :: n !! number of coefficients (`n=nx+2`) logical :: status_ok !! status flag for error checking integer(ip),parameter :: kntopt = 3 !! use `tleft` and `tright` in [[dbint4]] call check_inputs( 1_ip,& ! so it will check size of t iflag,& nx=nx,& kx=kx,& x=x,& f1=fcn,& bcoef1=bcoef,& tx=tx,& status_ok=status_ok,& alt=.true.) if (status_ok) then call dbint4(x,fcn,nx,ibcl,ibcr,fbcl,fbcr,kntopt,tleft,tright,tx,bcoef,n,kx,iflag) end if end subroutine db1ink_alt_2