<?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: Strange bug: need to duplicate lines of code. Help? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866554#M70878</link>
    <description>Thanks for the tips.&lt;BR /&gt;&lt;BR /&gt;I am now debugging it with all the options, as you suggest, and I already found a number of problems with array sizes being passed between subroutines (luckily most of these problems were not due to my own programming!).&lt;BR /&gt;&lt;BR /&gt;Thanks for pointing out that this is likely due to initialization problems, I now finally understand that the debugger inits to 0.0, while the Release version does not. This is very helpful.&lt;BR /&gt;&lt;BR /&gt;The questions you asked about code bit #2 are all OK, by the way. The indexing (I-1) starts at I=2, and PI is a constant declared in an INCLUDE file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 01 Jul 2008 02:11:23 GMT</pubDate>
    <dc:creator>remkoduursma</dc:creator>
    <dc:date>2008-07-01T02:11:23Z</dc:date>
    <item>
      <title>Strange bug: need to duplicate lines of code. Help?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866547#M70871</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I have a problem in my code, and have no idea what to look for. The program compiles fine, but at runtime gives NaN for some calculations. I tracked these down to the source, and found 3 instances where all variables going into the calculation are fine (using the debugger), but the result is NaN anyway. I copied the bit of code where this happens to immediately below it, so now it is in there twice. And now it works fine!&lt;BR /&gt;&lt;BR /&gt;What kind of problem should I be looking for?&lt;BR /&gt;&lt;BR /&gt;All of the code has the fixed format, it has evolved from fortran77 code. There are many subroutines and functions, but no other 'fancy' stuff. It just reads text files, does lots of computations, and writes output text files.&lt;BR /&gt;&lt;BR /&gt;thanks for your help,&lt;BR /&gt;&lt;BR /&gt;Remko&lt;BR /&gt;&lt;BR /&gt;Compiler version:&lt;BR /&gt;Intel Fortran Compiler Integration for Microsoft Visual Studio 2005, 10.1.4156.2005&lt;BR /&gt;&lt;BR /&gt;System:&lt;BR /&gt;OS Name Microsoft Windows XP Professional&lt;BR /&gt;Version 5.1.2600 Service Pack 2 Build 2600&lt;BR /&gt;System Type X86-based PC&lt;BR /&gt;Processor x86 Family 6 Model 15 Stepping 11 GenuineIntel ~2194 Mhz&lt;BR /&gt;Processor x86 Family 6 Model 15 Stepping 11 GenuineIntel ~2194 Mhz&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Jun 2008 04:06:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866547#M70871</guid>
      <dc:creator>remkoduursma</dc:creator>
      <dc:date>2008-06-30T04:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Strange bug: need to duplicate lines of code. Help?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866548#M70872</link>
      <description>&lt;P&gt;Remko,&lt;/P&gt;
&lt;P&gt;Could you copy and paste the calculations for us to look at?&lt;/P&gt;
&lt;P&gt;I've had similar cases where IMPLICIT NONE was not used and where the source line was too large causing a symbol to straddle the end of line column. The result being the debugger using the whole word (symbol) but the compiler using the truncated symbol (which is undefined). Check your line lengths.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2008 12:18:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866548#M70872</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2008-06-30T12:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Strange bug: need to duplicate lines of code. Help?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866549#M70873</link>
      <description>&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;I never used IMPLICIT NONE and your comment is a little worrying. Could this cause a difference in runtime behavior between a release version and debug version (something I have had a lot of trouble with)? Could you explain a little bit more. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2008 17:10:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866549#M70873</guid>
      <dc:creator>jarvusluntatintel</dc:creator>
      <dc:date>2008-06-30T17:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Strange bug: need to duplicate lines of code. Help?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866550#M70874</link>
      <description>I checked the line lengths, they are fine. The calculations are also trivial - and they used to work fine before the program got expanded.&lt;BR /&gt;&lt;BR /&gt;Do you in general recommend strongly to use IMPLICIT NONE? &lt;BR /&gt;Right now, we don't use any IMPLICIT statement.&lt;BR /&gt;&lt;BR /&gt;Anyway here they are:&lt;BR /&gt;&lt;BR /&gt;1:&lt;BR /&gt;EPSIL = (23.452294- (1.30125E-2+ (1.64E-6-5.03E-7*T)*T)*T)*PID180&lt;BR /&gt;&lt;BR /&gt;2:&lt;BR /&gt; SOILTEMP_NPLUS1(I) = (D / (1 + 2*BETA*D))&lt;BR /&gt; &amp;amp; * (BETA*(SOILTEMP_NPLUS1(I+1)&lt;BR /&gt; &amp;amp; + SOILTEMP_NPLUS1(I-1))&lt;BR /&gt; &amp;amp; + (1-BETA) * (SOILTEMP(I+1)&lt;BR /&gt; &amp;amp; - 2*SOILTEMP(I) + SOILTEMP(I-1)))&lt;BR /&gt; &amp;amp; + SOILTEMP(I)/(1+2*BETA*D)&lt;BR /&gt;&lt;BR /&gt;3:&lt;BR /&gt;V1 = PI*RX1*RY1*(HUP-(HUP**2/RZ1)+(HUP**3)/(3*RZ1**2))&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Jul 2008 00:20:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866550#M70874</guid>
      <dc:creator>remkoduursma</dc:creator>
      <dc:date>2008-07-01T00:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Strange bug: need to duplicate lines of code. Help?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866551#M70875</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;difference in runtime behavior between a release version and debug version&lt;/P&gt;
&lt;P&gt;Depending on option switches - yes.&lt;/P&gt;
&lt;P&gt;Debug can initialized un-initialized to 0.0 or to NaN to detect uninitialized variable use.&lt;/P&gt;
&lt;P&gt;Release, generally does no implicit initialization. So if you read a variable before you write to it then behavior will be different.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2008 01:06:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866551#M70875</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2008-07-01T01:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Strange bug: need to duplicate lines of code. Help?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866552#M70876</link>
      <description>&lt;P&gt;For 2:&lt;/P&gt;
&lt;P&gt;What happens when I=1 (or lowest index) for the value of SOILTEMP(I-1)?&lt;/P&gt;
&lt;P&gt;Are you indexing before the beginning of the array?&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2008 01:12:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866552#M70876</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2008-07-01T01:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Strange bug: need to duplicate lines of code. Help?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866553#M70877</link>
      <description>&lt;P&gt;And for 2:&lt;/P&gt;
&lt;P&gt;And you may have a similar problem when referencing I=Last Index&lt;/P&gt;
&lt;P&gt;Unless your arrays have pre-initialized padds (before and after the initialized data) your first and last iteration will be incorporating JUNK into the expression (rather than perhaps an assumed 0.0)&lt;/P&gt;
&lt;P&gt;And for 3:&lt;/P&gt;
&lt;P&gt;Is PI one of your variables? Are you assuming it is an intrinsic variable of 3.14159....?&lt;/P&gt;
&lt;P&gt;I suggest a debug run with runtime checks for array index out of bounds and un-initialized variable tests.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2008 01:22:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866553#M70877</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2008-07-01T01:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Strange bug: need to duplicate lines of code. Help?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866554#M70878</link>
      <description>Thanks for the tips.&lt;BR /&gt;&lt;BR /&gt;I am now debugging it with all the options, as you suggest, and I already found a number of problems with array sizes being passed between subroutines (luckily most of these problems were not due to my own programming!).&lt;BR /&gt;&lt;BR /&gt;Thanks for pointing out that this is likely due to initialization problems, I now finally understand that the debugger inits to 0.0, while the Release version does not. This is very helpful.&lt;BR /&gt;&lt;BR /&gt;The questions you asked about code bit #2 are all OK, by the way. The indexing (I-1) starts at I=2, and PI is a constant declared in an INCLUDE file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Jul 2008 02:11:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Strange-bug-need-to-duplicate-lines-of-code-Help/m-p/866554#M70878</guid>
      <dc:creator>remkoduursma</dc:creator>
      <dc:date>2008-07-01T02:11:23Z</dc:date>
    </item>
  </channel>
</rss>

