<?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: Memory usage with allocate and derived type in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-usage-with-allocate-and-derived-type/m-p/840472#M58441</link>
    <description>I can reproduce Alexis' problem and will let the developers know about it.  It seems that the debugger is misinterpreting the information the compiler supplies.</description>
    <pubDate>Fri, 26 Aug 2005 02:47:50 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2005-08-26T02:47:50Z</dc:date>
    <item>
      <title>Memory usage with allocate and derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-usage-with-allocate-and-derived-type/m-p/840469#M58438</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;  I have a derived type called particle that holds the quantum numbers of a partice like so:&lt;BR /&gt;&lt;BR /&gt;type(particle) &lt;BR /&gt;   integer :: m,n,s&lt;BR /&gt;end type particle&lt;BR /&gt;&lt;BR /&gt;I then made another type to hold an array of these particles, along with another parameter called norm:&lt;BR /&gt;&lt;BR /&gt;type(basis) &lt;BR /&gt;   type(particle), allocatable :: p(:)&lt;BR /&gt;   real*8 :: norm&lt;BR /&gt;end type basis&lt;BR /&gt;&lt;BR /&gt;Finally, there are different ways of grouping the parameters together (there are multiple basis states) and I need to enumerate them all and remember the results.  So in my main code I have something like this:&lt;BR /&gt;&lt;BR /&gt;type(basis), allocatable :: b(:)&lt;BR /&gt;&lt;BR /&gt;Now suppose that I have 10 basis states, and only 3 particles.  The way I was initializing my b array is like:&lt;BR /&gt;&lt;BR /&gt;allocate(b(10))&lt;BR /&gt;do i=1,3&lt;BR /&gt;   allocate(b(i)%p(3))&lt;BR /&gt;enddo&lt;BR /&gt;&lt;BR /&gt;However, I just noticed when using the debugger in Visual Studio that as soon as I allocate the b array, all the sub-arrays of particles are also allocated to the same size.  So instead of ending up with&lt;BR /&gt;&lt;BR /&gt;b(1)%p(1)&lt;BR /&gt;b(1)%p(2)&lt;BR /&gt;b(1)%p(3)&lt;BR /&gt;b(2)%p(1)&lt;BR /&gt;b(2)%p(2)&lt;BR /&gt;b(2)%p(3)&lt;BR /&gt;...&lt;BR /&gt;b(10)%p(1)&lt;BR /&gt;&lt;BR /&gt;I get &lt;BR /&gt;&lt;BR /&gt;b(1)%p(1)&lt;BR /&gt;...&lt;BR /&gt;b(1)%p(10)&lt;BR /&gt;b(2)%p(1)&lt;BR /&gt;...&lt;BR /&gt;b(10)%p(10)&lt;BR /&gt;&lt;BR /&gt;am I doing anything wrong?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Alexis</description>
      <pubDate>Thu, 25 Aug 2005 01:28:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-usage-with-allocate-and-derived-type/m-p/840469#M58438</guid>
      <dc:creator>alexismor</dc:creator>
      <dc:date>2005-08-25T01:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Memory usage with allocate and derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-usage-with-allocate-and-derived-type/m-p/840470#M58439</link>
      <description>It looks like this  might just be an artifact created by MS Visual Studio.  When I test a little program like:&lt;BR /&gt;&lt;BR /&gt;program test&lt;BR /&gt;use basis_module&lt;BR /&gt;type(basis), allocatable :: b(:)&lt;BR /&gt;&lt;BR /&gt;allocate(b(10))&lt;BR /&gt;allocate(b(1)%p(3))&lt;BR /&gt;print*,'size(b)=',size(b)&lt;BR /&gt;print*,'size(b(1)%p=',size(b(1)%p)&lt;BR /&gt;stop&lt;BR /&gt;end&lt;BR /&gt;&lt;BR /&gt;I get the expected results.</description>
      <pubDate>Thu, 25 Aug 2005 01:37:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-usage-with-allocate-and-derived-type/m-p/840470#M58439</guid>
      <dc:creator>alexismor</dc:creator>
      <dc:date>2005-08-25T01:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Memory usage with allocate and derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-usage-with-allocate-and-derived-type/m-p/840471#M58440</link>
      <description>&lt;DIV&gt;I have the similar experience. It seems that in watch window the results displayed are wrong, but the final results of the program are correct.&lt;/DIV&gt;</description>
      <pubDate>Fri, 26 Aug 2005 02:33:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-usage-with-allocate-and-derived-type/m-p/840471#M58440</guid>
      <dc:creator>Zhanghong_T_</dc:creator>
      <dc:date>2005-08-26T02:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Memory usage with allocate and derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-usage-with-allocate-and-derived-type/m-p/840472#M58441</link>
      <description>I can reproduce Alexis' problem and will let the developers know about it.  It seems that the debugger is misinterpreting the information the compiler supplies.</description>
      <pubDate>Fri, 26 Aug 2005 02:47:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-usage-with-allocate-and-derived-type/m-p/840472#M58441</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2005-08-26T02:47:50Z</dc:date>
    </item>
  </channel>
</rss>

