<?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 Understanding of Common block and how it is used in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780166#M27205</link>
    <description>&lt;P&gt;Thanks, but this does not seem to work, perhaps it does not work if there are any comments placed between the if and endif commands?&lt;/P&gt;</description>
    <pubDate>Wed, 07 Dec 2011 13:30:43 GMT</pubDate>
    <dc:creator>mechprog</dc:creator>
    <dc:date>2011-12-07T13:30:43Z</dc:date>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780158#M27197</link>
      <description>Hello all,&lt;BR /&gt;&lt;BR /&gt;I am just trying to fully understand the physical meaning of code such as:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;common/example/Wear(lines, 50)&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;Does this mean that&lt;BR /&gt;1) Common is used as a temp place to hold values&lt;BR /&gt;2) example is the name of common block&lt;BR /&gt;3) Wear is the argument which is an array with lines, 50 (i.e. matrix with "lines" (rows) by "50" columns&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 07 Dec 2011 10:36:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780158#M27197</guid>
      <dc:creator>mechprog</dc:creator>
      <dc:date>2011-12-07T10:36:46Z</dc:date>
    </item>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780159#M27198</link>
      <description>Hello&lt;BR /&gt;&lt;BR /&gt;For me, fortran common block can be understood as C global variables that can be shared between procedures.</description>
      <pubDate>Wed, 07 Dec 2011 10:41:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780159#M27198</guid>
      <dc:creator>GVautier</dc:creator>
      <dc:date>2011-12-07T10:41:30Z</dc:date>
    </item>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780160#M27199</link>
      <description>A COMMON block as in the fragment above is an old way of reserving memory that can be&lt;BR /&gt;accessed in any subroutine or other program units that include such a declaration. This way &lt;BR /&gt;you can make data available in these units.&lt;BR /&gt;&lt;BR /&gt;The rules for COMMON blocks allow a great deal of freedom, but in general:&lt;BR /&gt;- Make sure you use the same COMMON block declaration anywhere in the program&lt;BR /&gt; (If you do not, you are on your own). This includes: names, types, ordering&lt;BR /&gt;- Best way to guarantee the above: use INCLUDE&lt;BR /&gt;- (In new code) do not use them, use module variables instead&lt;BR /&gt;&lt;BR /&gt;In your fragment, /example/ is the name of the COMMON block indeed and "wear" is the&lt;BR /&gt;name of a two-dimensional array.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Wed, 07 Dec 2011 10:43:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780160#M27199</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2011-12-07T10:43:27Z</dc:date>
    </item>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780161#M27200</link>
      <description>Ok thanks,&lt;BR /&gt;&lt;BR /&gt;I want to see exactly what my code is doing and calculating, I know I can use the following command to print out theFortan subroutine whilst it is in action by using&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fxfortran]write (7,*) "number is ' Number[/fxfortran]&lt;/PRE&gt;&lt;BR /&gt;But how do I print out arrays?&lt;BR /&gt;&lt;BR /&gt;e.g. &lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fxfortran]      Wear(ind,step)=Wear(i,step)-(X*Y*Z)
      inc(ind) =inc(ind)-(X*Y*Z)[/fxfortran]&lt;/PRE&gt;&lt;BR /&gt;As I do not fully understand the calculations it is doing and how it looks. Thanks.</description>
      <pubDate>Wed, 07 Dec 2011 12:30:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780161#M27200</guid>
      <dc:creator>mechprog</dc:creator>
      <dc:date>2011-12-07T12:30:39Z</dc:date>
    </item>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780162#M27201</link>
      <description>You can print array variables by just including the array name in the I/O list, e.g.,&lt;BR /&gt;&lt;BR /&gt; write(*,*) inc, Wear&lt;BR /&gt;&lt;BR /&gt;However, it is common in older Fortran programs to have the declared size of arrays to be greater than the portion in use in a specific calculation. Here the use of array expressions as subscripts or implied DO loops is indicated. &lt;BR /&gt;&lt;BR /&gt;You should probably work through a Fortran tutorial and consult textbooks and language manuals if these concepts are unfamiliar to you.&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Dec 2011 12:41:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780162#M27201</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-12-07T12:41:06Z</dc:date>
    </item>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780163#M27202</link>
      <description>&lt;P&gt;In fortran is there any way of commenting out multiply lines of code without having to put a "C" at the beginning of every line? If I have over 100 lines to comment out (during debugging), then it takes a while.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2011 12:57:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780163#M27202</guid>
      <dc:creator>mechprog</dc:creator>
      <dc:date>2011-12-07T12:57:57Z</dc:date>
    </item>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780164#M27203</link>
      <description>No, there is no "block comment". &lt;BR /&gt;&lt;BR /&gt;A possible workaround is:&lt;BR /&gt;&lt;BR /&gt;if ( .false. ) then&lt;BR /&gt; ... put the code that you do not want to execute here&lt;BR /&gt;endif &lt;BR /&gt;&lt;BR /&gt;(In fixed form there is a non-standard feature to put a "D" instead of a "C"&lt;BR /&gt;in the first column - such lines are only treated as valid code when you ask&lt;BR /&gt;the compiler nicely to include them, but I find that practice highly confusing.)&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Wed, 07 Dec 2011 13:01:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780164#M27203</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2011-12-07T13:01:56Z</dc:date>
    </item>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780165#M27204</link>
      <description>You can use compiler directives&lt;BR /&gt;&lt;BR /&gt;Fixed form:&lt;BR /&gt;&lt;BR /&gt;cDEC$ IF(.false.)&lt;BR /&gt;...&lt;BR /&gt;cDEC$ ENDIF&lt;BR /&gt;&lt;BR /&gt;Free form:&lt;BR /&gt;&lt;BR /&gt;!DEC$ IF(.false.)&lt;BR /&gt;...&lt;BR /&gt;!DEC$ ENDIF&lt;BR /&gt;&lt;BR /&gt;RE: COMMON blocks&lt;BR /&gt;&lt;BR /&gt;If you are a C/C++ programmer, named common blocks are equivilent to C/C++ named static UNIONS of structs. Example&lt;BR /&gt;&lt;BR /&gt;Source 1&lt;BR /&gt;COMMON /FOO/ A, B, C, I&lt;BR /&gt;&lt;BR /&gt;Source 2&lt;BR /&gt;COMMON /FOO/ A, B, C, D,I&lt;BR /&gt;&lt;BR /&gt;Is somewhat equivilent to C/C++&lt;BR /&gt;&lt;BR /&gt;union&lt;BR /&gt;{&lt;BR /&gt; struct { float A; float B; float C; int I; } Source1;&lt;BR /&gt; struct { float A; float B; float C; float D; int I; } Source2;&lt;BR /&gt;} FOO;&lt;BR /&gt;&lt;BR /&gt;And where use of I in Source 1 is equivilent to C's FOO.Source1.I&lt;BR /&gt;*** Note that this mapps to the same addres as FOO.Source2.D ***&lt;BR /&gt;&lt;BR /&gt;An alternate view point is through use of void*&lt;BR /&gt;&lt;BR /&gt;entern void* FOO;&lt;BR /&gt;Then Source1 uses a cast on FOO to a source 1 delcared struct produce the mapping, whereas source 2 declaring a different struct to produce a different mapping.&lt;BR /&gt;&lt;BR /&gt;Therefore, as recommended earlier: Use INCLUDE's to define your COMMON's (IOW use but one source file for mapping out the commons. Then assure both (all) sources accessing the COMMON/FOO/ uses the same INCLUDE file.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Wed, 07 Dec 2011 13:23:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780165#M27204</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-12-07T13:23:17Z</dc:date>
    </item>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780166#M27205</link>
      <description>&lt;P&gt;Thanks, but this does not seem to work, perhaps it does not work if there are any comments placed between the if and endif commands?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2011 13:30:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780166#M27205</guid>
      <dc:creator>mechprog</dc:creator>
      <dc:date>2011-12-07T13:30:43Z</dc:date>
    </item>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780167#M27206</link>
      <description>&lt;BR /&gt;I use to complete the includes for common blocks with the definition for each common block of a structure embedding all variables. This practice avoid the non intentional use of a common variable in a procedure and ease the evolution of common block during the development process:&lt;BR /&gt;&lt;BR /&gt;Replacing&lt;BR /&gt;COMMON /FOO/ A, B, C, I&lt;BR /&gt;&lt;BR /&gt;by&lt;BR /&gt;&lt;BR /&gt;type common_foo_type&lt;BR /&gt; ... A,B,C,I&lt;BR /&gt;end type&lt;BR /&gt;&lt;BR /&gt;type (common_foo_type) cf&lt;BR /&gt;&lt;BR /&gt;common /foo/cf&lt;BR /&gt;&lt;BR /&gt;and accessing the variables with cf%a ... &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Dec 2011 13:32:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780167#M27206</guid>
      <dc:creator>GVautier</dc:creator>
      <dc:date>2011-12-07T13:32:36Z</dc:date>
    </item>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780168#M27207</link>
      <description>&lt;P&gt;Either of the techniques proposed by arjenand jim will "work". There is no restriction on what lies between the if and the endif.&lt;BR /&gt;&lt;BR /&gt;If you are using Visual Studio there is a method of commenting blocks of code whereby you hightlight the code you wish to comment out and do ctrl-K ctrl-C.&lt;BR /&gt;To undo the comments highlight the code and do ctrl-K ctrl-U&lt;BR /&gt;&lt;BR /&gt;Les&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2011 14:10:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780168#M27207</guid>
      <dc:creator>Les_Neilson</dc:creator>
      <dc:date>2011-12-07T14:10:03Z</dc:date>
    </item>
    <item>
      <title>Understanding of Common block and how it is used</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780169#M27208</link>
      <description>&lt;P&gt;you also might try to simply replace the common with a module&lt;BR /&gt;module FOO&lt;BR /&gt; implicit none &lt;BR /&gt; Real A,B,C&lt;BR /&gt;end module&lt;BR /&gt;&lt;BR /&gt;then simply insert a &lt;BR /&gt;USE FOO &lt;BR /&gt;into any subroutine that needsaccess to the 'common stroage' and A,B,C are available&lt;BR /&gt;&lt;BR /&gt;One other item to consider:&lt;BR /&gt;In older programs COMMON storage was considered sequential so if there are any equivalences in your code, you need to determine if they used specific parts of arrays for different variable.&lt;BR /&gt;you can still mimic that behavior with a Module and equivalence command, just need to be sure you are handling memory as expected for the older code.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2011 18:45:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Understanding-of-Common-block-and-how-it-is-used/m-p/780169#M27208</guid>
      <dc:creator>bmchenry</dc:creator>
      <dc:date>2011-12-07T18:45:12Z</dc:date>
    </item>
  </channel>
</rss>

