<?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 Re: Module Public variables OR Common areas ? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854369#M67023</link>
    <description>&lt;P&gt;Thanks Steve.&lt;/P&gt;
&lt;P&gt;Same question about parameters. Some parameters specify array sizes, some are flags, and some are array element pointers. Do you prefer to define these in include files and then include them when needed, or do you prefer to list these in the data space of a module ?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks again,&lt;/P&gt;
&lt;P&gt;- Cliff&lt;/P&gt;</description>
    <pubDate>Thu, 07 Feb 2008 17:02:24 GMT</pubDate>
    <dc:creator>Phares__Cliff</dc:creator>
    <dc:date>2008-02-07T17:02:24Z</dc:date>
    <item>
      <title>Module Public variables OR Common areas ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854367#M67021</link>
      <description>&lt;P&gt;I'm converting a large VMS Fortran process model ofplastics plantto IVF. The legacy codes makes abundant use of common areas.&lt;/P&gt;
&lt;P&gt;I'm finding that I like to pass data between modules using two methods:&lt;/P&gt;
&lt;P&gt;1) create COMMON area .FI's and include them whereever I which; or,&lt;/P&gt;
&lt;P&gt;2) place those COMMON area variables in the MODULE public data space and use USE in other modules.&lt;/P&gt;
&lt;P&gt;Are there other commonly used techniques ?&lt;/P&gt;
&lt;P&gt;In terms of code maintenance, is one method more maintainable than the other ?&lt;/P&gt;
&lt;P&gt;In terms of performance, does one method execute faster ?&lt;/P&gt;
&lt;P&gt;Or is it just a matter of 'taste' ?&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;- Cliff&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2008 13:35:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854367#M67021</guid>
      <dc:creator>Phares__Cliff</dc:creator>
      <dc:date>2008-02-07T13:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Module Public variables OR Common areas ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854368#M67022</link>
      <description>If you are creating new shared variables, make them module variables and not COMMON. If you have existing COMMONs and want to shift to using modules instead of include files, then go ahead and put the COMMONs in modules.&lt;BR /&gt;&lt;BR /&gt;My recommendation, in the absence of other reasons, is to use module variables and not COMMONs, as it allows better control of the namespace. There's no performance difference I can think of.&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Feb 2008 14:25:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854368#M67022</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-02-07T14:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Module Public variables OR Common areas ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854369#M67023</link>
      <description>&lt;P&gt;Thanks Steve.&lt;/P&gt;
&lt;P&gt;Same question about parameters. Some parameters specify array sizes, some are flags, and some are array element pointers. Do you prefer to define these in include files and then include them when needed, or do you prefer to list these in the data space of a module ?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks again,&lt;/P&gt;
&lt;P&gt;- Cliff&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2008 17:02:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854369#M67023</guid>
      <dc:creator>Phares__Cliff</dc:creator>
      <dc:date>2008-02-07T17:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Module Public variables OR Common areas ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854370#M67024</link>
      <description>&lt;P&gt;Cliff&lt;/P&gt;
&lt;P&gt;My preference would be to keep the relevant parameters with the data, ie the sizes and the element pointers in the module(s) containing those arrays. Maintenance is so much easier when it's all in one place (eg array size changes)&lt;BR /&gt;The flags parameters could go in their own module if they are general and do notapply to specific data or contained subroutines/functions.&lt;/P&gt;
&lt;P&gt;Les&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2008 17:20:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854370#M67024</guid>
      <dc:creator>Les_Neilson</dc:creator>
      <dc:date>2008-02-07T17:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Module Public variables OR Common areas ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854371#M67025</link>
      <description>I'm with Les on this one - keep everything together in a module. If you have definitions that are shared among modules, put them in their own module (for example, many people create a KINDS module to define KIND constants and then use those everywhere.)&lt;BR /&gt;&lt;BR /&gt;Don't be afraid to have multiple modules if functional grouping suggests that. The worst thing is to pile everything into one big module.&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Feb 2008 22:08:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854371#M67025</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-02-07T22:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Module Public variables OR Common areas ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854372#M67026</link>
      <description>&lt;P&gt;Just expanding on this thread slightly - what about subroutines and functions within modules?&lt;/P&gt;
&lt;P&gt;I tend to use modules mainly for defining variables and parameters, but I have noticed some people put almost all their executable routineswithin large modules. What are the advantages and disadvantages of this?&lt;/P&gt;
&lt;P&gt;Thanks, David&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2008 00:03:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854372#M67026</guid>
      <dc:creator>DavidWhite</dc:creator>
      <dc:date>2008-02-08T00:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Module Public variables OR Common areas ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854373#M67027</link>
      <description>If the functions are logically grouped with other things in the module, that makes sense. With module procedures you can take advantage of PRIVATE data and routines and expose only the names you want. It can also be cleaner to code as the module routines have access to everything in the module automatically.&lt;BR /&gt;&lt;BR /&gt;Again, it helps if the things in the module are related. For example, you might have a GLUG type and a collection of routines to create and manipulate things of that type. Then it would make sense to package all the GLUG things into a single module.&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Feb 2008 00:48:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854373#M67027</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-02-08T00:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Module Public variables OR Common areas ?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854374#M67028</link>
      <description>&lt;P&gt;To add to what Steve has said, another big advantage of using modules is interface checking. It helped me identifyseveral argumentmismatches.&lt;BR /&gt;Also, I have modules with lots of allocatable (and resizeable)arrays; so I have contained routines to allocate and initialise, deallocate and re-allocatethe arrays. Then there are routines to read the data from file and write the data to file.&lt;BR /&gt;Ifa routine or function only operates on the module data then it makes sense to have it as a contained routine. Some prefer to declare module variables as private and have Get and Set access routines so changing the data becomes deliberate rather than accidental as in the old days of common blocks and subscript errors :-(painful memories of bug hunting.&lt;/P&gt;
&lt;P&gt;Les&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2008 09:04:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Module-Public-variables-OR-Common-areas/m-p/854374#M67028</guid>
      <dc:creator>Les_Neilson</dc:creator>
      <dc:date>2008-02-08T09:04:39Z</dc:date>
    </item>
  </channel>
</rss>

