import selected module variables within that module's procedures



I wish there were a way to import only a few module variables, derived
types, and procedures into a procedure of the module, for example

module foo_mod
integer :: i,j
contains
subroutine sub()
use foo_mod, only: i ! NOT a legal Fortran 95 statement
end subroutine sub
end module foo_mod

but one cannot write "use foo_mod" within module foo_mod. Is there a
way to get this effect in Fortran 95? Fortran 2003? Could the
"submodule" of TR 19767 accomplish this?

.



Relevant Pages

  • Re: save statement in a module
    ... Having to remember whether a module USE is still in scope ... That's why I think module variables ... Fortran should be changes to require it. ... no deficiencies and the other way is to make it so complicated ...
    (comp.lang.fortran)
  • Re: using C function in fortran code
    ... What are you trying to accomplish? ... what is p in the Fortran program. ... It looks like you are trying to allocate the space for some ... I'm betting that's where your problem lies, ...
    (comp.lang.fortran)