use*_*334 1 fortran overloading interface function subroutine
是否可以使用接口块重载子例程和函数?因此可以通过函数或子例程调用过程.例如:
...
interface TestRoutine
module procedure TestRoutine_fun
module procedure TestRoutine_sub
end interface TestRoutine
Contains
function TestRoutine_fun(....) result(...)
...
end function TestRoutine_fun
subroutine TestRoutine_sub(...)
...
end subroutine TestRoutine_sub
...
Run Code Online (Sandbox Code Playgroud)
当我尝试编译类似于此的代码时,我得到了错误:错误:在通用接口'TestRoutine'中(1),程序必须是所有SUBROUTINES或所有FUNCTIONs.提前致谢!