<?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: Miscounting of DO loop counter in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874139#M73196</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/407202"&gt;h.amini&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;&lt;BR /&gt;
&lt;P&gt;Thank you again!&lt;/P&gt;
&lt;P&gt;I am not using commercial libraries. Inside my program batch files are generated which run a commercial finite element software. Then my program reads the data file generated by the software and re-run it. It is in fact an iterative procedure.&lt;/P&gt;
&lt;P&gt;I am checking the subroutine FOS and keep you update.&lt;/P&gt;
&lt;P&gt;Hamid&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;P&gt;Hi Steve&lt;/P&gt;
&lt;P&gt;I've got interesting results! The problem inside FOS is solved by returning before the last line "SF = MIN(SF1_TEMP,SF2_TEMP,SF3_TEMP,SF4_TEMP)". I thought it might be cause of the large value of SF1_TEMP, SF2_TEMP, SF3_TEMP and SF4_TEMP when zero strain is obtained. So I added ";&lt;STRONG&gt;pause"&lt;/STRONG&gt; after each 1E38 in FOS but another subroutine inside the program got a problem just by doing that!&lt;/P&gt;
&lt;P&gt;I also replaced 1E38 with smaller values (1E8 &amp;amp; 10D.0) and got the same error.&lt;/P&gt;
&lt;P&gt;I tried all the above things when the loops are defined in subroutine FA_DIANA and for all cases the program worked correctly. The pause commands also showed that zero strains were obtained.&lt;/P&gt;
&lt;P&gt;What do you think about it? Is it possible that I spot a bug in the compiler?&lt;/P&gt;
&lt;P&gt;Hamid&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2009 17:09:16 GMT</pubDate>
    <dc:creator>h_amini</dc:creator>
    <dc:date>2009-11-30T17:09:16Z</dc:date>
    <item>
      <title>Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874134#M73191</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;
&lt;P&gt;In the following loops, the values of the counters are dependent on the commands inside the loops. For instance if line 20 is commented it works well, but if line 10 is commented instead, I1 will be always 1 and I2 will vary from 1 to 150 and then access violation occurs as the counter exceeds the arrays' size.&lt;/P&gt;
&lt;P&gt; &lt;B&gt;DO&lt;/B&gt; I1 = 1, NRCONCELEM ! Loop over concrete elements&lt;/P&gt;
&lt;P&gt; &lt;B&gt;DO&lt;/B&gt; I2 = 1, INTPT ! Loop over Gauss points&lt;/P&gt;
&lt;P&gt;10 &lt;B&gt;print&lt;/B&gt;*,'hi',I1,I2&lt;/P&gt;
&lt;P&gt;!20 &lt;B&gt;print&lt;/B&gt;*,I1,I2&lt;/P&gt;
&lt;P&gt; EPSD_ = EPSD(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; EPSR_ = EPSR(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; EPSL_ = EPSL(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; EPST_ = EPST(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; &lt;B&gt;CALL&lt;/B&gt; FOS(SF, EPSD_, EPSR_, EPSL_, EPST_, EPSDPER, EPSRPER,&lt;/P&gt;
&lt;P&gt; &amp;amp; EPSLPER, EPSTPER) ! Calculate SF&lt;/P&gt;
&lt;P&gt; &lt;B&gt;END DO&lt;/B&gt;&lt;/P&gt;
&lt;P&gt; &lt;B&gt;END DO&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Similar problem happens if line 10 is commented only but the arrays are echoed afterwards by:&lt;/P&gt;
&lt;P&gt; &lt;B&gt;PRINT&lt;/B&gt;*, EPSD(ELEMNRCONC(I1),I2); &lt;B&gt;PRINT&lt;/B&gt;*, EPSR(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; &lt;B&gt;PRINT&lt;/B&gt;*, EPSL(ELEMNRCONC(I1),I2); &lt;B&gt;PRINT&lt;/B&gt;*, EPST(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Interestingly if the forth PRINT is omitted it again works well!&lt;/P&gt;
&lt;P&gt;I use Visual Fortran Compiler Ver. 11.0.072 on IA-32 and would appreciate your comments very much.&lt;/P&gt;
&lt;P&gt;Just as a guess, can using a large number of variables be the reason? If so, what is the solution?&lt;/P&gt;
&lt;P&gt;Many thanks&lt;/P&gt;
&lt;P&gt;Hamid&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2009 11:50:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874134#M73191</guid>
      <dc:creator>h_amini</dc:creator>
      <dc:date>2009-11-30T11:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874135#M73192</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;It is impossible to analyze such a problem from a small code excerpt. A buildable and runnable test case would be needed. However, I'll comment that I have seen such issues before when there is a calling convention mismatch, such as calling a STDCALL routine without declaring it as such to Fortran. Also, an argument type or size mismatch can cause such problems. Does commenting out the call to FOS make this particular error go away?&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Nov 2009 14:52:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874135#M73192</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-11-30T14:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874136#M73193</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;&lt;BR /&gt;It is impossible to analyze such a problem from a small code excerpt. A buildable and runnable test case would be needed. However, I'll comment that I have seen such issues before when there is a calling convention mismatch, such as calling a STDCALL routine without declaring it as such to Fortran. Also, an argument type or size mismatch can cause such problems. Does commenting out the call to FOS make this particular error go away?&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;P&gt;Many thanks Steve.&lt;/P&gt;
&lt;P&gt;Yes commenting out &lt;STRONG&gt;&lt;EM&gt;CALL&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; FOS&lt;/EM&gt; solves the problem. Also if I define these tow loops inside a subroutine the problem is solved for all the mentioned cases:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; &lt;STRONG&gt;SUBROUTINE&lt;/STRONG&gt; FA_DIANA(NRCONCELEM, INTPT, EPSD_, EPSR_, EPSL_, EPST_,&lt;/P&gt;
&lt;P&gt; &amp;amp; SF, EPSDPER, EPSRPER, EPSLPER, EPSTPER)&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;USE&lt;/STRONG&gt; GLOBALDATA&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;IMPLICIT NONE&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; ! Variables&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;DOUBLE PRECISION&lt;/STRONG&gt; SF, EPSD_, EPSR_, EPSL_, EPST_, EPSDPER, EPSRPER,&lt;/P&gt;
&lt;P&gt; &amp;amp; EPSLPER, EPSTPER&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;INTEGER&lt;/STRONG&gt;, &lt;STRONG&gt;INTENT&lt;/STRONG&gt;(INOUT) :: INTPT&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;INTEGER&lt;/STRONG&gt; I1, I2&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;INTEGER&lt;/STRONG&gt;(kind=4), &lt;STRONG&gt;INTENT&lt;/STRONG&gt;(INOUT) :: NRCONCELEM&lt;/P&gt;
&lt;P&gt; ! Fill A_DIANA&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;DO&lt;/STRONG&gt; I1 = 1, NRCONCELEM ! Loop over concrete elements&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;DO&lt;/STRONG&gt; I2 = 1, INTPT ! Loop over Gauss points&lt;/P&gt;
&lt;P&gt; !print*,'hi',I1,I2&lt;/P&gt;
&lt;P&gt; !print*,I1,I2&lt;/P&gt;
&lt;P&gt; ! PRINT*, EPSD(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; ! PRINT*, EPSR(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; ! PRINT*, EPSL(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; ! PRINT*, EPST(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; EPSD_ = EPSD(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; EPSR_ = EPSR(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; EPSL_ = EPSL(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; EPST_ = EPST(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;CALL&lt;/STRONG&gt; FOS(SF, EPSD_, EPSR_, EPSL_, EPST_, EPSDPER, EPSRPER,&lt;/P&gt;
&lt;P&gt; &amp;amp; EPSLPER, EPSTPER) ! Calculate SF&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;IF&lt;/STRONG&gt; (SF .GE. 1) &lt;STRONG&gt;THEN&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; A_DIANA(ELEMNRCONC(I1),I2) = 1 ! Valid solution&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;ELSE&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; A_DIANA(ELEMNRCONC(I1),I2) = 0 ! Not a valid solution&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END IF&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;print&lt;/STRONG&gt;*, ELEMNRCONC(I1), A_DIANA(ELEMNRCONC(I1),I2), SF&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END DO&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END DO&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;RETURN&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END SUBROUTINE&lt;/STRONG&gt; FA_DIANA&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Subroutine FOS is very simple and it seems there is not any size or argument mismatch. I don't know what calling convention mismatch is, so if you think the problem is because of that could you explain it. I cannot post my program as it has about 8000 lines and works in conjunction with a commercial software. Subroutine FOS is:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;STRONG&gt;SUBROUTINE&lt;/STRONG&gt; FOS(SF, EPSD_, EPSR_, EPSL_, EPST_, EPSDPER, EPSRPER,&lt;/P&gt;
&lt;P&gt; &amp;amp; EPSLPER, EPSTPER)&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;USE&lt;/STRONG&gt; GLOBALDATA&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;IMPLICIT NONE&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; ! Precision constants&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;DOUBLE PRECISION&lt;/STRONG&gt; SF, EPSD_, EPSR_, EPSL_, EPST_, EPSDPER, EPSRPER,&lt;/P&gt;
&lt;P&gt; &amp;amp; EPSLPER, EPSTPER, MIN_EPS, MAX_EPS,&lt;/P&gt;
&lt;P&gt; &amp;amp; SF1_TEMP, SF2_TEMP, SF3_TEMP, SF4_TEMP&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt; ! Maximum and minimum strains in concrete&lt;/P&gt;
&lt;P&gt; MIN_EPS = MIN(EPSD_,EPSR_)&lt;/P&gt;
&lt;P&gt; MAX_EPS = MAX(EPSD_,EPSR_)&lt;/P&gt;
&lt;P&gt;!______________________________&lt;/P&gt;
&lt;P&gt; ! Safety factors&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;IF&lt;/STRONG&gt; (MIN_EPS .EQ. 0.D0) &lt;STRONG&gt;THEN&lt;/STRONG&gt; ! Zero strain&lt;/P&gt;
&lt;P&gt; SF1_TEMP = 1E38&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;ELSE&lt;/STRONG&gt; ! Nonzero strain&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;IF&lt;/STRONG&gt; (MIN_EPS .GT. 0.D0) &lt;STRONG&gt;THEN&lt;/STRONG&gt; ! Tensile strain&lt;/P&gt;
&lt;P&gt; SF1_TEMP = EPSRPER / MIN_EPS&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;ELSE&lt;/STRONG&gt; ! Compressive strain&lt;/P&gt;
&lt;P&gt; SF1_TEMP = EPSDPER / MIN_EPS&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END IF&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END IF&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;!______________________________&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;IF&lt;/STRONG&gt; (MAX_EPS .EQ. 0.D0) &lt;STRONG&gt;THEN&lt;/STRONG&gt; ! Zero strain&lt;/P&gt;
&lt;P&gt; SF2_TEMP = 1E38&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;ELSE&lt;/STRONG&gt; ! Nonzero strain&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;IF&lt;/STRONG&gt; (MAX_EPS .GT. 0.D0) &lt;STRONG&gt;THEN&lt;/STRONG&gt; ! Tensile strain&lt;/P&gt;
&lt;P&gt; SF2_TEMP = EPSRPER / MAX_EPS&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;ELSE&lt;/STRONG&gt; ! Compressive strain&lt;/P&gt;
&lt;P&gt; SF2_TEMP = EPSDPER / MAX_EPS&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END IF&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END IF&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;!______________________________&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;IF&lt;/STRONG&gt; (EPSL_ .EQ. 0.D0) &lt;STRONG&gt;THEN&lt;/STRONG&gt; ! Zero strain&lt;/P&gt;
&lt;P&gt; SF3_TEMP = 1E38&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;ELSE&lt;/STRONG&gt; ! Nonzero strain&lt;/P&gt;
&lt;P&gt; SF3_TEMP = EPSLPER / ABS(EPSL_)&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END IF&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;!______________________________&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;IF&lt;/STRONG&gt; (EPST_ .EQ. 0.D0) &lt;STRONG&gt;THEN&lt;/STRONG&gt; ! Zero strain&lt;/P&gt;
&lt;P&gt; SF4_TEMP = 1E38&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;ELSE&lt;/STRONG&gt; ! Nonzero strain&lt;/P&gt;
&lt;P&gt; SF4_TEMP = EPSTPER / ABS(EPST_)&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END IF&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;!______________________________&lt;/P&gt;
&lt;P&gt; SF = MIN(SF1_TEMP,SF2_TEMP,SF3_TEMP,SF4_TEMP)&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;RETURN&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END SUBROUTINE&lt;/STRONG&gt; FOS&lt;/P&gt;
&lt;P&gt;Thank you!&lt;BR /&gt;Hamid&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2009 15:50:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874136#M73193</guid>
      <dc:creator>h_amini</dc:creator>
      <dc:date>2009-11-30T15:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874137#M73194</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
I think the way I would approach this is to experiment with routine FOS, seeing how much of it is required for the error to appear. You could add a RETURN at the beginning, for example, and then move the RETURN further down the routine to enable more code. &lt;BR /&gt;&lt;BR /&gt;You say that you are using a commercial library. Is it possible that this library was written to be used from a language that requires the STDCALL calling convention? Can you provide a pointer to documentation for it? The results you are seeing look like stack corruption to me.&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Nov 2009 16:03:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874137#M73194</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-11-30T16:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874138#M73195</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;I think the way I would approach this is to experiment with routine FOS, seeing how much of it is required for the error to appear. You could add a RETURN at the beginning, for example, and then move the RETURN further down the routine to enable more code. &lt;BR /&gt;&lt;BR /&gt;You say that you are using a commercial library. Is it possible that this library was written to be used from a language that requires the STDCALL calling convention? Can you provide a pointer to documentation for it? The results you are seeing look like stack corruption to me.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;P&gt;Thank you again!&lt;/P&gt;
&lt;P&gt;I am not using commercial libraries. Inside my program batch files are generated which run a commercial finite element software. Then my program reads the data file generated by the software and re-run it. It is in fact an iterative procedure.&lt;/P&gt;
&lt;P&gt;I am checking the subroutine FOS and keep you update.&lt;/P&gt;
&lt;P&gt;Hamid&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2009 16:11:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874138#M73195</guid>
      <dc:creator>h_amini</dc:creator>
      <dc:date>2009-11-30T16:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874139#M73196</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/407202"&gt;h.amini&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;&lt;BR /&gt;
&lt;P&gt;Thank you again!&lt;/P&gt;
&lt;P&gt;I am not using commercial libraries. Inside my program batch files are generated which run a commercial finite element software. Then my program reads the data file generated by the software and re-run it. It is in fact an iterative procedure.&lt;/P&gt;
&lt;P&gt;I am checking the subroutine FOS and keep you update.&lt;/P&gt;
&lt;P&gt;Hamid&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;P&gt;Hi Steve&lt;/P&gt;
&lt;P&gt;I've got interesting results! The problem inside FOS is solved by returning before the last line "SF = MIN(SF1_TEMP,SF2_TEMP,SF3_TEMP,SF4_TEMP)". I thought it might be cause of the large value of SF1_TEMP, SF2_TEMP, SF3_TEMP and SF4_TEMP when zero strain is obtained. So I added ";&lt;STRONG&gt;pause"&lt;/STRONG&gt; after each 1E38 in FOS but another subroutine inside the program got a problem just by doing that!&lt;/P&gt;
&lt;P&gt;I also replaced 1E38 with smaller values (1E8 &amp;amp; 10D.0) and got the same error.&lt;/P&gt;
&lt;P&gt;I tried all the above things when the loops are defined in subroutine FA_DIANA and for all cases the program worked correctly. The pause commands also showed that zero strains were obtained.&lt;/P&gt;
&lt;P&gt;What do you think about it? Is it possible that I spot a bug in the compiler?&lt;/P&gt;
&lt;P&gt;Hamid&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2009 17:09:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874139#M73196</guid>
      <dc:creator>h_amini</dc:creator>
      <dc:date>2009-11-30T17:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874140#M73197</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Please see if you can construct a self-contained test case. At this point, I still think you have a problem in your code somewhere, but it may not be in the code you have shown. &lt;BR /&gt;</description>
      <pubDate>Mon, 30 Nov 2009 18:15:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874140#M73197</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-11-30T18:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874141#M73198</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Please see if you can construct a self-contained test case. At this point, I still think you have a problem in your code somewhere, but it may not be in the code you have shown. &lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;P&gt;I'm sorry but I don't know self-contained test. I couldn't still find it on the web. Please waitor if you can please explain. I'm not big in programming!&lt;/P&gt;
&lt;P&gt;Many thanks&lt;BR /&gt;Hamid&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2009 18:45:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874141#M73198</guid>
      <dc:creator>h_amini</dc:creator>
      <dc:date>2009-11-30T18:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874142#M73199</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;I mean a small program that has just enough to show the problem. Something I could build and run. Otherwise, you will need to debug the problem on your own since you can't provide us everything.&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Nov 2009 19:42:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874142#M73199</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-11-30T19:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874143#M73200</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/407202"&gt;h.amini&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;P&gt;I'm sorry but I don't know self-contained test. I couldn't still find it on the web. Please waitor if you can please explain. I'm not big in programming!&lt;/P&gt;
&lt;P&gt;Many thanks&lt;BR /&gt;Hamid&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Usually the loop counters get messed up when you have a memory corruption somewhere. The easiest ways to check would be to compile with the -C option and see if you are accessing an array out of bounds. The next problem, and the one that I usually see when I have these errors, is to make sure all the subroutines you are calling have explicit interfaces. If you call a subroutine and pass it arrays that have different ranks or sizes of the dimensions or the wrong number/type of arguments, it will show errors like that.&lt;BR /&gt;&lt;BR /&gt;Tim&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Dec 2009 16:33:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874143#M73200</guid>
      <dc:creator>Tim_Gallagher</dc:creator>
      <dc:date>2009-12-01T16:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874144#M73201</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;&lt;BR /&gt;I mean a small program that has just enough to show the problem. Something I could build and run. Otherwise, you will need to debug the problem on your own since you can't provide us everything.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;P&gt;Hello again&lt;/P&gt;
&lt;P&gt;I am working on the self-contained test. It is very time consuming, but at the moment I got a new strange error. The value of global variables, defined in '&lt;STRONG&gt;MODULE&lt;/STRONG&gt; GLOBALDATA', change if I echo them by &lt;STRONG&gt;PRINT &lt;/STRONG&gt;command inside the program! They don't change if I echo them inside the subroutines.&lt;/P&gt;
&lt;P&gt;Hamid&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2009 18:20:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874144#M73201</guid>
      <dc:creator>h_amini</dc:creator>
      <dc:date>2009-12-01T18:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874145#M73202</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/452217"&gt;tgallagher2114&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;&lt;BR /&gt;Usually the loop counters get messed up when you have a memory corruption somewhere. The easiest ways to check would be to compile with the -C option and see if you are accessing an array out of bounds. The next problem, and the one that I usually see when I have these errors, is to make sure all the subroutines you are calling have explicit interfaces. If you call a subroutine and pass it arrays that have different ranks or sizes of the dimensions or the wrong number/type of arguments, it will show errors like that.&lt;BR /&gt;&lt;BR /&gt;Tim&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;P&gt;Many thanks Tim. Using -C resulted in the following error which I don't know what it is:&lt;/P&gt;
&lt;P&gt;forrtl: severe (408): fort: (4): Variable &lt;UNKNOWN&gt; has substring ending point 7&lt;/UNKNOWN&gt;&lt;/P&gt;
&lt;P&gt;which is greater than the variable length of 6&lt;/P&gt;
&lt;P&gt;Image PC Routine Line Source&lt;/P&gt;
&lt;P&gt;proglinktest01_1. 004C1C9A Unknown Unknown Unknown&lt;/P&gt;
&lt;P&gt;proglinktest01_1. 004BF389 Unknown Unknown Unknown&lt;/P&gt;
&lt;P&gt;proglinktest01_1. 00457AAB Unknown Unknown Unknown&lt;/P&gt;
&lt;P&gt;proglinktest01_1. 00455042 Unknown Unknown Unknown&lt;/P&gt;
&lt;P&gt;proglinktest01_1. 0043A3EA Unknown Unknown Unknown&lt;/P&gt;
&lt;P&gt;proglinktest01_1. 0040128A Unknown Unknown Unknown&lt;/P&gt;
&lt;P&gt;proglinktest01_1. 004C7C43 Unknown Unknown Unknown&lt;/P&gt;
&lt;P&gt;proglinktest01_1. 004AB1CD Unknown Unknown Unknown&lt;/P&gt;
&lt;P&gt;kernel32.dll 7C817077 Unknown Unknown Unknown&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I am double checking the variables used inside the subroutines and will inform you if there is anything wrong.&lt;/P&gt;
&lt;P&gt;Hamid&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2009 18:22:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874145#M73202</guid>
      <dc:creator>h_amini</dc:creator>
      <dc:date>2009-12-01T18:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874146#M73203</link>
      <description>&lt;DIV style="margin: 0px; height: auto;"&gt;&lt;/DIV&gt;
&lt;P&gt;Hi everyone&lt;/P&gt;
&lt;P&gt;Just an update, disabling optimization makes the error go away. For any possible optimization level the program has problem if the loops are defined inside the program.&lt;/P&gt;
&lt;P&gt;Hamid&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2009 15:19:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874146#M73203</guid>
      <dc:creator>h_amini</dc:creator>
      <dc:date>2009-12-02T15:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874147#M73204</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/407202"&gt;h.amini&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;P&gt;Hi everyone&lt;/P&gt;
&lt;P&gt;Just an update, disabling optimization makes the error go away. For any possible optimization level the program has problem if the loops are defined inside the program.&lt;/P&gt;
&lt;P&gt;Hamid&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;P&gt;Even if the optimization is disabled by/Od the global data change unexpectedly. Interestingly only echoing data can cause this problem. For example, when the following loops are defined:&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;DO&lt;/STRONG&gt; I1 = 1, NRCONCELEM ! Loop over concrete elements&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;DO&lt;/STRONG&gt; I2 = 1, INTPT ! Loop over Gauss points&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;PRINT&lt;/STRONG&gt;*,I1,I2,A_DIANA(ELEMNRCONC(I1),I2),A_PROG(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END DO&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END DO&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;the global data change and I get:&lt;/P&gt;
&lt;P&gt;forrtl: error (72): floating overflow&lt;/P&gt;
&lt;P&gt;Image PC Routine Line Source&lt;/P&gt;
&lt;P&gt;proglinktest01_2. 0049AE7E Unknown Unknown Unknown&lt;/P&gt;
&lt;P&gt;I guess in this case some global data are replaced by extremely large ore smallrandom values.&lt;/P&gt;
&lt;P&gt;However, when the outer loop is replaced by updating a counter like i1 as:&lt;/P&gt;
&lt;P&gt; i1 = 0&lt;/P&gt;
&lt;P&gt;1000 i1 = i1+1&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;if&lt;/STRONG&gt; (i1.eq.NRCONCELEM+1) &lt;STRONG&gt;go to&lt;/STRONG&gt; 1001&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;DO&lt;/STRONG&gt; I2 = 1, INTPT ! Loop over Gauss points&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;PRINT&lt;/STRONG&gt;*,I1,I2,A_DIANA(ELEMNRCONC(I1),I2),A_PROG(ELEMNRCONC(I1),I2)&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;END DO&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; &lt;STRONG&gt;go to&lt;/STRONG&gt; 1000&lt;/P&gt;
&lt;P&gt;1001 &lt;STRONG&gt;continue&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The program works perfectly.&lt;/P&gt;
&lt;P&gt;Last year I got a fairly similar error discussed on &lt;A href="http://software.intel.com/en-us/forums/showthread.php?t=61721"&gt;http://software.intel.com/en-us/forums/showthread.php?t=61721&lt;/A&gt; but that problem was due to uninitialized variables.&lt;/P&gt;
&lt;P&gt;Any advice would be very muchappreciated.&lt;/P&gt;
&lt;P&gt;I am still workingon the self-contained test as well as checking the variables inside the subroutines. Is there an straightforward way for checking the variables?&lt;BR /&gt;&lt;BR /&gt;Hamid&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2009 12:33:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874147#M73204</guid>
      <dc:creator>h_amini</dc:creator>
      <dc:date>2009-12-03T12:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Miscounting of DO loop counter</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874148#M73205</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;
&lt;P&gt;I got it! As Steve and Tim said there was a mismatch between the type of one of the arguments inside the program and one of the subroutines. I could find it defining explicit interfaces as Tim advised.&lt;/P&gt;
&lt;P&gt;Many many thanks for your help.&lt;/P&gt;
&lt;P&gt;Hamid&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2009 19:09:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Miscounting-of-DO-loop-counter/m-p/874148#M73205</guid>
      <dc:creator>h_amini</dc:creator>
      <dc:date>2009-12-03T19:09:33Z</dc:date>
    </item>
  </channel>
</rss>

