Topic: QUADPACK in SF => SIGSEGV error
Has anyone tried using QUADPACK integration routines in SF?
I wrote a simple test program trying to make QUADPACK work. After locating plenty of additional subroutines (for example, reference BLAS and XERROR from Netlib), my program finally compiles okay, but when I try to run it, I obtain the following error message:
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 ffffffff
My program and modules are below:
program quadpacktest
use testmodule
use constants
implicit none
real (dp) :: x, y
real (dp) :: a, b, epsabs, epsrel, abserr, ier, work
integer :: neval, key, limit, lenw, last, iwork
x=2.0_dp
a=0.0_dp
b=1.0_dp
epsabs=1.0e-3_dp
epsrel=1.0e-3_dp
key=2
limit=100
lenw=400
iwork=100
call dqag(testfunction,a,b,epsabs,epsrel,key,y,abserr,neval,ier,limit,lenw,last,iwork,work)
write(*,*) y
end program quadpacktest
module testmodule
use constants
implicit none
contains
pure function testfunction(x) result(y)
real (dp), intent(in) :: x
real (dp) :: y
y=x**1.5_dp
end function testfunction
end module testmodule
module constants
implicit none
integer, parameter, public :: dp = kind(0.d0)
real (dp), parameter, public :: pi = 3.1415926535897932_dp, e=1.602176462e-19_dp, kb=1.3806503e-23_dp
end module constants