<?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: unexpected behavior of pointer this and allocated arrays in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847335#M64750</link>
    <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Hi&lt;BR /&gt;&lt;BR /&gt;I also notice that the debugger does not display the correct information. &lt;BR /&gt;&lt;BR /&gt;For example, &lt;BR /&gt;&lt;BR /&gt;(1) Just after the allocation in Child2ProcedureSub, debuger shows this%child1%parent%parentvariable as undefined pointer/array.&lt;BR /&gt;(2) After returning to the main program, when the type variable itself is put in the watch window, the "parentvariable" is not displayed correctly. Instead of array bounds 1 to 2, it shows as parentvariable(0) with value 0.&lt;BR /&gt;(3) child3_var%parentvariable gives "invalid structure". &lt;BR /&gt;&lt;BR /&gt;Regarding point (2) above, I have to put child3_var(1) in the watch-window. If I put jus child3_var, the expanded tree would should only one array element but with element 0. The corresponding value of the parentvariable(0) is displayed as 6369624.&lt;BR /&gt;&lt;BR /&gt;Abhi&lt;BR /&gt;&lt;BR /&gt;p.s. Also I tested the program with XLFortran and it does print 3, 4 as expected.&lt;BR /&gt;</description>
    <pubDate>Wed, 14 Oct 2009 22:55:55 GMT</pubDate>
    <dc:creator>abhimodak</dc:creator>
    <dc:date>2009-10-14T22:55:55Z</dc:date>
    <item>
      <title>unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847329#M64744</link>
      <description>Hello there,&lt;BR /&gt;&lt;BR /&gt;I've been trying to use some allocatable arrays in a user-defined data type. After an object is created and the allocatable array is allocated, it may be accessed with no error. But if I point to the object, I'm not able to access the allocated array, usingthe pointer. It seems to loose the array address.&lt;BR /&gt;&lt;BR /&gt;I'm attaching a sample project with the error.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Roger</description>
      <pubDate>Wed, 14 Oct 2009 12:46:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847329#M64744</guid>
      <dc:creator>rogcar</dc:creator>
      <dc:date>2009-10-14T12:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847330#M64745</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
I would have expected this to run afoul of scoping, since Fortran requires automatic deallocation when going out of scope. So, you might add diagnostic code to see whether the pointer target remains allocated. Sorry if I have been thrown off track by the coding style.&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Oct 2009 13:21:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847330#M64745</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-10-14T13:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847331#M64746</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;If your situation is a scoping error (allocated array goes out of scope) as Tim suggestedbut your coding intention is to keep the object persistant (and accessible via pointer) after exit from subroutine/function that performs allocationthen allocate to the pointer or placethe array (descriptor) in a module (as opposed to onstack).&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Oct 2009 17:49:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847331#M64746</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-10-14T17:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847332#M64747</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
I took a look at this and I think it is a bug. I understand where Tim is coming from, but as "this" is a dummy argument and not a local variable, automatic dealloication does not apply.&lt;BR /&gt;&lt;BR /&gt;What I see is that the pointer is not filled in properly, even in the test program - or at least it looks that way to me. I'll report this to the developers.&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Oct 2009 18:01:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847332#M64747</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-10-14T18:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847333#M64748</link>
      <description>Thanks Tim and Jim, but Steve got it right. It's not a problem of going out of scope, because it's not a local variable. Actually, the pointer is correctly addressed at first, but inside a routine, the 'this' pointer looses information. Notice that the pointerin the main routineis still working, correctly addressed.&lt;BR /&gt;&lt;BR /&gt;It is a bug :)&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Roger</description>
      <pubDate>Wed, 14 Oct 2009 19:14:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847333#M64748</guid>
      <dc:creator>rogcar</dc:creator>
      <dc:date>2009-10-14T19:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847334#M64749</link>
      <description>Issue ID is DPD200140796&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Oct 2009 20:48:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847334#M64749</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-10-14T20:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847335#M64750</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Hi&lt;BR /&gt;&lt;BR /&gt;I also notice that the debugger does not display the correct information. &lt;BR /&gt;&lt;BR /&gt;For example, &lt;BR /&gt;&lt;BR /&gt;(1) Just after the allocation in Child2ProcedureSub, debuger shows this%child1%parent%parentvariable as undefined pointer/array.&lt;BR /&gt;(2) After returning to the main program, when the type variable itself is put in the watch window, the "parentvariable" is not displayed correctly. Instead of array bounds 1 to 2, it shows as parentvariable(0) with value 0.&lt;BR /&gt;(3) child3_var%parentvariable gives "invalid structure". &lt;BR /&gt;&lt;BR /&gt;Regarding point (2) above, I have to put child3_var(1) in the watch-window. If I put jus child3_var, the expanded tree would should only one array element but with element 0. The corresponding value of the parentvariable(0) is displayed as 6369624.&lt;BR /&gt;&lt;BR /&gt;Abhi&lt;BR /&gt;&lt;BR /&gt;p.s. Also I tested the program with XLFortran and it does print 3, 4 as expected.&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Oct 2009 22:55:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847335#M64750</guid>
      <dc:creator>abhimodak</dc:creator>
      <dc:date>2009-10-14T22:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847336#M64751</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Yes, I noticed that as well and included that in my report. The pointer is displayed incorrectly even before it is allocated.&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Oct 2009 00:10:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847336#M64751</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-10-15T00:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847337#M64752</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;Yes, I noticed that as well and included that in my report. The pointer is displayed incorrectly even before it is allocated.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Indeed, although it does not display correctly in debug mode, it does work. That's why I'm printing the results in the screen. I believe it was reported before by someone else, at least I remember reading about it. I did notice this behavior, but since it was already reported, and the developers notified, I'm expecting that this bug willl be corrected in the next update.&lt;BR /&gt;&lt;BR /&gt;Actually, why Fortran doesn't have a function like TRACE? It would help a lot.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Roger&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Oct 2009 11:55:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847337#M64752</guid>
      <dc:creator>rogcar</dc:creator>
      <dc:date>2009-10-15T11:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847338#M64753</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
What is TRACE?&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Oct 2009 16:12:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847338#M64753</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-10-15T16:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847339#M64754</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;What is TRACE?&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;TRACE is a diagnosis C function that writesout the stack in debug mode. It works only in debug mode, and is a print-like function, but the standard (and only) output is the IDE output window. I notice that there is a similar function in Fortran, but I have not tried it yet: TRACEBACKQQ&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Roger</description>
      <pubDate>Thu, 15 Oct 2009 16:48:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847339#M64754</guid>
      <dc:creator>rogcar</dc:creator>
      <dc:date>2009-10-15T16:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847340#M64755</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
The problem originally reported has been fixed in our sources. I expect the fix to appear in Update 5, scheduled for late January.&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Dec 2009 14:15:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847340#M64755</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-12-23T14:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected behavior of pointer this and allocated arrays</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847341#M64756</link>
      <description>I'm not sure why the fix did not appear in Update 5, but it is in 11.1 Update 6, available now.</description>
      <pubDate>Fri, 23 Apr 2010 19:06:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/unexpected-behavior-of-pointer-this-and-allocated-arrays/m-p/847341#M64756</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-04-23T19:06:46Z</dc:date>
    </item>
  </channel>
</rss>

