<?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 This is old news, but I now in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753250#M9033</link>
    <description>&lt;P&gt;This is old news, but I now can confirm that the syntax that Steve mentioned ( [a ::], not [type(a) ::] ) is the correct one. So you can scrap DPD200166644.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Sergio&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2014 22:42:07 GMT</pubDate>
    <dc:creator>Sergio</dc:creator>
    <dc:date>2014-02-26T22:42:07Z</dc:date>
    <item>
      <title>Array constructor with type-spec</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753244#M9027</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;According to The Fortran 2003 handbook (Adams, Brainerd, Hendricksson), p. 112, it should be possible to declare the type of an array as&lt;BR /&gt;[ type-spec :: ac-value-list ]&lt;BR /&gt;Apparently type specification is not supported by ifort. For instance, this code fails to compile:&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;program test&lt;BR /&gt;implicit none&lt;BR /&gt;type a&lt;BR /&gt; integer :: b&lt;BR /&gt;end type&lt;BR /&gt;&lt;BR /&gt;type(a) :: c(2)&lt;BR /&gt;&lt;BR /&gt;c=[type(a) :: a(b=2),a(b=3)]&lt;BR /&gt;&lt;BR /&gt;end program&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;Am I doing something wrong? Are there plans to implement this feature?&lt;BR /&gt;</description>
      <pubDate>Sun, 27 Feb 2011 20:36:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753244#M9027</guid>
      <dc:creator>Sergio</dc:creator>
      <dc:date>2011-02-27T20:36:50Z</dc:date>
    </item>
    <item>
      <title>Array constructor with type-spec</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753245#M9028</link>
      <description>The syntax you want is:&lt;BR /&gt;&lt;BR /&gt;c = &lt;A&gt;&lt;BR /&gt;&lt;BR /&gt;though in this case the type-spec is not required. In general, the Intel compiler does support a type-spec in array constructors but for some reason doesn't here. I'll ask the developers why. You would more likely want to use a type-spec in something like:&lt;BR /&gt;&lt;BR /&gt;[real::1,2,3,4,5]&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;[character(5)::'a','ab','abc','abcd','abcde']&lt;BR /&gt;&lt;BR /&gt;Intel Fortran, as an extension, allows the latter without the type-spec.&lt;BR /&gt;&lt;BR /&gt;I'm not entirely sure what use a derived type here is since the standard requires that all ac-values be of that type.&lt;/A&gt;</description>
      <pubDate>Mon, 28 Feb 2011 01:17:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753245#M9028</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-02-28T01:17:02Z</dc:date>
    </item>
    <item>
      <title>Array constructor with type-spec</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753246#M9029</link>
      <description>&amp;gt; The syntax you want is:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; c = &lt;A&gt;&lt;BR /&gt;&lt;BR /&gt;Are you 100% sure? Other compilers work fine, plus type() appears everytime a user-derived type is used in the same context as an intrinsic type.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I'm not entirely sure what use a derived type here is since the standard requires that all ac-values be of that &amp;gt;type.&lt;BR /&gt;&lt;BR /&gt;It is not the most crucial thing, definitely. But on one hand, for the sake of clarity, but most importantly, if implicit type conversion is used.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Sergio&lt;/A&gt;</description>
      <pubDate>Mon, 28 Feb 2011 11:50:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753246#M9029</guid>
      <dc:creator>Sergio</dc:creator>
      <dc:date>2011-02-28T11:50:43Z</dc:date>
    </item>
    <item>
      <title>Array constructor with type-spec</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753247#M9030</link>
      <description>Sorry, you are right. It should be TYPE(a). Escalated as DPD200166644.&lt;BR /&gt;&lt;BR /&gt;There is no implicit type conversion in the language and the standard is quite explicit saying "C4105 (R 469) If &lt;I&gt;type-spec &lt;/I&gt;specifies a derived type, all &lt;I&gt;ac-value&lt;/I&gt; expressions in the &lt;I&gt;array-constructor&lt;/I&gt; shall be of that derived type and shall have the same kind type parameters as specified by &lt;I&gt;type-spec&lt;/I&gt;."</description>
      <pubDate>Mon, 28 Feb 2011 16:25:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753247#M9030</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-02-28T16:25:26Z</dc:date>
    </item>
    <item>
      <title>Array constructor with type-spec</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753248#M9031</link>
      <description>Thanks for clearing that :) I guess that my first contribution was just being a bit of a quibbler...</description>
      <pubDate>Tue, 01 Mar 2011 14:00:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753248#M9031</guid>
      <dc:creator>Sergio</dc:creator>
      <dc:date>2011-03-01T14:00:15Z</dc:date>
    </item>
    <item>
      <title>Array constructor with type-spec</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753249#M9032</link>
      <description>The syntax you presented for the array-constructor in reply #1 (just "type-name ::", not "TYPE(type-name) ::") seems more consistent with the rules in the standard for an array-constructor.</description>
      <pubDate>Wed, 06 Apr 2011 12:09:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753249#M9032</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2011-04-06T12:09:07Z</dc:date>
    </item>
    <item>
      <title>This is old news, but I now</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753250#M9033</link>
      <description>&lt;P&gt;This is old news, but I now can confirm that the syntax that Steve mentioned ( [a ::], not [type(a) ::] ) is the correct one. So you can scrap DPD200166644.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Sergio&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2014 22:42:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753250#M9033</guid>
      <dc:creator>Sergio</dc:creator>
      <dc:date>2014-02-26T22:42:07Z</dc:date>
    </item>
    <item>
      <title>My earlier reply was wrong.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753251#M9034</link>
      <description>&lt;P&gt;My earlier reply was wrong. As you say, the legal syntax is a:: not type(a)::. Nevertheless, ifort doesn't like the valid syntax either, in my tests.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;
program U81063

type a
  character(3) :: s
end type a

type(a), dimension(2) :: c

c = [a(s='FAI'),a(s='LED')]  ! This is accepted
c = [a :: a(s='PAS'),a(s='SED')] ! This fails

print '(2A3)',c%s

end program u81063&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;
	U81063.f90(10): error #5082: Syntax error, found '::' when expecting one of: , (/ : ]&lt;BR /&gt;
	c = [a :: a(s='PAS'),a(s='SED')] ! This fails&lt;BR /&gt;
	-------^&lt;BR /&gt;
	U81063.f90(10): error #6478: A type-name must not be used as a variable.&amp;nbsp;&amp;nbsp; &lt;A&gt;c = [a :: a(s='PAS'),a(s='SED')] ! This fails&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2014 14:41:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-constructor-with-type-spec/m-p/753251#M9034</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-02-27T14:41:18Z</dc:date>
    </item>
  </channel>
</rss>

