<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Warning for collision of local variable and host-variable? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105801#M127904</link>
    <description>&lt;P&gt;Shot in the dark... is there a way to have the compiler issue a warning when the name of a local variable (defined in a procedure contained in a module or submodule) collides with the name of another variable in the host module (or parent module, if the procedure is contained in a submodule)?&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;MODULE M
IMPLICIT NONE
INTEGER :: I
CONTAINS
SUBROUTINE S
IMPLICIT NONE
INTEGER :: I
END SUBROUTINE S
END MODULE M&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2016 16:22:53 GMT</pubDate>
    <dc:creator>OP1</dc:creator>
    <dc:date>2016-10-07T16:22:53Z</dc:date>
    <item>
      <title>Warning for collision of local variable and host-variable?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105801#M127904</link>
      <description>&lt;P&gt;Shot in the dark... is there a way to have the compiler issue a warning when the name of a local variable (defined in a procedure contained in a module or submodule) collides with the name of another variable in the host module (or parent module, if the procedure is contained in a submodule)?&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;MODULE M
IMPLICIT NONE
INTEGER :: I
CONTAINS
SUBROUTINE S
IMPLICIT NONE
INTEGER :: I
END SUBROUTINE S
END MODULE M&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 16:22:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105801#M127904</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2016-10-07T16:22:53Z</dc:date>
    </item>
    <item>
      <title>Nope - this is a standard</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105802#M127905</link>
      <description>&lt;P&gt;Nope - this is a standard language feature.relied on by many users.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 16:36:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105802#M127905</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-10-07T16:36:37Z</dc:date>
    </item>
    <item>
      <title>What you can do is in</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105803#M127906</link>
      <description>&lt;P&gt;What you can do is in SUBROUTINE S, after IMPLICIT NONE, is to comment out all the variable declarations. The variables used in S that do not have "not defined" errors have name conflicts. Note, you may also receive type, rank, size, and/or shape error messages and these will mean the name of the variable is defined, but as a different type, rank, size, and/or shape. A few iterations of comment, compile, uncomment some, compile, ... and you should have things sorted out.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 18:36:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105803#M127906</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-10-07T18:36:36Z</dc:date>
    </item>
    <item>
      <title>Thanks Jim for the trick!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105804#M127907</link>
      <description>&lt;P&gt;Thanks Jim for the trick!&lt;/P&gt;

&lt;P&gt;As Steve mentioned, having access to host variables is very useful (and used extensively) - but now having layers of nested submodules makes it a little more 'dangerous'&amp;nbsp; (for lack of a better word) than in the past, since it is easier to forget or lose track of variables declared somewhere else than where the procedure is CONTAINed. Having a warning for this (optionally activated) would be a nice-to-have feature (I don't know if this is feasible though).&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 18:49:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105804#M127907</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2016-10-07T18:49:45Z</dc:date>
    </item>
    <item>
      <title>OP,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105805#M127908</link>
      <description>&lt;P&gt;OP,&lt;/P&gt;

&lt;P&gt;You also have ONLY to exclude those variables from the module not intended. Though in a sub-module it is not possible (to my understanding) to ONLY-fy the parent modules variables.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 20:31:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105805#M127908</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-10-07T20:31:00Z</dc:date>
    </item>
    <item>
      <title>Quote:OP wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105806#M127909</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;OP wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;.. having access to host variables is very useful (and used extensively) - but now having layers of nested submodules makes it a little more 'dangerous'&amp;nbsp; (for lack of a better word) than in the past, since it is easier to forget or lose track of variables declared somewhere else than where the procedure is CONTAINed. Having a warning for this (optionally activated) would be a nice-to-have feature (I don't know if this is feasible though).&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Fortran 2015 extends IMPORT statement to include, "IMPORT, ONLY : list", "IMPORT, NONE", and "IMPORT, ALL" and to apply it to CONTAINed subprogram and BLOCK constructs.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Just like enhanced interoperability with C from Fortran 2015, it will be highly welcome news if Intel implements this feature even before the standard revision is officially released.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 21:22:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105806#M127909</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2016-10-07T21:22:01Z</dc:date>
    </item>
    <item>
      <title>Another option is to put the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105807#M127910</link>
      <description>&lt;P&gt;Another option is to put the module "global" variables in a separate module (data only with an empty contains section). Then in your module USE this data module in the module subroutines making use of the ONLY feature for the variables actually used. This is more work but name conflicts are avoided (you will get an error) AND if you look at the top of any &amp;nbsp;sub-program you can see exactly where every item comes from and what is actually used in the routine.&lt;/P&gt;

&lt;P&gt;The only problem is that you can have USE module_name, ONLY: routine_name and not actually use routine_name as the "warn unused" doesn't &amp;nbsp;cover this case within modules.....&lt;/P&gt;

&lt;P&gt;The Fortran 2015 features FF mentions look really really useful! YES PLEASE.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 22:12:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105807#M127910</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2016-10-07T22:12:07Z</dc:date>
    </item>
    <item>
      <title>This extension of the IMPORT</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105808#M127911</link>
      <description>&lt;P&gt;This extension of the IMPORT statement in Fortran 2015 looks exactly like what I need! Thanks FF for bringing this to my attention.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 23:16:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Warning-for-collision-of-local-variable-and-host-variable/m-p/1105808#M127911</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2016-10-07T23:16:31Z</dc:date>
    </item>
  </channel>
</rss>

