我想创建一个子程序,将函数作为输出返回.我怎样才能做到这一点?我会举一个例子,说明我认为它应该如何(我知道它写的很糟糕)
module fun_out
contains
subroutine exponential(F,a)
interface, intent(out)
function f(x)
real, intent(in)::x
real :: f(2)
end function
end interface
real,intent(in):: a
F=exp(a*x)
end subroutine exponential
end module
Run Code Online (Sandbox Code Playgroud)
有了这个,我应该从输出中的指数族中获取一个函数.