<?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:  need zero / x equals zero  in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908820#M82891</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/308522"&gt;jim.cox&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;BR /&gt;The codebase is such that much of the old code was written expecting implicit typing, and often with no declaration at all.&lt;BR /&gt;&lt;BR /&gt;Personally I'm fussier, and the newer code is 'better'&lt;BR /&gt;&lt;BR /&gt;I'm also now compiling with warnings for undeclared, unused, unalligned and interfaces etc all on - and fixing them as I go.&lt;BR /&gt;&lt;BR /&gt;The routines displaying this beghaviour are compiling without complaint&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;more....&lt;BR /&gt;&lt;BR /&gt;I tried IMPLICIT NONE&lt;BR /&gt;&lt;BR /&gt;But that stopped compilation at the line &lt;BR /&gt;&lt;BR /&gt;L_DEL = GDLY(.TRUE.,.5,ANGL,AS*1000/3600.,DS*1000/3600.,R)&lt;BR /&gt;&lt;BR /&gt;Where GDLY is one of our library functions&lt;BR /&gt;&lt;BR /&gt;Go figure... &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thankx for your input&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Jim,&lt;BR /&gt;&lt;BR /&gt;if you add GDLY to a type statement, I think this should be resolved.&lt;BR /&gt;&lt;BR /&gt;D</description>
    <pubDate>Tue, 20 Oct 2009 01:43:16 GMT</pubDate>
    <dc:creator>DavidWhite</dc:creator>
    <dc:date>2009-10-20T01:43:16Z</dc:date>
    <item>
      <title>need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908807#M82878</link>
      <description>&lt;BR /&gt;Apparently IFort thinks zero / x = NaN&lt;BR /&gt;&lt;BR /&gt;Our program logic  expects zero / x = zero&lt;BR /&gt;&lt;BR /&gt;How do we persuade  IFort - or is writing our own exception handler the only only option  ?&lt;BR /&gt;&lt;BR /&gt;advTHANKXance&lt;BR /&gt;&lt;BR /&gt;Jimmy&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Oct 2009 04:12:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908807#M82878</guid>
      <dc:creator>jim_cox</dc:creator>
      <dc:date>2009-10-19T04:12:18Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908808#M82879</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/308522"&gt;jim.cox&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;Apparently IFort thinks zero / x = NaN&lt;BR /&gt;&lt;BR /&gt;Our program logic expects zero / x = zero&lt;BR /&gt;&lt;BR /&gt;How do we persuade IFort - or is writing our own exception handler the only only option ?&lt;BR /&gt;&lt;BR /&gt;advTHANKXance&lt;BR /&gt;&lt;BR /&gt;Jimmy&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Jimmy,&lt;BR /&gt;&lt;BR /&gt;Can you please supply a sample of code demonstrating this issue? 0 / x should be zero unless x is zero, when NaN is the appropriate response.&lt;BR /&gt;&lt;BR /&gt;David</description>
      <pubDate>Mon, 19 Oct 2009 04:31:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908808#M82879</guid>
      <dc:creator>DavidWhite</dc:creator>
      <dc:date>2009-10-19T04:31:46Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908809#M82880</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
If you have 0./0. that produces NaN according to IEEE standard. I don't see how an exception handler is relevant. If you have an expression involving divide, and you wish to set a zero result when the numerator is zero, regardless of divisor, that should be easily accomplished by testing before divide.&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Oct 2009 04:33:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908809#M82880</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-10-19T04:33:38Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908810#M82881</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Even if you compile with "/assume:protect_parens" and change your line to&lt;BR /&gt;&lt;BR /&gt; result =numerator * (1.0/denominator)&lt;BR /&gt;&lt;BR /&gt;When denominator is NaN, the result will be NaN. When denominator = 0.0 you will either get a div 0 error or NaN for (1.0/denominator). However&lt;BR /&gt;&lt;BR /&gt; result = numerator&lt;BR /&gt; if(result .ne. 0.0) result = result / denominator&lt;BR /&gt;&lt;BR /&gt;Will produce 0.0 when numerator=0.0 regardless of value of denominator.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Oct 2009 15:37:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908810#M82881</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-10-19T15:37:11Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908811#M82882</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/99850"&gt;jimdempseyatthecove&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;Even if you compile with "/assume:protect_parens" and change your line to&lt;BR /&gt;&lt;BR /&gt; result =numerator * (1.0/denominator)&lt;BR /&gt;&lt;BR /&gt;When denominator is NaN, the result will be NaN. When denominator = 0.0 you will either get a div 0 error or NaN for (1.0/denominator). However&lt;BR /&gt;&lt;BR /&gt; result = numerator&lt;BR /&gt; if(result .ne. 0.0) result = result / denominator&lt;BR /&gt;&lt;BR /&gt;Will produce 0.0 when numerator=0.0 regardless of value of denominator.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Depending on your detailed requirements, you might prefer Jim's suggestion (as we would have 20 years ago), or&lt;BR /&gt;result = MERGE(numerator,numerator/denominator,abs(numerator &amp;lt; TINY(numerator)))&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Oct 2009 16:46:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908811#M82882</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-10-19T16:46:13Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908812#M82883</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/142656"&gt;David White&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;Jimmy,&lt;BR /&gt;&lt;BR /&gt;Can you please supply a sample of code demonstrating this issue? 0 / x should be zero unless x is zero, when NaN is the appropriate response.&lt;BR /&gt;&lt;BR /&gt;David&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;BR /&gt;we are getting the slope of a line&lt;BR /&gt;&lt;BR /&gt;when&lt;BR /&gt;&lt;BR /&gt;VV(2,1) = 2.0&lt;BR /&gt;VV(1,1)= 2.0&lt;BR /&gt;QQ(2,1)=500.0&lt;BR /&gt;QQ(1,1)=0.0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; SLOPEV(JP,I) = (VV(JP+1,I)-VV(JP,I)) / (QQ(JP+1,I)-QQ(JP,I))&lt;BR /&gt;&lt;BR /&gt;= NaN&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;:(&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Oct 2009 19:38:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908812#M82883</guid>
      <dc:creator>jim_cox</dc:creator>
      <dc:date>2009-10-19T19:38:02Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908813#M82884</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/99850"&gt;jimdempseyatthecove&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; However&lt;BR /&gt;&lt;BR /&gt; result = numerator&lt;BR /&gt; if(result .ne. 0.0) result = result / denominator&lt;BR /&gt;&lt;BR /&gt;Will produce 0.0 when numerator=0.0 regardless of value of denominator.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;That is elegant code thank you Jim :) &lt;BR /&gt;&lt;BR /&gt;But will it work if the denominator is zero?&lt;BR /&gt;&lt;BR /&gt;Better perhaps with... &lt;BR /&gt; &lt;BR /&gt;result = numerator&lt;BR /&gt; if(result .ne. 0.0.and.denominator.ne.0.0) result = result / denominator&lt;BR /&gt;&lt;BR /&gt;Wonder how many places I have to change my code?&lt;BR /&gt;&lt;BR /&gt;There are only 2060 divide statements in this one program :(&lt;BR /&gt;&lt;BR /&gt;Jim&lt;BR /&gt;&lt;BR /&gt;=mjc=&lt;BR /&gt;&lt;SIGH&gt;&lt;BR /&gt;.&lt;BR /&gt;&lt;/SIGH&gt;</description>
      <pubDate>Mon, 19 Oct 2009 20:39:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908813#M82884</guid>
      <dc:creator>jim_cox</dc:creator>
      <dc:date>2009-10-19T20:39:07Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908814#M82885</link>
      <description>&lt;DIV style="margin: 0px; height: auto;"&gt;&lt;/DIV&gt;
For what it's worth, behavior of your program may depend on whether you set /Qftz- for compilation of main program, either directly, or indirectly by /fp:source&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Oct 2009 20:56:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908814#M82885</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-10-19T20:56:40Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908815#M82886</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/367365"&gt;tim18&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; For what it's worth, behavior of your program may depend on whether you set /Qftz for compilation of main program, either directly, or indirectly by /fp:source&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Thankx,&lt;BR /&gt;&lt;BR /&gt;Had a quick play with this setting &lt;BR /&gt;&lt;BR /&gt;But in my case that doesnt seem to make any difference &lt;BR /&gt;</description>
      <pubDate>Mon, 19 Oct 2009 23:35:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908815#M82886</guid>
      <dc:creator>jim_cox</dc:creator>
      <dc:date>2009-10-19T23:35:43Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908816#M82887</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/308522"&gt;jim.cox&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;BR /&gt;we are getting the slope of a line&lt;BR /&gt;&lt;BR /&gt;when&lt;BR /&gt;&lt;BR /&gt;VV(2,1) = 2.0&lt;BR /&gt;VV(1,1)= 2.0&lt;BR /&gt;QQ(2,1)=500.0&lt;BR /&gt;QQ(1,1)=0.0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SLOPEV(JP,I) = (VV(JP+1,I)-VV(JP,I)) / (QQ(JP+1,I)-QQ(JP,I))&lt;BR /&gt;&lt;BR /&gt;= NaN&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;:(&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Jim,&lt;BR /&gt;&lt;BR /&gt;Assuming that JP and I are set correctly for the values you quote here, the only reason I can think that you could be getting NaN is that perhaps you are exceeding your array bounds, and accessing other memory.&lt;BR /&gt;&lt;BR /&gt;David</description>
      <pubDate>Mon, 19 Oct 2009 23:54:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908816#M82887</guid>
      <dc:creator>DavidWhite</dc:creator>
      <dc:date>2009-10-19T23:54:14Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908817#M82888</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/142656"&gt;David White&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;Jim,&lt;BR /&gt;&lt;BR /&gt;Assuming that JP and I are set correctly for the values you quote here, the only reason I can think that you could be getting NaN is that perhaps you are exceeding your array bounds, and accessing other memory.&lt;BR /&gt;&lt;BR /&gt;David&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Both JP = 1 and I = 1&lt;BR /&gt;&lt;BR /&gt;and SLOPEV is declared with&lt;BR /&gt;&lt;BR /&gt;INTEGER, PARAMETER :: NP=10&lt;BR /&gt;&lt;BR /&gt;COMMON/COEF/QQ(NP+1,99),VV(NP+1,99),SLOPEV(NP+1,99),NPT(99)&lt;BR /&gt;&lt;BR /&gt;REAL QQ, VV, SLOPEV&lt;BR /&gt;&lt;BR /&gt;Slopev is happily initialised to zero elsewhere&lt;BR /&gt;&lt;BR /&gt;Bounds checking is enabled and not complaining&lt;BR /&gt;&lt;BR /&gt;There is so much "weirdness" going on with this code that I figure it has to be some sort of memory issue. &lt;BR /&gt;&lt;BR /&gt;And I'm ripping my hair out trying to work out what / where it is&lt;BR /&gt;&lt;BR /&gt;Ah the joys of an old old old codebase...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Oct 2009 00:25:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908817#M82888</guid>
      <dc:creator>jim_cox</dc:creator>
      <dc:date>2009-10-20T00:25:25Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908818#M82889</link>
      <description>&lt;DIV style="margin:0px;"&gt;Jim,&lt;BR /&gt;&lt;BR /&gt;You said "There is so much "weirdness" going on with this code that I figure it has to be some sort of memory issue."&lt;BR /&gt;&lt;BR /&gt;Perhaps it is notthese arrays causing the problem, but they are being trampled on from elsewhere.&lt;BR /&gt;&lt;BR /&gt;Are youusing IMPLICIT NONE and ensuringthat all variables are declared and initialized properly -- may be agood place to start -- could identify variables which are not declared in the way you think they are.&lt;BR /&gt;&lt;BR /&gt;Happy hunting.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;David&lt;BR /&gt;&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Oct 2009 00:58:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908818#M82889</guid>
      <dc:creator>DavidWhite</dc:creator>
      <dc:date>2009-10-20T00:58:37Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908819#M82890</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/142656"&gt;David White&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;Jim,&lt;BR /&gt;&lt;BR /&gt;You said "There is so much "weirdness" going on with this code that I figure it has to be some sort of memory issue."&lt;BR /&gt;&lt;BR /&gt;Perhaps it is notthese arrays causing the problem, but they are being trampled on from elsewhere.&lt;BR /&gt;&lt;BR /&gt;Are youusing IMPLICIT NONE and ensuringthat all variables are declared and initialized properly -- may be agood place to start -- could identify variables which are not declared in the way you think they are.&lt;BR /&gt;&lt;BR /&gt;Happy hunting.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;David&lt;BR /&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;BR /&gt;The codebase is such that much of the old code was written expecting implicit typing, and often with no declaration at all.&lt;BR /&gt;&lt;BR /&gt;Personally I'm fussier, and the newer code is 'better'&lt;BR /&gt;&lt;BR /&gt;I'm also now  compiling with warnings for undeclared, unused, unalligned and interfaces etc all on - and fixing them as I go.&lt;BR /&gt;&lt;BR /&gt;The routines displaying this beghaviour are compiling without complaint&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;more....&lt;BR /&gt;&lt;BR /&gt;I tried IMPLICIT NONE&lt;BR /&gt;&lt;BR /&gt;But that  stopped compilation at the line &lt;BR /&gt;&lt;BR /&gt; L_DEL = GDLY(.TRUE.,.5,ANGL,AS*1000/3600.,DS*1000/3600.,R)&lt;BR /&gt;&lt;BR /&gt;Where GDLY is one of our library functions&lt;BR /&gt;&lt;BR /&gt;Go figure... &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thankx for your input&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Oct 2009 01:24:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908819#M82890</guid>
      <dc:creator>jim_cox</dc:creator>
      <dc:date>2009-10-20T01:24:01Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908820#M82891</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/308522"&gt;jim.cox&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;BR /&gt;The codebase is such that much of the old code was written expecting implicit typing, and often with no declaration at all.&lt;BR /&gt;&lt;BR /&gt;Personally I'm fussier, and the newer code is 'better'&lt;BR /&gt;&lt;BR /&gt;I'm also now compiling with warnings for undeclared, unused, unalligned and interfaces etc all on - and fixing them as I go.&lt;BR /&gt;&lt;BR /&gt;The routines displaying this beghaviour are compiling without complaint&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;more....&lt;BR /&gt;&lt;BR /&gt;I tried IMPLICIT NONE&lt;BR /&gt;&lt;BR /&gt;But that stopped compilation at the line &lt;BR /&gt;&lt;BR /&gt;L_DEL = GDLY(.TRUE.,.5,ANGL,AS*1000/3600.,DS*1000/3600.,R)&lt;BR /&gt;&lt;BR /&gt;Where GDLY is one of our library functions&lt;BR /&gt;&lt;BR /&gt;Go figure... &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thankx for your input&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Jim,&lt;BR /&gt;&lt;BR /&gt;if you add GDLY to a type statement, I think this should be resolved.&lt;BR /&gt;&lt;BR /&gt;D</description>
      <pubDate>Tue, 20 Oct 2009 01:43:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908820#M82891</guid>
      <dc:creator>DavidWhite</dc:creator>
      <dc:date>2009-10-20T01:43:16Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908821#M82892</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;When numerator .ne. 0.0 and denominator .eq. 0.0 just what sort of number do you want produced?&lt;BR /&gt;&lt;BR /&gt;The code I listed will produce either a div by 0 exception or a NaN. Either of which are commonly accepted results. Returning 0.0 is not (not even for 0.0/0.0). The code I produces returns 0.0 for 0.0/x where x is anyting including 0.0 and NaN. This is the behavior you asked for. Y/0.0 where Y is not 0.0 produces what in your number scheme?&lt;BR /&gt;&lt;BR /&gt;Wherever your program will produce a divide by 0, you must protect that section of code. This is likely a very small set of your 2060 statements. And if the NaN's are produced in places they ought not to be produced then this is an indication of an error elsewhere in your program (i.e. something else bunged up your data).&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey.&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Oct 2009 04:21:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908821#M82892</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-10-20T04:21:11Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908822#M82893</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/308522"&gt;jim.cox&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;Apparently IFort thinks zero / x = NaN&lt;BR /&gt;&lt;BR /&gt;Our program logic  expects zero / x = zero&lt;BR /&gt;&lt;BR /&gt;How do we persuade  IFort - or is writing our own exception handler the only only option  ?&lt;BR /&gt;&lt;BR /&gt;advTHANKXance&lt;BR /&gt;&lt;BR /&gt;Jimmy&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I was concerning for this issue, always.&lt;/P&gt;
&lt;P&gt;When I use following code, I got a good results.&lt;/P&gt;
&lt;P&gt;It's idea came from tim18 andJim Dempsey.&lt;/P&gt;
&lt;P&gt;Thanks tim18 and Jim Dempsey&lt;/P&gt;
&lt;P&gt;Whatever a, b it's result seems to be reasonable.&lt;/P&gt;
&lt;P&gt;a=0.0, huge, tiny, -huge, -tiny; b=0.0, huge, tiny, -huge, -tiny...etc.&lt;/P&gt;
&lt;P&gt;____________________________________________________________&lt;/P&gt;
&lt;P&gt;implicit none&lt;BR /&gt; real*8 :: a, b, c&lt;BR /&gt;&lt;BR /&gt;a = 0.0d0 ! 0.0d0, tiny(a), huge(a)...&lt;BR /&gt;b = 0.0d0 ! 0.0d0, tiny(b), huge(b)...&lt;BR /&gt;&lt;BR /&gt;c = merge(          a ,a/b,dabs(a)&amp;lt; tiny(a))&lt;BR /&gt;c = merge(dsign(huge(c),c),c  ,dabs(c)&amp;gt;huge(c))&lt;BR /&gt;&lt;BR /&gt; write(*,*) a/b, c&lt;BR /&gt;&lt;BR /&gt; stop&lt;BR /&gt; end&lt;/P&gt;
&lt;P&gt;____________________________________________________________&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2009 08:18:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908822#M82893</guid>
      <dc:creator>portoon</dc:creator>
      <dc:date>2009-10-20T08:18:56Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908823#M82894</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/142656"&gt;David White&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;Jim,&lt;BR /&gt;&lt;BR /&gt;if you add GDLY to a type statement, I think this should be resolved.&lt;BR /&gt;&lt;BR /&gt;D&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I was concerning for this issue, always.&lt;BR /&gt;When I use following code, I got a good results.&lt;BR /&gt;It's idea came from tim18 and Jim Dempsey.&lt;BR /&gt;Thanks tim18 and Jim Dempsey&lt;/P&gt;
&lt;P&gt;If a or b is not NaN, it's result seems to be reasonable.&lt;BR /&gt;a=0.0, huge, tiny; b=0.0, huge, tiny...etc.&lt;/P&gt;
&lt;P&gt;____________________________________________________________&lt;BR /&gt;implicit none&lt;BR /&gt;real*8 :: a, b, c&lt;BR /&gt;&lt;BR /&gt;a = 0.0d0 ! 0.0d0, tiny(a), huge(a)...&lt;BR /&gt;b = 0.0d0 ! 0.0d0, tiny(b), huge(b)...&lt;BR /&gt;&lt;BR /&gt;c = merge(                  a ,a/b,dabs(a)&amp;lt; tiny(a))&lt;BR /&gt;c = merge(dsign(huge(c),c),c    ,dabs(c)&amp;gt;huge(c))&lt;BR /&gt;&lt;BR /&gt;write(*,*) a/b, c&lt;BR /&gt;&lt;BR /&gt;stop&lt;BR /&gt;end&lt;BR /&gt;____________________________________________________________&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2009 08:44:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908823#M82894</guid>
      <dc:creator>portoon</dc:creator>
      <dc:date>2009-10-20T08:44:11Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908824#M82895</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Jim,&lt;BR /&gt;&lt;BR /&gt;I forgot to mention that in both my suggestion and in David's (even if merge is inlined) is that compiler optimizations may perform the division regardless of if the if test passes or fails. The newer versions of the instruction set have a conditional move. It is often faster to perform the division speculatively then perform a conditional move without use of branch instruction. In this situation (conditional move) you may/will experience divide by zero.&lt;BR /&gt;&lt;BR /&gt;/Qfp-speculation:off&lt;BR /&gt;&lt;BR /&gt;might help (for the source files with the questionable statements).&lt;BR /&gt;&lt;BR /&gt;And use /fpe:1 or /fpe:3&lt;BR /&gt;&lt;BR /&gt;Note, use of /fpe:1 or /fpe:3 will generate NaN's and asumes it is your responsibility for detection of floating point errors.&lt;BR /&gt;&lt;BR /&gt;Also,&lt;BR /&gt;&lt;BR /&gt;If you are the programmer and NOT the research scientist using the progrma, then on every instance where you assume you want this test, you must verify with the scientist as to what result to generate. Do not assume 0.0 is the desired value. The correct value could be any of&lt;BR /&gt;&lt;BR /&gt;error/abort&lt;BR /&gt;0.0&lt;BR /&gt;TINY (+/-)&lt;BR /&gt;NaN&lt;BR /&gt;denormal number&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Each case may (generaly does) have a different set of rules.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Oct 2009 14:00:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908824#M82895</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-10-20T14:00:21Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908825#M82896</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/99850"&gt;jimdempseyatthecove&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;Jim,&lt;BR /&gt;&lt;BR /&gt;I forgot to mention that in both my suggestion and in David's (even if merge is inlined) is that compiler optimizations may perform the division regardless of if the if test passes or fails. The newer versions of the instruction set have a conditional move. It is often faster to perform the division speculatively then perform a conditional move without use of branch instruction. In this situation (conditional move) you may/will experience divide by zero.&lt;BR /&gt;&lt;BR /&gt;/Qfp-speculation:off&lt;BR /&gt;&lt;BR /&gt;might help (for the source files with the questionable statements).&lt;BR /&gt;&lt;BR /&gt;And use /fpe:1 or /fpe:3&lt;BR /&gt;&lt;BR /&gt;Note, use of /fpe:1 or /fpe:3 will generate NaN's and asumes it is your responsibility for detection of floating point errors.&lt;BR /&gt;&lt;BR /&gt;Also,&lt;BR /&gt;&lt;BR /&gt;If you are the programmer and NOT the research scientist using the progrma, then on every instance where you assume you want this test, you must verify with the scientist as to what result to generate. Do not assume 0.0 is the desired value. The correct value could be any of&lt;BR /&gt;&lt;BR /&gt;error/abort&lt;BR /&gt;0.0&lt;BR /&gt;TINY (+/-)&lt;BR /&gt;NaN&lt;BR /&gt;denormal number&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Each case may (generaly does) have a different set of rules.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Yes Jim - I'm the current mug programer tending this simple old codebase (sigh)&lt;BR /&gt;&lt;BR /&gt;As stated in the title we need 0.0 / X = 0.0 &lt;BR /&gt;&lt;BR /&gt;If X = 0 crashes, thats ok&lt;BR /&gt;&lt;BR /&gt;Thankx for the suggestiions re the switches. I'm wondering if some of the floating point options might influence. I'll keep playing...&lt;BR /&gt;&lt;BR /&gt;We are trying to move to the IFort compiler so that we can take advantage of the multi-porcessor support, so any suggestions that improved reliability would be helpful. &lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Jim&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Oct 2009 19:27:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908825#M82896</guid>
      <dc:creator>jim_cox</dc:creator>
      <dc:date>2009-10-21T19:27:14Z</dc:date>
    </item>
    <item>
      <title>Re:  need zero / x equals zero</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908826#M82897</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;When I converted a 700 file project from F77 to F95 (asside from some wierdness with DATA statements) conversion went rather well excepting for...&lt;BR /&gt;&lt;BR /&gt;When converting from COMMON to MODULE some problems were exposed relating to EQUIVILENCE statements. The conversion to modules caught several problems relating to this but in the end was well worth the effort. The biggest initial improvement was in incorporationg allocatable arrays and use of pointers. The allocatable arrays meant the internal storage requirements could adjust according to input file parameters as opposed to being fixed at compile time to worst case. The pointers eliminated a lot of block moves of data in/out of working sets. The initial conversion attained 10x performance boost (principaly due to the appropriate use of pointers). Following that, compiler optimizations providing vectorization, then adding OpenMP. End result was 4 core system showed 40x+ improvement and provided for input file sizing of internal arrays. Your Milage May Vary.&lt;BR /&gt;&lt;BR /&gt;One of the "hacks" I used to aid in the conversion was to extensively use the FPP. While keeping the majority of the code untouched, I could have the FPP redirect the once COMMON variables to use allocatable array and pointers. e.g.&lt;BR /&gt;&lt;BR /&gt;#define SEGLEN pTether.pFiniteSolution.rSEGLEN&lt;BR /&gt;&lt;BR /&gt;Placed in a xxx.INC include file permitted the code to continue to use SEGLEN(JSEG) without edits. Debugging was a little strange seeing that the InteliSence saw SEGLEN but the compiler saw pTether.pFiniteSolution.rSEGLEN. However, debugging was minimalized due to virtually no edits to working code.&lt;BR /&gt;&lt;BR /&gt;There were several other conversion helpers the FPP provide in the conversion project.&lt;BR /&gt;&lt;BR /&gt;Try to use all the tricks available - make life easy.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Oct 2009 22:21:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/need-zero-x-equals-zero/m-p/908826#M82897</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-10-21T22:21:44Z</dc:date>
    </item>
  </channel>
</rss>

