On Feb 22, 2016, at 7:51 AM, Anton Shterenlikht <[log in to unmask]> wrote:
> Does a submodule inherit IMPLICIT NONE from its parent module?
It appears not. The relevant text for IMPLICIT mappings is at the end of 5.7p4:
"the default for a BLOCK construct, internal subprogram, or module subprogram is the mapping in the host scoping unit.”
The inheritance applies only to BLOCK, internal and module subprograms. Not submodules.
>
> C582 of 10-007r1 says "If IMPLICIT NONE is specified in the scoping unit, ...
> there shall be no other IMPLICIT statements in the scoping unit.”
Yes, but even in the module subprogram case, that is a different scoping unit from its host scoping unit (the module). You are allowed to include an IMPLICIT NONE statement in a module subprogram, even if the host module also has an IMPLICIT NONE statement, without violating this constraint.
>
> Note 2.2 of 10-007r1 has:
>
> *quote*
> The module or submodule containing a module subprogram
> is the host scoping unit of the module subprogram.
> *end quote*
So, if the module subprogram is in a submodule, then the submodule is its host scoping unit; an ancestor module is not the host scoping unit.
>
> Is the module and its submodule(s) form the same scoping unit?
> Or different?
Different. The module is the host scoping unit for the submodule, which is a different scoping unit from the scoping unit of the submodule.
Cheers,
Bill
>
> Thanks
>
> Anton
Bill Long [log in to unmask]
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101
|