如果我不幸不得不使用两个具有共同子程序名的不同Fortran90模块,有没有办法区分这两个子程序?
答案 0 :(得分:1)
您可以使用only
:
module m1
contains
subroutine sub
end subroutine
subroutine other_m1
end subroutine
end module
module m2
contains
subroutine sub
end subroutine
subroutine other_m2
end subroutine
end module
use m1, only: sub, other_m1
use m2, only: other2
call sub
end
您还可以在use
声明中重命名其中一个:
use m1
use m2, some_other_name => sub
call sub
end