<?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 Please replace M1 by M2 in in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945695#M91077</link>
    <description>&lt;P&gt;Please replace M1 by M2 in the first bullet, which should read:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;module M1 source. This uses module M2,&amp;nbsp;references subroutine S2, and contains array A1.&amp;nbsp; All objects are public.&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Wed, 12 Mar 2014 23:14:52 GMT</pubDate>
    <dc:creator>L__Richard_L_</dc:creator>
    <dc:date>2014-03-12T23:14:52Z</dc:date>
    <item>
      <title>Inter-Module References</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945694#M91076</link>
      <description>&lt;P&gt;I have modules that reference each other.&amp;nbsp; Is there any way to do this; e.g., pre-compiled modules?&amp;nbsp; My desired code sequence would have the following pattern:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;module M1 source. This uses module M1,&amp;nbsp;references subroutine S2, and contains array A1.&amp;nbsp; All objects are public.&lt;/LI&gt;
	&lt;LI&gt;module M2 source. This uses module M1,&amp;nbsp;contains subroutine S2, and references array A1.&amp;nbsp; All objects are public.&lt;/LI&gt;
	&lt;LI&gt;main program P&amp;nbsp;source.&amp;nbsp; This uses modules M1 and M2 and&amp;nbsp;references subroutine S2 and array A1.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I suspect&amp;nbsp;this will not compile (if I do it in one step)&amp;nbsp;because of the circular references; so, I did not try it.&amp;nbsp; How about the following approach?&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;Compile M1 source as a separate step.&lt;/LI&gt;
	&lt;LI&gt;Compile M2 source as a separate step.&lt;/LI&gt;
	&lt;LI&gt;Compile P source with a command that references the pre-compiled forms of M1 and M2.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;[[I apologize for earlier not submitting this as a separate thread.]]&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 23:10:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945694#M91076</guid>
      <dc:creator>L__Richard_L_</dc:creator>
      <dc:date>2014-03-12T23:10:45Z</dc:date>
    </item>
    <item>
      <title>Please replace M1 by M2 in</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945695#M91077</link>
      <description>&lt;P&gt;Please replace M1 by M2 in the first bullet, which should read:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;module M1 source. This uses module M2,&amp;nbsp;references subroutine S2, and contains array A1.&amp;nbsp; All objects are public.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 12 Mar 2014 23:14:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945695#M91077</guid>
      <dc:creator>L__Richard_L_</dc:creator>
      <dc:date>2014-03-12T23:14:52Z</dc:date>
    </item>
    <item>
      <title>Can't have circular</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945696#M91078</link>
      <description>&lt;P&gt;Can't have circular references, and you can't get around this situation by gaming the compilation order.&amp;nbsp; Suggestion: create a module G.f90 (ie, "globals") which contains data type definitions, defined parameters, array A1, and subroutine S2.&amp;nbsp; Then: Main uses (G, M1, M2), and M1 and M2 both use G.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 23:57:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945696#M91078</guid>
      <dc:creator>Paul_Curtis</dc:creator>
      <dc:date>2014-03-12T23:57:30Z</dc:date>
    </item>
    <item>
      <title>Paul - Thanks - I feared that</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945697#M91079</link>
      <description>&lt;P&gt;Paul - Thanks - I feared that might be the case - can't game compilation order. That seems unfortunate because it would require only a second&amp;nbsp;pass to patch unresolved references.&amp;nbsp; I would hope to see this capability in a future version.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 04:16:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945697#M91079</guid>
      <dc:creator>L__Richard_L_</dc:creator>
      <dc:date>2014-03-13T04:16:54Z</dc:date>
    </item>
    <item>
      <title>I would very much hope not.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945698#M91080</link>
      <description>&lt;P&gt;I would very much hope not!&amp;nbsp; Going the other way - it would be nice if the compiler yelled at me and gave me a good kick up the backside whenever I tried to create a circular module dependency.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 05:09:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945698#M91080</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2014-03-13T05:09:00Z</dc:date>
    </item>
    <item>
      <title>Quote:IanH wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945699#M91081</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;IanH wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I would very much hope not!&amp;nbsp; Going the other way - it would be nice if the compiler yelled at me and gave me a good kick up the backside whenever I tried to create a circular module dependency.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Agreed, you know you have circular references by the symptoms of compile failure rather than just being told how you are being dumb. I guess VS should tell you this when it tried to determine the build order. Perhaps it does if you know the correct things to set????&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 06:08:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945699#M91081</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2014-03-13T06:08:27Z</dc:date>
    </item>
    <item>
      <title>I used a general, easy, but</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945700#M91082</link>
      <description>&lt;P&gt;I used a general, easy,&amp;nbsp;but unpleasant fix to my problem. I merged M1 and M2. This took care of&amp;nbsp;many circular references but left me with a massive and borderline non-maintainable module. Another objection to this approach is that, for practical purposes,&amp;nbsp;it is not extendable; the bigger the module the less mobile it becomes and the greater likelihood of having to add other modules to the mass. Relaxing the anti-circularity rule would avoid all this grief.&lt;/P&gt;

&lt;P&gt;Pulling just&amp;nbsp;the circular pieces into separate modules would overly complicate access to module-level objects.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 07:35:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945700#M91082</guid>
      <dc:creator>L__Richard_L_</dc:creator>
      <dc:date>2014-03-13T07:35:03Z</dc:date>
    </item>
    <item>
      <title>That's why you and many</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945701#M91083</link>
      <description>&lt;P&gt;That's why you and many others, including myself, are keenly awaiting the implementation of submodules from F2008 in Intel's Fortran Composer Studio Parallel Deluxe PQRST with Special Sauce 201X product.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 08:37:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945701#M91083</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2014-03-13T08:37:46Z</dc:date>
    </item>
    <item>
      <title>Quote:IanH wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945702#M91084</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;IanH wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;That's why you and many others, including myself, are keenly awaiting the implementation of submodules from F2008 in Intel's Fortran Composer Studio Parallel Deluxe PQRST with Special Sauce 201X product.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Who blabbed?&amp;nbsp; But note that you have to order the EC (Extra Cheese) option to get that...&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 12:56:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945702#M91084</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-03-13T12:56:13Z</dc:date>
    </item>
    <item>
      <title>I will have to read what</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945703#M91085</link>
      <description>&lt;P&gt;I will have to read what&amp;nbsp;F2008 has&amp;nbsp;to say about submodules. But,&amp;nbsp;the name&amp;nbsp;itself does not immediately&amp;nbsp;suggest&amp;nbsp;a solution to the anti-circularity issue. I hope to be pleasantly surprised.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 21:35:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945703#M91085</guid>
      <dc:creator>L__Richard_L_</dc:creator>
      <dc:date>2014-03-13T21:35:49Z</dc:date>
    </item>
    <item>
      <title>Obviously it may depend on</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945704#M91086</link>
      <description>&lt;P&gt;Obviously it may depend on details you've not stated.&amp;nbsp; But what I imagine you would have is...&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;module M source. This has, at least, array A1 and the interface for a separate module procedure for subroutine S2, plus perhaps other things common to former M1 and M2 and anything that needs to be collectively PUBLIC across former modules M1 and M2.&lt;/LI&gt;
	&lt;LI&gt;submodule SM1, a descendent of module M.&amp;nbsp; This contains the remaining bits of former module M1 not already in module M.&lt;/LI&gt;
	&lt;LI&gt;submodule SM2, another descendent of module M.&amp;nbsp; This contains the body of subroutine S2 and any other bits of former module M2 not already in module M.&lt;/LI&gt;
	&lt;LI&gt;main program P&amp;nbsp;source.&amp;nbsp; This uses module M and&amp;nbsp;references subroutine S2 and array A1&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;(What specifically stops you using Paul's approach in the meantime?)&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 22:54:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945704#M91086</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2014-03-13T22:54:57Z</dc:date>
    </item>
    <item>
      <title>Richard,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945705#M91087</link>
      <description>&lt;P&gt;Richard,&lt;/P&gt;

&lt;P&gt;&amp;gt;&amp;gt;&lt;EM&gt;Another objection to this approach is that, for practical purposes,&amp;nbsp;it is not extendable; the bigger the module the less mobile it becomes and the greater likelihood of having to add other modules to the mass. Relaxing the anti-circularity rule would avoid all this grief.&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;You make things extendable by constructing hierarchies, what you are trying to do is to avoid making hierarchies.&lt;/P&gt;

&lt;P&gt;I use Paul's approach with a globals module, plus at times I go one step further and place the contains section into a separate module. This necessitates inserting interfaces into the data portion of the module.&lt;/P&gt;

&lt;P&gt;Globals.f90&lt;BR /&gt;
	Adata.f90&lt;BR /&gt;
	Acode.f90&lt;BR /&gt;
	Bdata.f90&lt;BR /&gt;
	Bcode.f90&lt;BR /&gt;
	...&lt;/P&gt;

&lt;P&gt;With this construct Acode can USE Bdata, and Bcode can USE Adata with no (compiler) circular dependencies.&lt;/P&gt;

&lt;P&gt;When Acode&amp;nbsp;USEs Bdata it has the interfaces to Bcode and can call anything interfaced in Bdata to Bcode.&lt;BR /&gt;
	Same thing the other way around.&lt;/P&gt;

&lt;P&gt;The globals.f90 would contain the items that are relatively fixed. As changing anything in globals would tend to rebuild all.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2014 13:04:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945705#M91087</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2014-03-14T13:04:54Z</dc:date>
    </item>
    <item>
      <title>Quote:Steve Lionel (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945706#M91088</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;&lt;EM&gt;IanH&lt;/EM&gt; wrote:

	&lt;P&gt;That's why you and many others, including myself, are keenly awaiting the implementation of submodules from F2008 in Intel's Fortran Composer Studio Parallel Deluxe PQRST with Special Sauce 201X product.&lt;/P&gt;

	&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Who blabbed?&amp;nbsp; But note that you have to order the EC (Extra Cheese) option to get that...&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I'd order EC, any other chef's specials, and all the sides, hey the whole works,&amp;nbsp;if I could get my hands on that "sub" !!! :-)&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2014 15:28:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945706#M91088</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-03-14T15:28:08Z</dc:date>
    </item>
    <item>
      <title>Patience, grasshopper. All</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945707#M91089</link>
      <description>&lt;P&gt;Patience, grasshopper. All things in time.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2014 15:52:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945707#M91089</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-03-14T15:52:16Z</dc:date>
    </item>
    <item>
      <title>Quote:Steve Lionel (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945708#M91090</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Patience, grasshopper. All things in time.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;That "patience is a virtue" is largely lost in&amp;nbsp;the technology-driven world of ours -&amp;nbsp;so many&amp;nbsp;now keep "chomping at the bit" for the next new thing, say the&amp;nbsp;next "i" device,&amp;nbsp;but for a simple human like me, it's the next Fortran 2003/2008/201X feature in Intel Fortran!! :-)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2014 21:00:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945708#M91090</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-03-14T21:00:07Z</dc:date>
    </item>
    <item>
      <title>[to jimd] I appreciate your</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945709#M91091</link>
      <description>&lt;P&gt;[to jimd] I appreciate your comments because they seem like a big improvement to what I am doing. I particularly like the way you laid out the suggested pattern.&amp;nbsp;However, I do not understand how Acode.f90 can access data (e.g., types and arrays) in Bdata.f90. Would Acode.f90 have to call getter's and setter's in Bcode.f90 to obtain the access?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2014 22:21:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945709#M91091</guid>
      <dc:creator>L__Richard_L_</dc:creator>
      <dc:date>2014-03-14T22:21:56Z</dc:date>
    </item>
    <item>
      <title>Richard, I'm not sure reading</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945710#M91092</link>
      <description>&lt;P&gt;Richard, I'm not sure reading your original post that Jim's post exactly fully fixes your problem. What he is saying is that by separating the module data (global) declarations into separate modules (ADATA and BDATA) the Modules ACODE and BCODE can then both have USE ADATA and USE BDATA with no circularity.&lt;/P&gt;

&lt;P&gt;I think you also have the problem that you have subroutines that are that are circular in M1 and M2 which cannot be. It may be that you need to move a few subroutines from M2 to M2 or visa versa or if this cannot work fully extract some problem subroutines into M3 where M3 will USE M1 and M2 and sit higher up the build order.&lt;/P&gt;

&lt;P&gt;there is no magic bullet it usually needs a little but of work to sort it out.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2014 23:55:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945710#M91092</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2014-03-14T23:55:14Z</dc:date>
    </item>
    <item>
      <title>Quote:L. Richard L. wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945711#M91093</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;L. Richard L. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;[to jimd] I appreciate your comments because they seem like a big improvement to what I am doing. I particularly like the way you laid out the suggested pattern.&amp;nbsp;However, I do not understand how Acode.f90 can access data (e.g., types and arrays) in Bdata.f90. Would Acode.f90 have to call getter's and setter's in Bcode.f90 to obtain the access?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;[fortran]&lt;/P&gt;

&lt;P&gt;!&amp;nbsp; useAB.f90&lt;BR /&gt;
	program useAB&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; use Interfaces&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; use Adata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; use Bdata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; A = 0.0&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; B = 0.0&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; print *,A,B&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; call Afoo(1.0)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; print *,A,B&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; call Bfoo(2.0)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; print *,A,B&lt;BR /&gt;
	end program useAB&lt;BR /&gt;
	-------------------------&lt;/P&gt;

&lt;P&gt;! Interfaces.f90&lt;BR /&gt;
	module Interfaces&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; interface&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subroutine Afoo(x)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use Adata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use Bdata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real :: x&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end subroutine Afoo&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; end interface&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subroutine Bfoo(x)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use Adata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use Bdata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real :: x&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end subroutine Bfoo&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; end interface&lt;BR /&gt;
	end module Interfaces&lt;BR /&gt;
	---------------------------------&lt;BR /&gt;
	! Adata.f90&lt;BR /&gt;
	module Adata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; real :: A&lt;BR /&gt;
	end module Adata&lt;BR /&gt;
	-----------------------&lt;BR /&gt;
	! Acode.f90&lt;BR /&gt;
	subroutine Afoo(x)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; use Interfaces&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; use Adata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; use Bdata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; real :: x&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; A = A + x&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; B = B + x&lt;BR /&gt;
	end subroutine Afoo&lt;BR /&gt;
	-------------------------&lt;BR /&gt;
	! Bdata.f90&lt;BR /&gt;
	module Bdata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; real :: B&lt;BR /&gt;
	end module Bdata&lt;BR /&gt;
	-----------------------------&lt;BR /&gt;
	! Bcode.f90&lt;BR /&gt;
	subroutine Bfoo(x)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; use Interfaces&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; use Adata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; use Bdata&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; real :: x&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; call Afoo(x * 2.0)&lt;BR /&gt;
	end subroutine Bfoo&lt;BR /&gt;
	[/fortran]&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Mar 2014 16:19:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945711#M91093</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2014-03-15T16:19:11Z</dc:date>
    </item>
    <item>
      <title>(As I'm sure Jim knows - his</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945712#M91094</link>
      <description>&lt;P&gt;(As I'm sure Jim knows - his code is not conforming because there are two interfaces for Afoo and Bfoo visible inside the Afoo and Bfoo subroutines respectively - one from being inside the actual subroutine proper and the other from the relevant interface block.&amp;nbsp; You can prevent this problem from occurring by placing an ONLY clause on the USE Interfaces statements and preventing the relevant interface block from being visible.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Obviously woe betide anyone that manages to get a mismatch between the manually maintained interface block and the actual procedure interface.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Sometimes this approach is unavoidable due to real circular dependencies, but - my view - you need to have a pretty good reason to go down this path.)&lt;/P&gt;</description>
      <pubDate>Sat, 15 Mar 2014 20:21:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945712#M91094</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2014-03-15T20:21:55Z</dc:date>
    </item>
    <item>
      <title>Jim,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945713#M91095</link>
      <description>&lt;P&gt;Jim,&lt;/P&gt;

&lt;P&gt;For the example you provide in Quote #18, it is unclear to me why you need to create interface blocks at all - see Ian's comments on all the potential issues with such an approach.&amp;nbsp; Instead,&amp;nbsp;for your&amp;nbsp;specific example, why won't you utilize host association and make use of a procedure encapsulation module as shown below?&lt;/P&gt;

&lt;P&gt;[fortran]&lt;/P&gt;

&lt;P&gt;!&amp;nbsp; useAB.f90&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; program useAB&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use Adata, only : A&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use Bdata, only : B&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use foo, only : Afoo, Bfoo&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A = 0.0&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B = 0.0&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print *,A,B&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call Afoo(1.0)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print *,A,B&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call Bfoo(2.0)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print *,A,B&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; end program useAB&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; -------------------------&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; ! Adata.f90&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; module Adata&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real :: A&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; end module Adata&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; -----------------------&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; ! Bdata.f90&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; module Bdata&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real :: B&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; end module Bdata&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; -----------------------------&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; ! module that encapsulates procedures&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; module foo&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use Adata, only : A&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use Bdata, only : B&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; contains&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subroutine Afoo(x)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real :: x&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A = A + x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !.. HOST association would provide access to A&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B = B + x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !.. HOST association would provide access to B&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end subroutine Afoo&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -------------------------&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ! Bcode.f90&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subroutine Bfoo(x)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; implicit none&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real :: x&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call Afoo(x * 2.0)&amp;nbsp;&amp;nbsp;&amp;nbsp;!.. HOST association should provide an explicit&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ! &amp;nbsp; interface to Afoo&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end subroutine Bfoo&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; end module foo&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;[/fortran]&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Separately, it is unclear to me if Jim's example adequately captures the&amp;nbsp;circular dependency issues&amp;nbsp;faced by&amp;nbsp;L. Richard L.&amp;nbsp;&amp;nbsp;Otherwise,&amp;nbsp;Richard&amp;nbsp;needs to present a real case with actual code that fails to compile and the readers can evaluate if there is a good scheme to overcome the issue.&lt;/P&gt;

&lt;P&gt;I strongly feel one should:&lt;/P&gt;

&lt;OL&gt;
	&lt;LI&gt;make good use of host association; it also comes in handy in inlining code, especially for frequently invoked procedures e.g., utilities, math functions, etc.,&lt;/LI&gt;
	&lt;LI&gt;steer away from INTERFACE blocks as much as possible, and&lt;/LI&gt;
	&lt;LI&gt;always apply the ONLY attribute on USE statements&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Mar 2014 21:38:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Inter-Module-References/m-p/945713#M91095</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-03-15T21:38:02Z</dc:date>
    </item>
  </channel>
</rss>

