<?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: Parametrized derived type in another parametrized type in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1207681#M151683</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Dmitry_D wrote:
.. I've found some important issues with the Intel Fortran compiler (ifort version 19.0.2.187) trying to use an object of one parametrized derived type in another parametrized derived type. ..
..
What do you think about these issues?

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Welcome to the club, you're not the first to find these issues.&amp;nbsp; If your license terms includes support, please submit requests to review these problems at the Intel Online Service Center:&amp;nbsp;&lt;A href="https://supporttickets.intel.com/?lang=en-US" target="_blank" rel="noopener"&gt;https://supporttickets.intel.com/?lang=en-US&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In the absence of a reasonably featured generics/template/metaprogramming facilities in Fortran, parameterized derived types - introduced all the way back in Fortran 2003 standard revision, can really prove valuable in a number of situations for typical Fortran coding needs that involve 'parameterized' designs of one 'classes' (to borrow an OO term).&amp;nbsp; Unfortunately, the compiler support for this feature is very spotty and one encounters an internal error or ICE often and that's essentially a compiler bug.&amp;nbsp; Getting the compiler team to resolve such errors is the only recourse, so submit away all the errors you face.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Sep 2020 19:27:49 GMT</pubDate>
    <dc:creator>FortranFan</dc:creator>
    <dc:date>2020-09-08T19:27:49Z</dc:date>
    <item>
      <title>Parametrized derived type in another parametrized type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1207667#M151682</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I've found some important issues with the Intel Fortran compiler (ifort version 19.0.2.187) trying to use an object of one parametrized derived type in another parametrized derived type.&lt;/P&gt;
&lt;P&gt;The following type declarations are compiled without any error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TYPE T1 (M)&lt;BR /&gt;INTEGER, LEN :: M&lt;BR /&gt;REAL V (M)&lt;BR /&gt;END TYPE T1&lt;/P&gt;
&lt;P&gt;TYPE T2 (M, N)&lt;BR /&gt;INTEGER, LEN :: M, N&lt;BR /&gt;TYPE(T1(M=M)) V1&lt;BR /&gt;REAL V2 (N)&lt;BR /&gt;END TYPE T2&lt;/P&gt;
&lt;P&gt;TYPE T3 (N)&lt;BR /&gt;INTEGER, LEN :: N&lt;BR /&gt;TYPE(T1(M=N)) V1&lt;BR /&gt;REAL V2 (N)&lt;BR /&gt;END TYPE T3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see, V1 of type T1 is a member of types T2 and T3.&lt;/P&gt;
&lt;P&gt;If I try to declare a local variable of type T2, the following error occurs:&lt;/P&gt;
&lt;P&gt;internal error: Please visit '&lt;A href="http://www.intel.com/software/products/support" target="_blank"&gt;http://www.intel.com/software/products/support&lt;/A&gt;' for assistance.&lt;BR /&gt;&amp;nbsp;TYPE(T2(M=2, N=3)) A&lt;BR /&gt;^&lt;BR /&gt;[ Aborting due to internal error. ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The same kind of error takes place if any procedure has a dummy argument of type T2:&lt;/P&gt;
&lt;P&gt;internal error: Please visit '&lt;A href="http://www.intel.com/software/products/support" target="_blank"&gt;http://www.intel.com/software/products/support&lt;/A&gt;' for assistance.&lt;BR /&gt;TYPE(T2(*,*)), INTENT(IN) :: A&lt;BR /&gt;^&lt;BR /&gt;[ Aborting due to internal error. ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The situation is not better if I declare a variable of type T3:&lt;/P&gt;
&lt;P&gt;TYPE(T3(N=3)) A&lt;/P&gt;
&lt;P&gt;This results in the following error:&lt;/P&gt;
&lt;P&gt;catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you think about these issues?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 18:48:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1207667#M151682</guid>
      <dc:creator>Dmitry_D</dc:creator>
      <dc:date>2020-09-08T18:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Parametrized derived type in another parametrized type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1207681#M151683</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Dmitry_D wrote:
.. I've found some important issues with the Intel Fortran compiler (ifort version 19.0.2.187) trying to use an object of one parametrized derived type in another parametrized derived type. ..
..
What do you think about these issues?

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Welcome to the club, you're not the first to find these issues.&amp;nbsp; If your license terms includes support, please submit requests to review these problems at the Intel Online Service Center:&amp;nbsp;&lt;A href="https://supporttickets.intel.com/?lang=en-US" target="_blank" rel="noopener"&gt;https://supporttickets.intel.com/?lang=en-US&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In the absence of a reasonably featured generics/template/metaprogramming facilities in Fortran, parameterized derived types - introduced all the way back in Fortran 2003 standard revision, can really prove valuable in a number of situations for typical Fortran coding needs that involve 'parameterized' designs of one 'classes' (to borrow an OO term).&amp;nbsp; Unfortunately, the compiler support for this feature is very spotty and one encounters an internal error or ICE often and that's essentially a compiler bug.&amp;nbsp; Getting the compiler team to resolve such errors is the only recourse, so submit away all the errors you face.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 19:27:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1207681#M151683</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2020-09-08T19:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Parametrized derived type in another parametrized type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1207708#M151684</link>
      <description>&lt;P&gt;Also fails in the 2021 Beta 8 compiler, with the additional line of:&lt;/P&gt;
&lt;P&gt;Internal error store_pdtlen_data_space: Cannot find record&lt;/P&gt;
&lt;P&gt;I've seen this error before, though I don't know if it resembled your test code. Please do report it using the Online Service Center.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 20:53:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1207708#M151684</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2020-09-08T20:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Parametrized derived type in another parametrized type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1207889#M151687</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I appeciate very much your feedbacks to my post. It seems that the Fortran compiler still needs improvements to allow using all potential of parametrized derived types.&lt;/P&gt;
&lt;P&gt;Personally I don't have access to Intel Compiler Support but I'll send a request to our informatic assistance. Hopefully they'll be able to ask Intel for a fix.&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 09:56:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1207889#M151687</guid>
      <dc:creator>Dmitry_D</dc:creator>
      <dc:date>2020-09-09T09:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Parametrized derived type in another parametrized type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1207954#M151689</link>
      <description>&lt;P&gt;PDTs with length parameters are more difficult to implement than anyone imagined when they were first proposed for Fortran 2003. One popular compiler got it so completely wrong that the developers advise users to avoid them. The Intel compiler does a pretty good job, but there are some unusual usages that still trip it up.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 15:16:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1207954#M151689</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2020-09-09T15:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Parametrized derived type in another parametrized type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1209264#M151782</link>
      <description>&lt;P&gt;Hello Steve,&lt;/P&gt;
&lt;P&gt;I do believe that the compiler developers do their best to implement new Fortran functionalities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For those who are interested in the topic of this post, I can propose two quick solutions.&lt;/P&gt;
&lt;P&gt;One is to extend T1 as follows:&lt;/P&gt;
&lt;P&gt;TYPE, EXTENDS(T1) :: T2 (N)&lt;BR /&gt;INTEGER, LEN :: N&lt;BR /&gt;REAL V2 (N)&lt;BR /&gt;END TYPE T2&lt;/P&gt;
&lt;P&gt;This works fine with the compiler versions 18 and later. It has however obvious limitations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another solution is to declare V1 as allocatable in T2. A complete example is:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MODULE TYPES_M&lt;/P&gt;
&lt;P&gt;TYPE T1 (M)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; INTEGER, LEN :: M&lt;BR /&gt;&amp;nbsp;&amp;nbsp; REAL V (M)&lt;BR /&gt;END TYPE T1&lt;/P&gt;
&lt;P&gt;TYPE T2 (M, N)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; INTEGER, LEN :: M, N&lt;BR /&gt;&amp;nbsp;&amp;nbsp; TYPE(T1(:)), ALLOCATABLE :: V1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; REAL V2 (N)&lt;BR /&gt;CONTAINS&lt;BR /&gt;&amp;nbsp;&amp;nbsp; PROCEDURE ALLOC =&amp;gt; ALLOC_T2&lt;BR /&gt;END TYPE T2&lt;/P&gt;
&lt;P&gt;CONTAINS&lt;/P&gt;
&lt;P&gt;SUBROUTINE ALLOC_T2 (A)&lt;BR /&gt;TYPE(T2(*,*)), INTENT(OUT) :: A&lt;/P&gt;
&lt;P&gt;ALLOCATE (T1(M=A%M) :: A%V1)&lt;/P&gt;
&lt;P&gt;END SUBROUTINE ALLOC_T2&lt;/P&gt;
&lt;P&gt;END MODULE TYPES_M&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;USE TYPES_M&lt;/P&gt;
&lt;P&gt;TYPE(T2(M=2, N=3)) A&lt;/P&gt;
&lt;P&gt;CALL A%ALLOC&lt;/P&gt;
&lt;P&gt;Here we need to call the type-bound procedure for each object of type T2. More coding is still needed if we want to use an array of type T2. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 18:26:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Parametrized-derived-type-in-another-parametrized-type/m-p/1209264#M151782</guid>
      <dc:creator>Dmitry_D</dc:creator>
      <dc:date>2020-09-14T18:26:40Z</dc:date>
    </item>
  </channel>
</rss>

