The name of a subroutine can be a variable in Fortran? [duplicate]
问题 This question already has answers here : How to alias a function name in Fortran (2 answers) Closed 4 years ago . I was wondering if there is something similar to this in Fortran. Of course this example does not compile but I think you can get the idea. program test character(1):: sub sub='A' call sub sub='B' call sub end program subroutine A print*,'OK! A' end subroutine A subroutine B print*,'OK! B' end subroutine B 回答1: You cannot accomplish this by setting a character variable, but you