6

I have two different modules each one has the same subroutine. main program will call one of them based on a certain condition. I want to avoid renaming each of these subroutine to a different name.

1
  • 1
    You need to post some bare code and have you tried the USE statement defining aliases? Commented Jan 25, 2015 at 7:29

1 Answer 1

10

If you have two modules A and B containing the same method foo() then first you can create a local alias with

program SOModNames
use A, fooA => foo
use B, fooB => foo
implicit none

! Variables
real X(10), Y(10)

call fooA(X,10)
call fooB(Y,10)

end program SOModNames

Unofrtunatelty you cannot scope to a module with call A::foo(X,10) for example.

Sign up to request clarification or add additional context in comments.

1 Comment

Please answer this question too :) stackoverflow.com/questions/28134327/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.