<?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 Character string initialization in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784783#M29528</link>
    <description>The compiler is enforcing a requirement of the standard that you don't effectively give multiple DATA initializations for the same array. Apparently, CVF allowed this, presumably giving the last one effect. So it looks like the compiler has led you to correct the code.</description>
    <pubDate>Fri, 22 Jul 2011 16:59:54 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2011-07-22T16:59:54Z</dc:date>
    <item>
      <title>Character string initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784780#M29525</link>
      <description>&lt;P&gt;Hello, I have a question concerning the initialization of character strings in a subroutine. I am porting legacy code from CVF 6.6B to Intel 12.0 and the following sample "worked correctly" in CVF with variable CTITLE having the intended values specified in the DATA statements. However, I am not sure if this was bad programming and worked by accident!&lt;BR /&gt;&lt;BR /&gt;I have found with the Intel solution the data is messed up, apparently due to the initialization CTITLE(8) = ' ', and found that by removing the initialization the new solution works. I read that the DATA statement pads the end of the strings with blank characters so I am assuming that everything in CTITLE is initialized, as I have had bad experiences with uninitialized data in the past. My question is why would the initialization specified with CTITLE have an effect on the data specified in the DATA statements? Thank you.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="37875-Image2.jpg"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/10028iDDA0C9D2690851BE/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="37875-Image2.jpg" alt="37875-Image2.jpg" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2011 15:37:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784780#M29525</guid>
      <dc:creator>bbeyer</dc:creator>
      <dc:date>2011-07-22T15:37:49Z</dc:date>
    </item>
    <item>
      <title>Character string initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784781#M29526</link>
      <description>Can you attach a compilable source that demonstrates the problem? I can't reproduce it based on the screenshot.&lt;BR /&gt;&lt;BR /&gt;When you DATA initialize a local subroutine variable, that gives it the SAVE attribute and it will be allocated statically. My guess is that there's more going on than what has been shown here so far.</description>
      <pubDate>Fri, 22 Jul 2011 16:03:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784781#M29526</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-07-22T16:03:28Z</dc:date>
    </item>
    <item>
      <title>Character string initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784782#M29527</link>
      <description>&lt;P&gt;Steve,&lt;BR /&gt;I attached a sample program that replicates the question. The source looks like this:&lt;BR /&gt;&lt;BR /&gt;IMPLICIT NONE&lt;BR /&gt;!&lt;BR /&gt;INTEGER*4 J&lt;BR /&gt;CHARACTER*50 :: CTITLE(8) = ' ' !THIS DOES NOT WORK CORRECTLY&lt;BR /&gt;! CHARACTER*50 CTITLE(8) !THIS WORKS&lt;/P&gt;&lt;P&gt;DATA CTITLE(1) /'POINT DESIGN'/&lt;BR /&gt;DATA CTITLE(2) /'ACTUAL DESIGN'/&lt;BR /&gt;DATA CTITLE(3) /'ACTUAL RATING'/&lt;BR /&gt;DATA CTITLE(4) /'RECALC ACTUAL RATING DUE TO RESET USE APPENDIX A6'/&lt;BR /&gt;DATA CTITLE(5) /'NON-PRISMATIC MINIMUM LTB CALCULATIONS FOR DESIGN'/&lt;BR /&gt;DATA CTITLE(6) /'NON-PRISMATIC RECALCULATED, APPENDIX A6 SET FALSE'/&lt;BR /&gt;DATA CTITLE(7) /'MOVING LEFT TO RIGHT, RIGHT SIDE OF PIER'/&lt;BR /&gt;DATA CTITLE(8) /'MOVING RIGHT TO LEFT, LEFT SIDE OF PIER'/&lt;BR /&gt;!&lt;BR /&gt;DO J = 1,8&lt;BR /&gt; WRITE(*,*) CTITLE(J)&lt;BR /&gt;ENDDO&lt;BR /&gt;CONTINUE&lt;BR /&gt;END&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2011 16:39:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784782#M29527</guid>
      <dc:creator>bbeyer</dc:creator>
      <dc:date>2011-07-22T16:39:53Z</dc:date>
    </item>
    <item>
      <title>Character string initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784783#M29528</link>
      <description>The compiler is enforcing a requirement of the standard that you don't effectively give multiple DATA initializations for the same array. Apparently, CVF allowed this, presumably giving the last one effect. So it looks like the compiler has led you to correct the code.</description>
      <pubDate>Fri, 22 Jul 2011 16:59:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784783#M29528</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2011-07-22T16:59:54Z</dc:date>
    </item>
    <item>
      <title>Character string initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784784#M29529</link>
      <description>The source you attached demonstrates a quite different issue. Tim is correct that you are not allowed to initialize the same part of the variable more than once. If I use the "this works" version, the code works correctly. &lt;BR /&gt;&lt;BR /&gt;What did you do to show the results you presented in the original post?</description>
      <pubDate>Fri, 22 Jul 2011 17:09:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784784#M29529</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-07-22T17:09:49Z</dc:date>
    </item>
    <item>
      <title>Character string initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784785#M29530</link>
      <description>&lt;P&gt;For the original post I used the original statement of the legacy code that worked in CVF:&lt;BR /&gt;CHARACTER*50 :: CTITLE(8) = ' '&lt;BR /&gt;This sounds like it is now working correctly per the standard, but honestly I liked the way CVF handled this situation from auser friendlyperspective, although it may not have been per the standard. Maybe a compiler warning would be beneficial to alert users of the double initialization occurring and that this can apparently scramble up the data so that neither initialization is working. Thank you Steve and Tim for the insight into this.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2011 17:49:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784785#M29530</guid>
      <dc:creator>bbeyer</dc:creator>
      <dc:date>2011-07-22T17:49:56Z</dc:date>
    </item>
    <item>
      <title>Character string initialization</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784786#M29531</link>
      <description>Oh, now I understand. The compiler does give a standards warning if you ask for it. We do currently have an issue where the results, when there is overlap, is unpredictable. It's on our list to look at but has low priority, as it is a user error.&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Jul 2011 18:04:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-string-initialization/m-p/784786#M29531</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-07-22T18:04:18Z</dc:date>
    </item>
  </channel>
</rss>

