<?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 Common Statement in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962447#M22108</link>
    <description>How come if I put the same Common header (ex. "Common / bubspec / xlambda, xin, c, rbc, bub") in two different procedures, the values still change?  Is there something I am forgetting to do?</description>
    <pubDate>Thu, 09 Aug 2001 05:13:53 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2001-08-09T05:13:53Z</dc:date>
    <item>
      <title>Common Statement</title>
      <link>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962447#M22108</link>
      <description>How come if I put the same Common header (ex. "Common / bubspec / xlambda, xin, c, rbc, bub") in two different procedures, the values still change?  Is there something I am forgetting to do?</description>
      <pubDate>Thu, 09 Aug 2001 05:13:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962447#M22108</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-09T05:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Common Statement</title>
      <link>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962448#M22109</link>
      <description>I don't understand what you mean by "the values still change"  What behavior are you expecting?  The idea of COMMON is that a common block is shared among all the program units which declare it.  You must make sure that the common block is declared exactly the same way in each program unit.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 09 Aug 2001 05:21:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962448#M22109</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-08-09T05:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Common Statement</title>
      <link>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962449#M22110</link>
      <description>My main goal is to use those variables declared in the common statement, as global variables.  Is that the only way, or is there a simpler way to reach my goal?</description>
      <pubDate>Thu, 09 Aug 2001 05:25:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962449#M22110</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-09T05:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Common Statement</title>
      <link>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962450#M22111</link>
      <description>Well, that's one way.  Another is to declare your variables in a MODULE which you then USE where necessary.&lt;BR /&gt;&lt;BR /&gt;What behavior do you see that you don't expect?&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 09 Aug 2001 05:37:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962450#M22111</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-08-09T05:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Common Statement</title>
      <link>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962451#M22112</link>
      <description>I have the Common header in 2 different procedures, and I read the value in in the first procedure, and use it for calculations in the second.  But when I go to use the variable in the second procedure, its value that was declared in the first procedure is lost, and is set to '0'.  What am I doing wrong, or what am I forgetting to do?</description>
      <pubDate>Fri, 10 Aug 2001 01:09:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962451#M22112</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-10T01:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Common Statement</title>
      <link>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962452#M22113</link>
      <description>Without seeing your actual code, I don't know what you're doing wrong.  Can you post a short (10-20 line) example that demonstrates the problem?  Bracket your code in the post with &lt;PRE&gt; and &lt;/PRE&gt;.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Fri, 10 Aug 2001 01:46:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962452#M22113</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-08-10T01:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Common Statement</title>
      <link>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962453#M22114</link>
      <description>First Procedure  &lt;BR /&gt;  &lt;BR /&gt;&lt;PRE&gt;      INTEGER FUNCTION zref_TF_D1_CB(S)  
      !DEC$ attributes C::zref_TF_D1_CB  
      LOGICAL*1 S(1)  
      CHARACTER*256 S2  
      INTEGER*4 zref  
      Common / refqnt / zref  
      INCLUDE 'FGLUE.INC'  
      INCLUDE 'ADDGLBL.INC'  
      INCLUDE 'GUIDEFS.INC'  
      INCLUDE 'GUI.INC'  
      zref_TF_D1_CB = 1  
      Call TecUtilLockOn()  
      CALL FExtGetCharFromCString(S,S2,ILen)  
      READ(S2(1:ILen),*, IOSTAT=iErr) zref  
      Call TecUtilLockOff()  
      RETURN  
      END&lt;/PRE&gt;  &lt;BR /&gt;  &lt;BR /&gt;Second Procedure  &lt;BR /&gt;  &lt;BR /&gt;&lt;PRE&gt;	Subroutine AssignData ()  
	Integer*4 rgas, unref, tobs, itwod, xref, yref, zref, iseed  
	common / refqnt / yref,zref,sigman,sigmat,pv,s,unref,Fr,we,re  
...  
	open(7,file='D:jpfCavatCavatlarry.inp',status='unknown')  
	write (7,*) xref  
	write (7,*) yref  
	write (7,*) zref  
	close (7)  
...  
&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Aug 2001 02:34:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962453#M22114</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-10T02:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Common Statement</title>
      <link>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962454#M22115</link>
      <description>Ah, that explains it.&lt;BR /&gt;&lt;BR /&gt;Your COMMON statement must be &lt;B&gt;the same&lt;/B&gt; in every routine.  A COMMON declares a shared memory region and the variables are laid out in the region in the order you list them in the COMMON statement.  If you have different variable lists, the variables appear to be in different places.&lt;BR /&gt;&lt;BR /&gt;Usually, one puts COMMON statements in an INCLUDE file and INCLUDEs it in each routine.  As I mentioned earlier, the modern alternative is to have a MODULE which declares the variables, and then you USE the module where needed.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Fri, 10 Aug 2001 02:37:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962454#M22115</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-08-10T02:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Common Statement</title>
      <link>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962455#M22116</link>
      <description>Read in Procedure &lt;BR /&gt;&lt;PRE&gt;      INTEGER FUNCTION zref_TF_D1_CB(S) 
      !DEC$ attributes C::zref_TF_D1_CB 
      LOGICAL*1 S(1) 
      CHARACTER*256 S2 
      INTEGER*4 zref 
      Include 'Common.fi' 
      INCLUDE 'FGLUE.INC' 
      INCLUDE 'ADDGLBL.INC' 
      INCLUDE 'GUIDEFS.INC' 
      INCLUDE 'GUI.INC' 
      zref_TF_D1_CB = 1 
      Call TecUtilLockOn() 
      CALL FExtGetCharFromCString(S,S2,ILen) 
      READ(S2(1:ILen),*, IOSTAT=iErr) zref 
      Call TecUtilLockOff() 
      RETURN 
      END &lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;Write out Procedure &lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt;	Subroutine AssignData () 
	Include 'Common.fi' 
	open(7,file='D:jpfCavatCavatlarry.inp',status='unknown') 
	write (7,*) zref 
	close (7) 
	Return 
	End &lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;Common.fi &lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt; 	Common / turbulence / iturb   
	Common / Param / tobs, iseed 
	Common / bubspec / xlambda, xin, c, rbc, bub 
	Common / bubspec / bubcount 
	Common / refqnt / rref, uref, dref,vref,aref,pinf,tref,rgas,xref 
	common / refqnt / yref,zref,sigman,sigmat,pv,unref,Fr,we,re 
	Common / testing / IMax, JMax, KMax, NumZones, NumVars, Length 
&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;I did what you said and put the common statements in the INCLUDE file and INCLUDEd it in each routine, but the variable is still changing.  Ex. It reads in the value '8', and prints out ' 1.1210388E-44' &lt;BR /&gt; &lt;BR /&gt;Sorry if I am just making something simple complicated &lt;BR /&gt;Jake</description>
      <pubDate>Fri, 10 Aug 2001 03:51:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962455#M22116</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-10T03:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Common Statement</title>
      <link>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962456#M22117</link>
      <description>Add explicit type declarations for all the COMMON variables in Common.fi and remove them, where they appear, in the routines.  You have, for example, Zref declared as Integer in the Read In procedure, but it's not typed at all in the Write procedure, so it is REAL by default.&lt;BR /&gt;&lt;BR /&gt;Get into the habit of putting IMPLICIT NONE just after the SUBROUTINE, FUNCTION or PROGRAM statement throughout your code, and explicitly declare everything. It will save you many headaches.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Fri, 10 Aug 2001 04:04:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Common-Statement/m-p/962456#M22117</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-08-10T04:04:35Z</dc:date>
    </item>
  </channel>
</rss>

