<?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 post #1 in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166646#M144561</link>
    <description>&lt;P&gt;RE post #1&lt;/P&gt;&lt;P&gt;When you used the DO loop, ModelA%FFTNumber may not necessarily been the same as UBOUND(ModelA%FFTDaTA).&lt;BR /&gt;And thus the DO loop and ModelA%FFTDaTA = 0.0 are not necessarily the same thing.&lt;/P&gt;&lt;P&gt;I assume (possibly incorrectly) that ModelA%FFTDaTA was allocated.&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2020 20:11:44 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2020-04-20T20:11:44Z</dc:date>
    <item>
      <title>Interesting bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166641#M144556</link>
      <description>&lt;PRE class="brush:fortran; class-name:dark;"&gt;!do 190 iC = 1, ModelA%FFTNumber

    ModelA%FFTDaTA = ZERO&lt;/PRE&gt;

&lt;P&gt;--------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;So in Modela I store the FFTDATA before it is sent to the FFT Routine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used a do loop to set the vector to all zeros, but a while ago I thought I can just use a&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vector assignment as above, but I got it wrong and had&lt;/P&gt;
&lt;P&gt;ModelA%FFTDaTA(i) = ZERO&lt;/P&gt;
&lt;P&gt;it worked up until last night when the latest stuff came in and the plotting did not work, so I looked and there was&amp;nbsp;random crap in FFTDATA instead of the zeros.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Took a few minutes to track and fix the error -- but I cannot see why it worked!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;/P&gt;
&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 17:02:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166641#M144556</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2020-04-20T17:02:02Z</dc:date>
    </item>
    <item>
      <title>Second interesting</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166642#M144557</link>
      <description>&lt;P&gt;Second interesting observation&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I was looking for the cause of the bug, I noticed in stepping through the code that the creation&amp;nbsp;of arrays occurred in reverse order&amp;nbsp;&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;
    REAL , allocatable :: XDATA(:)
    REAL , allocatable :: YDATA(:)
    REAL , allocatable :: ZDATA(:)
    REAL , allocatable :: DDATA(:)&lt;/PRE&gt;

&lt;P&gt;any ideas why that would occur?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 17:06:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166642#M144557</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2020-04-20T17:06:54Z</dc:date>
    </item>
    <item>
      <title>Is this not a simple</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166643#M144558</link>
      <description>&lt;P&gt;Is this not a simple manifestation of the general problem of trying to use uninitialized variables?&lt;/P&gt;&lt;P&gt;It's a common problem because in some languages, and in the old days, you could use y = 1 + x and you would get 1, because x would be zero. Today, setting an uninitialized variable is not the default behavior. Indeed, x may often be zero--in fact is usually zero--but you cannot rely on it; it depends on what recently-used software has been doing with memory storage locations in areas that your program is now using.&lt;/P&gt;&lt;P&gt;So I would suspect that your (mis) statement Data(i) = ZERO is not setting the entire array to ZERO, but only the ith element, and all of the other elements are left uninitialized.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 17:45:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166643#M144558</guid>
      <dc:creator>dboggs</dc:creator>
      <dc:date>2020-04-20T17:45:04Z</dc:date>
    </item>
    <item>
      <title>Quote:dboggs wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166644#M144559</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;dboggs wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this not a simple manifestation of the general problem of trying to use uninitialized variables?&lt;/P&gt;&lt;P&gt;It's a common problem because in some languages, and in the old days, you could use y = 1 + x and you would get 1, because x would be zero. Today, setting an uninitialized variable is not the default behavior. Indeed, x may often be zero--in fact is usually zero--but you cannot rely on it; it depends on what recently-used software has been doing with memory storage locations in areas that your program is now using.&lt;/P&gt;&lt;P&gt;So I would suspect that your (mis) statement Data(i) = ZERO is not setting the entire array to ZERO, but only the ith element, and all of the other elements are left uninitialized.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But why did it work perfectly for a month and then suddenly stop -- I did not change the code -- I know in reality it is just dumb luck -- but dumb luck for a whole month.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked you are correct on the ith value was set to 0.00&amp;nbsp; - the rest ranged to infinity&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 17:59:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166644#M144559</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2020-04-20T17:59:14Z</dc:date>
    </item>
    <item>
      <title>Since issues like the one</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166645#M144560</link>
      <description>&lt;P&gt;Since issues like the one mentioned can go unnoticed for some time, I like the "initialize variables to signaling NaN" switch&amp;nbsp;during code debugging. That is, use the&amp;nbsp;/Qinit:snan&amp;nbsp; /Qinit:arrays&amp;nbsp; command line switches (in VS via the Project Properties &amp;gt; Fortran &amp;gt; Data&amp;nbsp; menu). With those switches, you will typically find such mistakes quickly.&lt;/P&gt;&lt;P&gt;Andi&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 19:16:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166645#M144560</guid>
      <dc:creator>Andreas_Z_</dc:creator>
      <dc:date>2020-04-20T19:16:41Z</dc:date>
    </item>
    <item>
      <title>RE post #1</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166646#M144561</link>
      <description>&lt;P&gt;RE post #1&lt;/P&gt;&lt;P&gt;When you used the DO loop, ModelA%FFTNumber may not necessarily been the same as UBOUND(ModelA%FFTDaTA).&lt;BR /&gt;And thus the DO loop and ModelA%FFTDaTA = 0.0 are not necessarily the same thing.&lt;/P&gt;&lt;P&gt;I assume (possibly incorrectly) that ModelA%FFTDaTA was allocated.&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 20:11:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Interesting-bug/m-p/1166646#M144561</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2020-04-20T20:11:44Z</dc:date>
    </item>
  </channel>
</rss>

