....
abstract interface
pure function fi(t,u) result (fu)
use NumberKinds
real(kp), dimension(:), intent(in) :: u
real(kp), intent(in) :: t
real(kp), dimension(size(u)) :: fu
end function fi
end interface
contains
pure function rk4_step(u,f,dt) result(un)
use NumberKinds
real(kp), intent(in) :: dt
real(kp), intent(in), dimension(:) :: u
real(kp), dimension(size(u)) :: k1,k2,k3,k4,un
procedure(fi) :: f
integer :: N
...
end function rk4_step
...
我收到 g95 的此错误消息:G95 (GCC 4.0.3 (g95 0.94!) Jan 17 2013)
In file src/integrators.f95:34
pure function rk4_step(u,f,dt) result(un)
1
Error: Dummy procedure 'f' of PURE procedure at (1) must also be PURE
Makefile:28: recipe for target 'test_rk4' failed
我不明白 gfortran:GNU Fortran (GCC) 4.8.2 20140206 (prerelease) 并且程序编译没有进一步的问题