Two modules with the same name in one program

Some quick comments based on my understanding:

  • Re: question ii. above, the standard states in section 19, “Program units … are global entities of a program.” You will note a MODULE is a program unit. And the standard then states, “The global identifier of an entity shall not be the same as the global identifier of any other entity.” Thus it is nonconforming to have “multiple modules with the same name in one program.”

  • Re: question iii. and “Do we need a construct ABOVE the module level to keep duplicately named modules apart,” this can be among the use cases toward the namespace facility being contemplated for Fortran 202Y. I suggest you add this to this proposal at the J3-Fortran GitHub site and bring it to the attention of @certik, @sblionel et al., in their planning toward Fortran 202Y: Namespaces · Issue #87 · j3-fortran/fortran_proposals · GitHub

1 Like