<?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 Allocate pointer  in subroutine cause access violation in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833241#M53603</link>
    <description>Please provide a short example demonstrating the internal compiler error.</description>
    <pubDate>Fri, 09 Sep 2011 15:44:41 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2011-09-09T15:44:41Z</dc:date>
    <item>
      <title>Allocate pointer  in subroutine cause access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833236#M53598</link>
      <description>&lt;P&gt;I'm nearly new to fortran, sometimes think in the c++ style way, so this simple code confused me a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;integer, pointer :: x&lt;BR /&gt;integer, target :: l&lt;BR /&gt;l=0 &lt;BR /&gt;x=&amp;gt;l&lt;BR /&gt;call aaaa(x)&lt;BR /&gt;write(*,*)associated(x),x&lt;BR /&gt;deallocate(x)&lt;BR /&gt;end&lt;BR /&gt;subroutine aaaa(xx)&lt;BR /&gt;integer, pointer ::xx, y&lt;BR /&gt;allocate(y)&lt;BR /&gt;y=1&lt;BR /&gt;xx=&amp;gt;y&lt;BR /&gt;end subroutine aaaa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above is the codecauses access violation.&lt;/P&gt;&lt;P&gt;Firstly, as you can see I declare a integer target 'l' in the main procedure. if I don't do this , just let x to be null and then call aaaa, whatever i do with the pointer x in aaaa(write it, check the association state) a "Program Exception - access violation" will be throw out when i execute the program.&lt;/P&gt;&lt;P&gt;Secondly, the current code will write "T" and an random number after it, then throw out an"Program Exception - access violation". It looks like the allocated y has already been deallocted when returns aaaa, and the association state seems to be wrong.&lt;/P&gt;&lt;P&gt;of cause, this program is very badly coded. It is my intention to test if i can allocate a pointer in one subroutine and use the allocated pointer in another subroutine, may deallocate it in a third subroutine, I'd wish the pointer can be aderived type. However, i can't even get it run with integer....;(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'd appreciate anyone tell me the reason.&lt;/P&gt;&lt;P&gt;ps: ifort is Version 12.0.2.154 Build 20110112&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2011 14:03:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833236#M53598</guid>
      <dc:creator>Intel_C_19</dc:creator>
      <dc:date>2011-09-09T14:03:41Z</dc:date>
    </item>
    <item>
      <title>Allocate pointer  in subroutine cause access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833237#M53599</link>
      <description>Because the subroutine has a pointer argument, an explicit interface is required. The compiler would tell you this if you built from Visual Studio, or add the /warn:interface option on the command line. Without that, you will get all sorts of weird behavior as the caller doesn't know that the subroutine wants a pointer passed, so it passes the target of the pointer, thevariable I.&lt;BR /&gt;&lt;BR /&gt;The easy way to fix this is to make aaa a contained procedure, like so:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fortran]integer, pointer :: x
integer, target :: l
l=0
x=&amp;gt;l
call aaaa(x)
write(*,*)associated(x),x
deallocate(x)
contains
subroutine aaaa(xx)
integer, pointer ::xx, y
allocate(y)
y=1
xx=&amp;gt;y
end subroutine aaaa
end[/fortran]&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Sep 2011 14:54:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833237#M53599</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-09-09T14:54:51Z</dc:date>
    </item>
    <item>
      <title>Allocate pointer  in subroutine cause access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833238#M53600</link>
      <description>&lt;P&gt;Thank you so much , Steve.&lt;/P&gt;&lt;P&gt;BTW, just now, i find another problem, if there is a "select type" in openmp parallel region, the compiler can't compile and says&lt;/P&gt;&lt;P&gt;catastrophic error: **Internal compiler error: internal abort** Pleasereport this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of thiserror.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2011 15:05:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833238#M53600</guid>
      <dc:creator>Intel_C_19</dc:creator>
      <dc:date>2011-09-09T15:05:38Z</dc:date>
    </item>
    <item>
      <title>Allocate pointer  in subroutine cause access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833239#M53601</link>
      <description>In your "program" section add an INTERFACE to aaaa&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fortran]integer, pointer :: x
integer, target :: l
interface
  subroutine aaaa(xx)
    integer, pointer ::xx
  end subroutine aaaa
end interface
l=0 
x=&amp;gt;l
call aaaa(x)
write(*,*)associated(x),x
deallocate(x)
end
subroutine aaaa(xx)
  integer, pointer ::xx, y
  allocate(y)
  y=1
  xx=&amp;gt;y
end subroutine aaaa[/fortran]&lt;/PRE&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Fri, 09 Sep 2011 15:05:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833239#M53601</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-09-09T15:05:54Z</dc:date>
    </item>
    <item>
      <title>Allocate pointer  in subroutine cause access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833240#M53602</link>
      <description>This works with&lt;BR /&gt;&lt;BR /&gt; w_fcompxe_2011.4.196&lt;BR /&gt;&lt;BR /&gt;both x32 and x64&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Sep 2011 15:08:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833240#M53602</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-09-09T15:08:19Z</dc:date>
    </item>
    <item>
      <title>Allocate pointer  in subroutine cause access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833241#M53603</link>
      <description>Please provide a short example demonstrating the internal compiler error.</description>
      <pubDate>Fri, 09 Sep 2011 15:44:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833241#M53603</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-09-09T15:44:41Z</dc:date>
    </item>
    <item>
      <title>Allocate pointer  in subroutine cause access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833242#M53604</link>
      <description>&lt;P&gt;!$omp parallel&lt;/P&gt;&lt;P&gt;do &lt;/P&gt;if (ASSOCIATED(tp)==.true.) then&lt;BR /&gt;write(*,*) tp%x(1),tp%x(2),tp%x(3),'xx'&lt;BR /&gt;!SELECT type(tp)&lt;BR /&gt;!type is (mdslist)&lt;BR /&gt;!ttp=&amp;gt;tp%typ(listleveln,1)%p&lt;BR /&gt;!end select&lt;BR /&gt;tp=&amp;gt;ttp&lt;BR /&gt;else&lt;BR /&gt;exit&lt;BR /&gt;end if&lt;BR /&gt;end do&lt;BR /&gt;&lt;P&gt;!$omp end parallel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is part of the code, only when i comment the select type part, the compiler can run correctly.&lt;/P&gt;&lt;P&gt;initially, 'tp' is the head of skip list which has a "class (listele) pointer" type. 'ttp' is the same kind as 'tp'. the list defined as following. (one thing i forgot to paste here, tp and ttp are declared as "omp   private")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE :: listele &lt;BR /&gt;INTEGER, allocatable, dimension ( : ) :: x&lt;BR /&gt;INTEGER :: d&lt;BR /&gt;   CONTAINS&lt;BR /&gt;    FINAL :: Delistele&lt;BR /&gt;END TYPE listele&lt;BR /&gt;&lt;BR /&gt;TYPE :: p2listele !to realize a point array&lt;BR /&gt;    CLASS (listele), POINTER :: p&lt;BR /&gt;END TYPE p2listele&lt;BR /&gt;&lt;BR /&gt;TYPE, EXTENDS(listele) :: mdslist !the final list&lt;BR /&gt;	TYPE (p2listele), allocatable, dimension ( :, : )  :: typ&lt;BR /&gt;   CONTAINS&lt;BR /&gt;    FINAL :: Demdslist&lt;BR /&gt;END TYPE mdslist&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i also wish to know when 'Parameterized derived types' will be add to intel fortran, thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2011 08:00:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833242#M53604</guid>
      <dc:creator>Intel_C_19</dc:creator>
      <dc:date>2011-09-11T08:00:40Z</dc:date>
    </item>
    <item>
      <title>Allocate pointer  in subroutine cause access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833243#M53605</link>
      <description>We determined that a fix we made for ASSOCIATE in a parallel region also took care of SELECT TYPE. This fix will appear in a future update.&lt;BR /&gt;&lt;BR /&gt;We cannot say at this time when parameterized derived types will be implemented.</description>
      <pubDate>Mon, 12 Sep 2011 15:23:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocate-pointer-in-subroutine-cause-access-violation/m-p/833243#M53605</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-09-12T15:23:16Z</dc:date>
    </item>
  </channel>
</rss>

