<?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>Intel® Fortran CompilerのトピックRe: ALLOCATE(CHARACTER(N) :: cStr); LEN(cStr) returns wrong value after assignment</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216498#M152194</link>
    <description>&lt;P&gt;allocate LHS (left hand side) came in at Fortran 2003(?) so your assignment reallocates the string to 13 chars.&amp;nbsp; If you want the old standard behaviour there is a compiler option for that.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Oct 2020 18:55:56 GMT</pubDate>
    <dc:creator>andrew_4619</dc:creator>
    <dc:date>2020-10-10T18:55:56Z</dc:date>
    <item>
      <title>ALLOCATE(CHARACTER(N) :: cStr); LEN(cStr) returns wrong value after assignment</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216489#M152191</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I run into the following problem with LEN() function returning a wrong value for an allocated CHARACTER string after an assignment. Short Example:&lt;/P&gt;
&lt;PRE&gt;CHARACTER(:), ALLOCATABLE :: cStr&lt;BR /&gt;INTEGER :: N = 32, iLen&lt;BR /&gt;ALLOCATE(CHARACTER(N) :: cStr)&lt;BR /&gt;iLen = LEN(cStr)         ! = 32 (OK)&lt;BR /&gt;!       123456789x123456&lt;BR /&gt;cStr = '13 characters' &lt;BR /&gt;iLen = LEN(cStr)         ! = 13 (NOT OK)&lt;/PRE&gt;
&lt;P&gt;I have tested this under Win7 IFORT 15.0.4.221 and Win10 with IFORT 19.0.8.324, on both platforms IA-32 and x64 .&lt;/P&gt;
&lt;P&gt;To me, this appears to be a bug. Am I wrong?&lt;/P&gt;
&lt;P&gt;Joerg Kuthe&lt;BR /&gt;(working for Intel Elite Resellers qtsoftware.de and polyhedron.com)&lt;/P&gt;</description>
      <pubDate>Sat, 10 Oct 2020 16:33:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216489#M152191</guid>
      <dc:creator>joerg_kuthe</dc:creator>
      <dc:date>2020-10-10T16:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: ALLOCATE(CHARACTER(N) :: cStr); LEN(cStr) returns wrong value after assignment</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216498#M152194</link>
      <description>&lt;P&gt;allocate LHS (left hand side) came in at Fortran 2003(?) so your assignment reallocates the string to 13 chars.&amp;nbsp; If you want the old standard behaviour there is a compiler option for that.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Oct 2020 18:55:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216498#M152194</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2020-10-10T18:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: ALLOCATE(CHARACTER(N) :: cStr); LEN(cStr) returns wrong value after assignment</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216499#M152195</link>
      <description>&lt;P&gt;That option does not apply to allocatable deferred-length character, which was new in F2008. The standard-conforming behavior is the only one available.&lt;/P&gt;
&lt;P&gt;You can avoid the reallocation with:&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;cStr(:) = '13 characters' &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Oct 2020 19:36:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216499#M152195</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2020-10-10T19:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: ALLOCATE(CHARACTER(N) :: cStr); LEN(cStr) returns wrong value after assignment</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216564#M152197</link>
      <description>&lt;P&gt;That's it! Thanks a lot Steve.&lt;/P&gt;
&lt;P&gt;Jörg&lt;/P&gt;</description>
      <pubDate>Sun, 11 Oct 2020 09:21:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216564#M152197</guid>
      <dc:creator>joerg_kuthe</dc:creator>
      <dc:date>2020-10-11T09:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: ALLOCATE(CHARACTER(N) :: cStr); LEN(cStr) returns wrong value after assignment</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216878#M152216</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/5442"&gt;@Steve_Lionel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Re: your comment upthread, "&lt;SPAN&gt;That option does not apply to allocatable deferred-length character, which was new in F2008&lt;/SPAN&gt;" - I do not think that is accurate.&lt;/P&gt;
&lt;P&gt;Fortran 2003 introduced support for both deferred length objects (including scalar) of CHARACTER intrinsic type and the intrinsic assignment semantics of allocation (or reallocation) of variable to conform to 'expr' including that for&amp;nbsp;deferred length scalar objects of CHARACTER intrinsic type.&lt;/P&gt;
&lt;P&gt;Readers can look up Note 7.35 in section&amp;nbsp;7.4.1.3 Interpretation of intrinsic assignments in the 2003 standard document.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 15:21:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216878#M152216</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2020-10-12T15:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: ALLOCATE(CHARACTER(N) :: cStr); LEN(cStr) returns wrong value after assignment</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216885#M152218</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/92920"&gt;@FortranFan&lt;/a&gt;&amp;nbsp;, yes, you are correct. This is indeed a F2003 feature. Nonetheless, I am also correct that the ifort option /assume:realloc_lhs does not apply to deferred-length character. It did in an early beta at one time, but I successfully argued at the time that this was a new feature and didn't warrant a "do it the old way" compatibility option.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 15:53:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ALLOCATE-CHARACTER-N-cStr-LEN-cStr-returns-wrong-value-after/m-p/1216885#M152218</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2020-10-12T15:53:50Z</dc:date>
    </item>
  </channel>
</rss>

