The call to G05FEF is indeed undefined. When you declare implicit none, the Fortran compiler will not make any assumptions about anything, especially the signature of a subroutine. You need to do something such that the Fortran compiler knows what G05FEF is.
The more modern technique would be to place G05FEF in a module:
module my_subroutines
implicit none
contains
subroutine G05FEF(a, b, i, s, fail_flag)
! body of G05FEF
! ...
end subroutine G05FEF
end module my_subroutines
and then your program would just be:
program test
use my_subroutines
implicit none
Double Precision s(10)
INTEGER IFAIL
Call G05FEF(0.5D0,0.5D0,10,s,IFAIL)
print *, "s is", s
end program test
If G05FEF is already in a module, make sure you add the module to your program with a USE statement.
Alternatively, you can create an interface block to define the subroutine in your main program:
program test
implicit none
Double Precision s(10)
INTEGER IFAIL
interface
subroutine G05FEF(a, b, i, s, fail_flag)
real(kind=8)::a, b
integer::i, fail_flag
real(kind=8), dimension(*)::s
end interface
Call G05FEF(0.5D0,0.5D0,10,s,IFAIL)
print *, "s is", s
end program test
It can be a bit messier, but it allows using legacy routines that aren't inside a module.
Jeff Armstrong
Approximatrix, LLC