<?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 question about free user defined allocatable array in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/question-about-free-user-defined-allocatable-array/m-p/785598#M29897</link>
    <description>Hi, I have a quesion about free user defined allocatable array. Followings are sample codes of my quesion.&lt;BR /&gt;&lt;BR /&gt;!----------------------------------------------------------------&lt;BR /&gt;! This is the user defined data type&lt;BR /&gt;type :: VarType&lt;BR /&gt; real(8),allocatable :: Var_inner(:)&lt;BR /&gt;end type&lt;BR /&gt;&lt;BR /&gt;! declare an dynamic array&lt;BR /&gt;type(VarType), allocatable :: Var_outer(:)&lt;BR /&gt;&lt;BR /&gt;! allocate the array and its inner arrays&lt;BR /&gt;allocate(Var_Outer(10))&lt;BR /&gt;do i = 1, 10&lt;BR /&gt; allocate(Var_outer(i)%Var_inner(10))&lt;BR /&gt;enddo&lt;BR /&gt;&lt;BR /&gt;! free the array &lt;BR /&gt;deallocate(Var_outer)&lt;BR /&gt;!----------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Quesion is : will it cause memory leak if I just free the outer array? &lt;BR /&gt;&lt;BR /&gt;Thanks in advance!</description>
    <pubDate>Mon, 28 Nov 2011 12:53:54 GMT</pubDate>
    <dc:creator>haijunwu</dc:creator>
    <dc:date>2011-11-28T12:53:54Z</dc:date>
    <item>
      <title>question about free user defined allocatable array</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/question-about-free-user-defined-allocatable-array/m-p/785598#M29897</link>
      <description>Hi, I have a quesion about free user defined allocatable array. Followings are sample codes of my quesion.&lt;BR /&gt;&lt;BR /&gt;!----------------------------------------------------------------&lt;BR /&gt;! This is the user defined data type&lt;BR /&gt;type :: VarType&lt;BR /&gt; real(8),allocatable :: Var_inner(:)&lt;BR /&gt;end type&lt;BR /&gt;&lt;BR /&gt;! declare an dynamic array&lt;BR /&gt;type(VarType), allocatable :: Var_outer(:)&lt;BR /&gt;&lt;BR /&gt;! allocate the array and its inner arrays&lt;BR /&gt;allocate(Var_Outer(10))&lt;BR /&gt;do i = 1, 10&lt;BR /&gt; allocate(Var_outer(i)%Var_inner(10))&lt;BR /&gt;enddo&lt;BR /&gt;&lt;BR /&gt;! free the array &lt;BR /&gt;deallocate(Var_outer)&lt;BR /&gt;!----------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Quesion is : will it cause memory leak if I just free the outer array? &lt;BR /&gt;&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Mon, 28 Nov 2011 12:53:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/question-about-free-user-defined-allocatable-array/m-p/785598#M29897</guid>
      <dc:creator>haijunwu</dc:creator>
      <dc:date>2011-11-28T12:53:54Z</dc:date>
    </item>
    <item>
      <title>question about free user defined allocatable array</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/question-about-free-user-defined-allocatable-array/m-p/785599#M29898</link>
      <description>&lt;I&gt;&amp;gt; will it cause memory leak if I just free the outer array?&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;In Fortran 95 and later, local allocatable variables are freed when the subprogram is exited. In Fortran 90, memory leaks can be expected unless explicit deallocation is performed.&lt;BR /&gt;&lt;BR /&gt;Correction to Line-8:&lt;BR /&gt;&lt;BR /&gt; type(VarType), allocatable :: Var_outer(:)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Nov 2011 13:32:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/question-about-free-user-defined-allocatable-array/m-p/785599#M29898</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-11-28T13:32:16Z</dc:date>
    </item>
    <item>
      <title>question about free user defined allocatable array</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/question-about-free-user-defined-allocatable-array/m-p/785600#M29899</link>
      <description>If you have an allocatable array of a derived type (which you do), and that type has allocatable components (which yours does), deallocating the outer array automatically deallocates the components.</description>
      <pubDate>Mon, 28 Nov 2011 14:48:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/question-about-free-user-defined-allocatable-array/m-p/785600#M29899</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-11-28T14:48:57Z</dc:date>
    </item>
  </channel>
</rss>

