Skip to content

Commit b316855

Browse files
committed
fixed unit tests when compiling with real precision other than real64
updated to latest pyplot-fortran for unit tests
1 parent 2a22f80 commit b316855

File tree

6 files changed

+11
-16
lines changed

6 files changed

+11
-16
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"

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)