<?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: Allocation problems within a type in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766241#M20249</link>
    <description>&lt;P&gt;I'm not yet very familiar with allocatable TR, but your example looks legal to me -- except that it's odd that all strings within constructor should have the same length (i.e. you should insert trailing spaces manually) -- but that isn't supposed to be related? &lt;/P&gt;
&lt;P&gt;Yet, there's a subtle difference between &lt;EM&gt;allocatable_entity&lt;/EM&gt; and &lt;EM&gt;allocatable_entity(:)&lt;/EM&gt; under TR/F2003. Namely:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;fixed_array1_names%dimensions = (/'a', 'b', 'c'/)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;is supposed to a)check the actual SIZE(dimensions) b) if it doesn't match the right-hand size, deallocate it c) allocate it to right-hand size and d) assign, while&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;fixed_array1_names%dimensions(:) = (/'a', 'b', 'c'/)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;is just a normal arrayassignment (subject to possible array-bounds checking failure).&lt;/P&gt;
&lt;P&gt;Thus, except for above-mentioned length mismatch, your example looks OK to me (and theALLOCATE lineis actually unnecessary) -- but try it with (:) and see what happens. If I'm right, you discovered a compiler bug.&lt;/P&gt;
&lt;P&gt;Take my words with a grain of salt as it's quite possible that I mixed up what's in allocatable TR (supported by CVF/IVF) and what's new in Fortran 2003 (not supported by CVF/IVF). Steve?&lt;/P&gt;
&lt;P&gt;Jugoslav&lt;/P&gt;</description>
    <pubDate>Wed, 03 Mar 2004 19:43:44 GMT</pubDate>
    <dc:creator>Jugoslav_Dujic</dc:creator>
    <dc:date>2004-03-03T19:43:44Z</dc:date>
    <item>
      <title>Allocation problems within a type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766240#M20248</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;The following program compiles, but produces a run-time error (forrtl: severe (151): allocatable array is already allocated):&lt;/FONT&gt;&lt;/P&gt;
&lt;P align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;program Console2&lt;/FONT&gt;&lt;/P&gt;
&lt;P align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;type :: Dimensions&lt;/FONT&gt;&lt;/P&gt;
&lt;P align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;character*(20), allocatable, dimension(:)&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;:: dimensions &lt;/FONT&gt;&lt;/P&gt;
&lt;P align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;end type Dimensions &lt;/FONT&gt;&lt;/P&gt;
&lt;P align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;type (Dimensions) :: fixed_array1_names &lt;/FONT&gt;&lt;/P&gt;
&lt;P align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;!!deallocate (fixed_array1_names%dimensions)&lt;/FONT&gt;&lt;/P&gt;
&lt;P align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;allocate (fixed_array1_names%dimensions(3))&lt;/FONT&gt;&lt;/P&gt;
&lt;P align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;fixed_array1_names%dimensions =(/'units', 'tens', 'hundreds'/)&lt;/FONT&gt;&lt;/P&gt;
&lt;P align="left"&gt;&lt;FONT face="Courier New" size="2"&gt;end program Console2&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face="Verdana" size="2"&gt;If I remove the comment and include the deallocate, I get a Visual C++ pop-up error: Debug assertion failed, Expression _CrtIsValidheapPointer(pUserData) at the deallocate&lt;/FONT&gt;. 
&lt;P&gt;&lt;/P&gt;I'm doing something wrong, but I can't think what! Can anybody please enlighten me? 
&lt;P&gt;&lt;/P&gt;&lt;FONT face="Verdana" size="2"&gt;All the best,&lt;/FONT&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2004 18:57:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766240#M20248</guid>
      <dc:creator>eddie_breeveld</dc:creator>
      <dc:date>2004-03-03T18:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation problems within a type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766241#M20249</link>
      <description>&lt;P&gt;I'm not yet very familiar with allocatable TR, but your example looks legal to me -- except that it's odd that all strings within constructor should have the same length (i.e. you should insert trailing spaces manually) -- but that isn't supposed to be related? &lt;/P&gt;
&lt;P&gt;Yet, there's a subtle difference between &lt;EM&gt;allocatable_entity&lt;/EM&gt; and &lt;EM&gt;allocatable_entity(:)&lt;/EM&gt; under TR/F2003. Namely:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;fixed_array1_names%dimensions = (/'a', 'b', 'c'/)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;is supposed to a)check the actual SIZE(dimensions) b) if it doesn't match the right-hand size, deallocate it c) allocate it to right-hand size and d) assign, while&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;fixed_array1_names%dimensions(:) = (/'a', 'b', 'c'/)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;is just a normal arrayassignment (subject to possible array-bounds checking failure).&lt;/P&gt;
&lt;P&gt;Thus, except for above-mentioned length mismatch, your example looks OK to me (and theALLOCATE lineis actually unnecessary) -- but try it with (:) and see what happens. If I'm right, you discovered a compiler bug.&lt;/P&gt;
&lt;P&gt;Take my words with a grain of salt as it's quite possible that I mixed up what's in allocatable TR (supported by CVF/IVF) and what's new in Fortran 2003 (not supported by CVF/IVF). Steve?&lt;/P&gt;
&lt;P&gt;Jugoslav&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2004 19:43:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766241#M20249</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-03-03T19:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation problems within a type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766242#M20250</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;Good idea, I also tried in in CVF and either way works fine - but not IVF. I'll submit another bug report to Intel (number three in as many days). Thanks for your help Jugoslav. 
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;ps - All your'colon-bracket's are being translated into smilies!&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Mar 2004 20:38:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766242#M20250</guid>
      <dc:creator>eddie_breeveld</dc:creator>
      <dc:date>2004-03-03T20:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation problems within a type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766243#M20251</link>
      <description>&lt;DIV&gt;Does it work the other way (with smiley :smileyvery-happy:) in IVF?&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Mar 2004 20:56:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766243#M20251</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-03-03T20:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation problems within a type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766244#M20252</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Your last reply seems to have gone smiley mad ;-)&lt;/P&gt;
&lt;P&gt;With both IVF and CVF, variable length strings seem to beallowed (i.e., padding is not required) in the assignment.&lt;/P&gt;
&lt;P&gt;I cannot get any version to work at run-time(with or without (:), with or without the allocate, with or without the deallocate) in IVF. I've put in a bug report. &lt;/P&gt;
&lt;P&gt;Interestingly, but when I think about it not surprisingly, one of my previous IVF bugs is also a CVF bug.&lt;/P&gt;
&lt;P&gt;All the best,&lt;/P&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Mar 2004 22:40:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766244#M20252</guid>
      <dc:creator>eddie_breeveld</dc:creator>
      <dc:date>2004-03-03T22:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation problems within a type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766245#M20253</link>
      <description>&lt;DIV&gt;I am trying to get the punctuation smileys disabled in the forum. Supposedly, it will happen soon....&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Mar 2004 23:08:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766245#M20253</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-03-03T23:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation problems within a type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766246#M20254</link>
      <description>Re smileys: I think it's perfectly OK to enable parsing of smileys in form :smileytongue:, but not in short form, like :)
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Now both seems to be gone :-(.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;</description>
      <pubDate>Sat, 06 Mar 2004 22:41:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766246#M20254</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-03-06T22:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation problems within a type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766247#M20255</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Yes, that's exactly what I asked for - the :smiley: syntax recognized (this is what the button gives you), but punctuation sequences not turned into smileys. Let's see if they did it... :smileytongue:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Sigh - well, half right, anyway...&lt;/DIV&gt;&lt;P&gt;Message Edited by sblionel on &lt;SPAN class="date_text"&gt;03-06-2004&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;06:55 PM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Mar 2004 07:55:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766247#M20255</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-03-07T07:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Allocation problems within a type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766248#M20256</link>
      <description>&lt;DIV&gt;I had asked that the syntax with the colons, as the button gives you, continue to work. I'll have to ask again...&lt;/DIV&gt;</description>
      <pubDate>Sun, 07 Mar 2004 07:56:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Allocation-problems-within-a-type/m-p/766248#M20256</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-03-07T07:56:42Z</dc:date>
    </item>
  </channel>
</rss>

