Skip to content

Commit 2d31143

Browse files
committed
added a bspline_order_linear parameter
1 parent 446ea1a commit 2d31143

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/bspline_sub_module.f90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ end function b1fqad_func
5858
end interface
5959
public :: b1fqad_func
6060

61+
integer(ip),parameter,public :: bspline_order_linear = 2_ip !! spline order `k` parameter
62+
!! (for input to the `db*ink` routines)
63+
!! [order = polynomial degree + 1]
6164
integer(ip),parameter,public :: bspline_order_quadratic = 3_ip !! spline order `k` parameter
6265
!! (for input to the `db*ink` routines)
6366
!! [order = polynomial degree + 1]

test/bspline_linear_test.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ program bspline_linear_test
3939
iloy = 1
4040

4141
! initialize
42-
call b2%initialize(x,fcn_1d,2,iflag,extrap=.true.) ! linear
42+
call b2%initialize(x,fcn_1d,bspline_order_linear,iflag,extrap=.true.) ! linear
4343
if (iflag/=0) error stop 'Error initializing 1D linear spline: '//get_status_message(iflag)
44-
call b3%initialize(x,fcn_1d,3,iflag,extrap=.true.) ! quadratic
44+
call b3%initialize(x,fcn_1d,bspline_order_quadratic,iflag,extrap=.true.) ! quadratic
4545
if (iflag/=0) error stop 'Error initializing 1D quadratic spline: '//get_status_message(iflag)
46-
call b4%initialize(x,fcn_1d,4,iflag,extrap=.true.) ! cubic
46+
call b4%initialize(x,fcn_1d,bspline_order_cubic,iflag,extrap=.true.) ! cubic
4747
if (iflag/=0) error stop 'Error initializing 1D cubic spline: '//get_status_message(iflag)
4848
call s1%initialize(x,fcn_1d,iflag)
4949
if (iflag/=0) error stop 'Error initializing 1D linear interpolator'

0 commit comments

Comments
 (0)