<?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 Thanks!  Is the an option to in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067424#M118773</link>
    <description>&lt;P&gt;Thanks!&amp;nbsp; Is the an option to get the compiler to warn about such things?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jan 2017 23:33:05 GMT</pubDate>
    <dc:creator>dajum</dc:creator>
    <dc:date>2017-01-12T23:33:05Z</dc:date>
    <item>
      <title>Problem with alocation of character deferred length string in defined type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067419#M118768</link>
      <description>&lt;P&gt;I have defined a type in a module as:&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;TYPE::CHARARRAY&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sequence&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CHARACTER*32 NAME&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CHARACTER(LEN=:),ALLOCATABLE :: CA(:)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;INTEGER VTYPE&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;INTEGER NLEN&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;END TYPE&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;TYPE(CHARARRAY),ALLOCATABLE:: UDCA(:)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I then allocate the array as:&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;ALLOCATE(UDCA(NUDCASIZE),STAT=ERR)&lt;/P&gt;

&lt;P&gt;THen the string CA as:&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;ALLOCATE(CHARACTER(LEN=CLEN)::UDCA(NUMUDCA+1)%CA(NSIZE),STAT=ERR)&lt;/P&gt;

&lt;P&gt;Where CLEN, NUMUDCA, and NSIZE are all integers defined at runtime.&lt;/P&gt;

&lt;P&gt;Looking at this in the debugger shows CA as an udefined pointer, but ERR=0 and checking ALLOCATED(UDCA(NUMUDCA+1)%CA) don't show any errors. The code seems to be able to set the string and print it out again.&amp;nbsp; But using it as an argument to a subroutine crashes:&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CALL SAVUDCA(NREC,UDCA(I)%CA,UDCA(I)%NLEN,NFILE)&lt;/P&gt;

&lt;P&gt;Any idea why?&lt;/P&gt;

&lt;P&gt;RUnning with PSXE2016&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 15:56:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067419#M118768</guid>
      <dc:creator>dajum</dc:creator>
      <dc:date>2017-01-11T15:56:21Z</dc:date>
    </item>
    <item>
      <title>The debugger is probably</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067420#M118769</link>
      <description>&lt;P&gt;The debugger is probably telling fibs.&amp;nbsp; It does that, more often than not.&lt;/P&gt;

&lt;P&gt;More code is required to diagnose the crash - ideally something runnable.&amp;nbsp; Obvious questions - is `i` in the range of 1:NUDCASIZE, has the CA component of element `i` been allocated (you say "the string..." in a few places, but there are actually NUDCASIZE deferred length strings), what's the interface of SAVUDCA, ...&lt;/P&gt;

&lt;P&gt;(Why a sequence type?)&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 02:12:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067420#M118769</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2017-01-12T02:12:49Z</dc:date>
    </item>
    <item>
      <title>To expand on what IanH asked,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067421#M118770</link>
      <description>&lt;P&gt;To expand on what IanH asked, let us suppose for a moment that&amp;nbsp;&lt;SPAN style="font-size: 16.26px;"&gt;NUDCASIZE = 5 and&amp;nbsp;&lt;/SPAN&gt;NUMUDCA = 4. You allocate UDCA as an array with&amp;nbsp;&amp;nbsp;5 elements. Then, you allocate "the" string array component CA of UDCA(5) as an array of NSIZE elements, each of which is a character(len=CLEN) variable. That would leave UDCA(1)%CA, UDCA(2)%CA,&amp;nbsp;&lt;SPAN style="font-size: 16.26px;"&gt;UDCA(3)%CA and UDCA(4)%CA&lt;/SPAN&gt;&amp;nbsp;undefined.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Along the same lines, without seeing the declarations of the argument list of your subroutine, it is impossible to state why the call caused a crash.&lt;/P&gt;

&lt;P&gt;As you can see, you need to provide more details and be more precise in your description.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 12:17:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067421#M118770</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-01-12T12:17:00Z</dc:date>
    </item>
    <item>
      <title>The attached program exhibits</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067422#M118771</link>
      <description>&lt;P&gt;The attached program exhibits the same failure. Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 22:48:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067422#M118771</guid>
      <dc:creator>dajum</dc:creator>
      <dc:date>2017-01-12T22:48:04Z</dc:date>
    </item>
    <item>
      <title>The value of I in the main</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067423#M118772</link>
      <description>&lt;P&gt;The value of I in the main program in the code in #4 is undefined.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;One of the dummy arguments in the subroutine is assumed shape.&amp;nbsp; An explicit interface is required for an assumed shape array, there is no such interface.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 23:05:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067423#M118772</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2017-01-12T23:05:20Z</dc:date>
    </item>
    <item>
      <title>Thanks!  Is the an option to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067424#M118773</link>
      <description>&lt;P&gt;Thanks!&amp;nbsp; Is the an option to get the compiler to warn about such things?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 23:33:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067424#M118773</guid>
      <dc:creator>dajum</dc:creator>
      <dc:date>2017-01-12T23:33:05Z</dc:date>
    </item>
    <item>
      <title>s:\lang&gt;ifort /warn:all</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067425#M118774</link>
      <description>&lt;PRE class="brush:bash;"&gt;s:\lang&amp;gt;ifort /warn:all /check:all uam.f alloc.f
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.143 Build 20161005
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

alloc.f(15): warning #6717: This name has not been given an explicit type.   &lt;I&gt;
        CALL SAVUDCA(NREC,UDCA(I)%CA,UDCA(I)%NLEN,NFILE)
-------------------------------^
alloc.f(15): error #7978: Required interface for passing assumed shape array is missing from original source.   [CA]
        CALL SAVUDCA(NREC,UDCA(I)%CA,UDCA(I)%NLEN,NFILE)
----------------------------------^
compilation aborted for alloc.f (code 1)
&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 23:59:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-alocation-of-character-deferred-length-string-in/m-p/1067425#M118774</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-01-12T23:59:14Z</dc:date>
    </item>
  </channel>
</rss>

