Skip to content

Commit 2460718

Browse files
committed
Merge branch 'master' of https://github.com/jacobwilliams/bspline-fortran into 67-defc
2 parents 0a2e903 + 42f1401 commit 2460718

File tree

7 files changed

+34
-39
lines changed

7 files changed

+34
-39
lines changed

fpm.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ auto-examples = false
1313
auto-tests = true
1414

1515
[dev-dependencies]
16-
pyplot-fortran = { git = "https://github.com/jacobwilliams/pyplot-fortran", tag = "3.2.0" }
16+
pyplot-fortran = { git = "https://github.com/jacobwilliams/pyplot-fortran", tag = "3.3.0" }
1717

1818
[library]
1919
source-dir = "src"

src/bspline_sub_module.f90

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3120,29 +3120,29 @@ pure subroutine dbspvn(t,jhigh,k,index,x,ileft,vnikx,work,iwork,iflag)
31203120

31213121
implicit none
31223122

3123-
real(wp),dimension(*),intent(in) :: t !! knot vector of length `n+k`, where
3124-
!! `n` = number of b-spline basis functions
3125-
!! `n` = sum of knot multiplicities-`k`
3126-
!! dimension `t(ileft+jhigh)`
3127-
integer(ip),intent(in) :: jhigh !! order of b-spline, `1 <= jhigh <= k`
3128-
integer(ip),intent(in) :: k !! highest possible order
3129-
integer(ip),intent(in) :: index !! index = 1 gives basis functions of order `jhigh`
3130-
!! = 2 denotes previous entry with `work`, `iwork`
3131-
!! values saved for subsequent calls to
3132-
!! dbspvn.
3133-
real(wp),intent(in) :: x !! argument of basis functions, `t(k) <= x <= t(n+1)`
3134-
integer(ip),intent(in) :: ileft !! largest integer such that `t(ileft) <= x < t(ileft+1)`
3135-
real(wp),dimension(k),intent(out) :: vnikx !! vector of length `k` for spline values.
3136-
real(wp),dimension(*),intent(out) :: work !! a work vector of length `2*k`
3137-
integer(ip),intent(out) :: iwork !! a work parameter. both `work` and `iwork` contain
3138-
!! information necessary to continue for `index = 2`.
3139-
!! when `index = 1` exclusively, these are scratch
3140-
!! variables and can be used for other purposes.
3141-
integer(ip),intent(out) :: iflag !! * 0: no errors
3142-
!! * 201: `k` does not satisfy `k>=1`
3143-
!! * 202: `jhigh` does not satisfy `1<=jhigh<=k`
3144-
!! * 203: `index` is not 1 or 2
3145-
!! * 204: `x` does not satisfy `t(ileft)<=x<=t(ileft+1)`
3123+
real(wp),dimension(*),intent(in) :: t !! knot vector of length `n+k`, where
3124+
!! `n` = number of b-spline basis functions
3125+
!! `n` = sum of knot multiplicities-`k`
3126+
!! dimension `t(ileft+jhigh)`
3127+
integer(ip),intent(in) :: jhigh !! order of b-spline, `1 <= jhigh <= k`
3128+
integer(ip),intent(in) :: k !! highest possible order
3129+
integer(ip),intent(in) :: index !! index = 1 gives basis functions of order `jhigh`
3130+
!! = 2 denotes previous entry with `work`, `iwork`
3131+
!! values saved for subsequent calls to
3132+
!! dbspvn.
3133+
real(wp),intent(in) :: x !! argument of basis functions, `t(k) <= x <= t(n+1)`
3134+
integer(ip),intent(in) :: ileft !! largest integer such that `t(ileft) <= x < t(ileft+1)`
3135+
real(wp),dimension(k),intent(out) :: vnikx !! vector of length `k` for spline values.
3136+
real(wp),dimension(*),intent(inout) :: work !! a work vector of length `2*k`
3137+
integer(ip),intent(inout) :: iwork !! a work parameter. both `work` and `iwork` contain
3138+
!! information necessary to continue for `index = 2`.
3139+
!! when `index = 1` exclusively, these are scratch
3140+
!! variables and can be used for other purposes.
3141+
integer(ip),intent(out) :: iflag !! * 0: no errors
3142+
!! * 201: `k` does not satisfy `k>=1`
3143+
!! * 202: `jhigh` does not satisfy `1<=jhigh<=k`
3144+
!! * 203: `index` is not 1 or 2
3145+
!! * 204: `x` does not satisfy `t(ileft)<=x<=t(ileft+1)`
31463146

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

test/bspline_extrap_test.f90

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ program bspline_extrap_test
1010
use bspline_module
1111
use bspline_kinds_module, only: wp, ip
1212
use pyplot_module
13-
use, intrinsic :: iso_fortran_env
1413

1514
implicit none
1615

@@ -57,7 +56,7 @@ program bspline_extrap_test
5756
!initialize the plot:
5857
call plt%initialize(grid=.true.,xlabel='x (deg)',ylabel='f(x)',&
5958
title='Extrapolation Test',legend=.true.)
60-
call plt%add_plot(real(x*rad2deg,real64),real(fcn_1d,real64),&
59+
call plt%add_plot(x*rad2deg,fcn_1d,&
6160
label='Function $f(x) = \sin(x)$',&
6261
linestyle='ko',markersize=5,linewidth=2,istat=istat)
6362

@@ -82,7 +81,7 @@ program bspline_extrap_test
8281
write(*,*) ''
8382

8483
if (extrap) then
85-
call plt%add_plot(real(xval*rad2deg,real64),real(fval,real64),&
84+
call plt%add_plot(xval*rad2deg,fval,&
8685
label='Interpolated',&
8786
linestyle='g.-',linewidth=1,istat=istat)
8887
call plt%savefig('bspline_extrap_test.png',istat=istat)

test/dbint4_test.f90

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ program dbint4_test
77
use bspline_module
88
use bspline_kinds_module, only: wp,ip
99
use pyplot_module
10-
use, intrinsic :: iso_fortran_env
1110

1211
implicit none
1312

@@ -56,7 +55,7 @@ program dbint4_test
5655
!initialize the plot:
5756
call plt%initialize(grid=.true.,xlabel='x (deg)',ylabel='f(x)',&
5857
title='B-Spline End Conditions',legend=.true.)
59-
call plt%add_plot(real(x*rad2deg,real64),real(fcn_1d,real64),&
58+
call plt%add_plot(x*rad2deg,fcn_1d,&
6059
label='Function $f(x) = \sin(x)$',&
6160
linestyle='ko',markersize=5,linewidth=2,istat=istat)
6261

@@ -183,7 +182,7 @@ program dbint4_test
183182
!write(*,*) ''
184183
!write(*,*) '==============================================='
185184

186-
call plt%add_plot(real(xval*rad2deg,real64),real(fval,real64),&
185+
call plt%add_plot(xval*rad2deg,fval,&
187186
label=trim(labels(icase)),&
188187
linestyle=linestyles(icase),linewidth=2,istat=istat)
189188

test/knot_tests.f90

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ program knot_tests
1414
use bspline_module
1515
use bspline_kinds_module, only: wp, ip
1616
use pyplot_module
17-
use, intrinsic :: iso_fortran_env
1817

1918
implicit none
2019

@@ -41,7 +40,7 @@ program knot_tests
4140
!initialize the plot:
4241
call plt%initialize(grid=.true.,xlabel='x',ylabel='f(x)',&
4342
title='Knot Test',legend=.true.)
44-
call plt%add_plot(real(x,real64),real(fcn,real64),&
43+
call plt%add_plot(x,fcn,&
4544
label='Function $f(x) = \sin(x \cdot \pi/18)$ : $x=[0,20,40,60,80,100]$',&
4645
linestyle='ko--',markersize=5,linewidth=2,istat=istat)
4746

@@ -83,13 +82,13 @@ program knot_tests
8382

8483
!call plt%add_plot(x_new,f_actual,label='Actual function',linestyle='k--',linewidth=2)
8584

86-
call plt%add_plot(real(x_new,real64),real(f_new_default,real64),&
85+
call plt%add_plot(x_new,f_new_default,&
8786
label='Interpolated : $t_x=[0,0,0,0,40,60,102,102,102,102]$ (Default)',&
8887
linestyle='b-',linewidth=1,istat=istat)
89-
call plt%add_plot(real(x_new,real64),real(f1,real64),&
88+
call plt%add_plot(x_new,f1,&
9089
label='Interpolated : $t_x=[0,0,0,0,20,40,101,101,101,101]$',&
9190
linestyle='r-',linewidth=1,istat=istat)
92-
call plt%add_plot(real(x_new,real64),real(f2,real64),&
91+
call plt%add_plot(x_new,f2,&
9392
label='Interpolated : $t_x=[0,0,0,0,60,80,101,101,101,101]$',&
9493
linestyle='g-',linewidth=1,istat=istat)
9594

test/speed_test.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ program bspline_speed_test
1010
use bspline_module
1111
use bspline_kinds_module, only: wp, ip
1212
use pyplot_module
13-
use, intrinsic :: iso_fortran_env
1413

1514
implicit none
1615

@@ -317,7 +316,7 @@ program bspline_speed_test
317316
axes_labelsize = 20,&
318317
xtick_labelsize = 20,&
319318
ytick_labelsize = 20)
320-
call plt%add_bar(x=real([1,2,3,4,5,6],real64),height=real(cases_per_sec,real64),&
319+
call plt%add_bar(x=real([1,2,3,4,5,6],wp),height=cases_per_sec,&
321320
label='Speed test runs',&
322321
yscale='log',align='center',color='r',istat=istat)
323322
call plt%savefig('speed_test.png',istat=istat)

test/speed_test_oo.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ program bspline_speed_test_oo
1010
use bspline_module
1111
use bspline_kinds_module, only: wp, ip
1212
use pyplot_module
13-
use, intrinsic :: iso_fortran_env
1413

1514
implicit none
1615

@@ -248,7 +247,7 @@ program bspline_speed_test_oo
248247
axes_labelsize = 20,&
249248
xtick_labelsize = 20,&
250249
ytick_labelsize = 20)
251-
call plt%add_bar(x=real([1,2,3,4,5,6],real64),height=real(cases_per_sec,real64),&
250+
call plt%add_bar(x=real([1,2,3,4,5,6],wp),height=cases_per_sec,&
252251
label='Speed test runs',&
253252
yscale='log',align='center',color='r',istat=istat)
254253
call plt%savefig('speed_test_oo.png',istat=istat)

0 commit comments

Comments
 (0)