Skip to content

Commit

Permalink
added a bspline_order_linear parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwilliams committed Oct 10, 2023
1 parent 446ea1a commit 2d31143
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/bspline_sub_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ end function b1fqad_func
end interface
public :: b1fqad_func

integer(ip),parameter,public :: bspline_order_linear = 2_ip !! spline order `k` parameter
!! (for input to the `db*ink` routines)
!! [order = polynomial degree + 1]
integer(ip),parameter,public :: bspline_order_quadratic = 3_ip !! spline order `k` parameter
!! (for input to the `db*ink` routines)
!! [order = polynomial degree + 1]
Expand Down
6 changes: 3 additions & 3 deletions test/bspline_linear_test.f90
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ program bspline_linear_test
iloy = 1

! initialize
call b2%initialize(x,fcn_1d,2,iflag,extrap=.true.) ! linear
call b2%initialize(x,fcn_1d,bspline_order_linear,iflag,extrap=.true.) ! linear
if (iflag/=0) error stop 'Error initializing 1D linear spline: '//get_status_message(iflag)
call b3%initialize(x,fcn_1d,3,iflag,extrap=.true.) ! quadratic
call b3%initialize(x,fcn_1d,bspline_order_quadratic,iflag,extrap=.true.) ! quadratic
if (iflag/=0) error stop 'Error initializing 1D quadratic spline: '//get_status_message(iflag)
call b4%initialize(x,fcn_1d,4,iflag,extrap=.true.) ! cubic
call b4%initialize(x,fcn_1d,bspline_order_cubic,iflag,extrap=.true.) ! cubic
if (iflag/=0) error stop 'Error initializing 1D cubic spline: '//get_status_message(iflag)
call s1%initialize(x,fcn_1d,iflag)
if (iflag/=0) error stop 'Error initializing 1D linear interpolator'
Expand Down

0 comments on commit 2d31143

Please sign in to comment.