<?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 A good one. in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/compiler-bug-array-of-abstract-class/m-p/1049849#M114910</link>
    <description>&lt;P&gt;A good one.&lt;/P&gt;

&lt;P&gt;It'll be interesting to learn about this from Intel folks. &amp;nbsp;The problem appears with the statement [fortran]&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;ALLOCATE( foo, SOURCE = SPREAD( fooSource, 1, N ) )[/fortran] specifically the use of SPREAD intrinsic since the following executes [fortran]ALLOCATE( foo(N), SOURCE = fooSource ) !.. works ok[/fortran].&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Nov 2014 14:48:44 GMT</pubDate>
    <dc:creator>FortranFan</dc:creator>
    <dc:date>2014-11-07T14:48:44Z</dc:date>
    <item>
      <title>compiler bug - array of abstract class</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/compiler-bug-array-of-abstract-class/m-p/1049848#M114909</link>
      <description>&lt;P&gt;The code below compiles well with ifort (IFORT) 15.0.0 20140723 under Linux, however, it terminates abruptly when accessing an array element.&amp;nbsp; There is no error message or stack traceback even when using&lt;/P&gt;

&lt;P&gt;ifort -o testing -stand f08 -check bounds -nologo -fpe:0 -debug full -O0 -warn all -traceback -dbglibs testing.f90&lt;/P&gt;

&lt;P&gt;to compile.&lt;/P&gt;

&lt;P&gt;----8&amp;lt;--------8&amp;lt;--------8&amp;lt;--------8&amp;lt;--------8&amp;lt;--------8&amp;lt;--------8&amp;lt;----&lt;/P&gt;

&lt;P&gt;MODULE class_IFoo&lt;BR /&gt;
	&amp;nbsp; IMPLICIT NONE&lt;BR /&gt;
	&amp;nbsp; PRIVATE&lt;/P&gt;

&lt;P&gt;&amp;nbsp; TYPE, ABSTRACT, PUBLIC :: IFoo&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; CONTAINS&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROCEDURE(getBarI), DEFERRED, PUBLIC :: getBar&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROCEDURE(setBarI), DEFERRED, PUBLIC :: setBar&lt;BR /&gt;
	&amp;nbsp; END TYPE IFoo&lt;BR /&gt;
	&amp;nbsp; ABSTRACT INTERFACE&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER FUNCTION getBarI( this ) RESULT( bar )&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPORT :: IFoo&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS(IFoo), INTENT(in) :: this&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END FUNCTION getBarI&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUBROUTINE setBarI( this, bar )&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPORT :: IFoo&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS(IFoo), INTENT(inout) :: this&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTENT(in)&amp;nbsp;&amp;nbsp;&amp;nbsp; :: bar&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END SUBROUTINE setBarI&lt;BR /&gt;
	&amp;nbsp; END INTERFACE&lt;BR /&gt;
	END MODULE class_IFoo&lt;BR /&gt;
	MODULE class_TFoo&lt;BR /&gt;
	&amp;nbsp; USE class_IFoo, ONLY : IFoo&lt;BR /&gt;
	&amp;nbsp; IMPLICIT NONE&lt;BR /&gt;
	&amp;nbsp; PRIVATE&lt;/P&gt;

&lt;P&gt;&amp;nbsp; TYPE, EXTENDS(IFoo), PUBLIC :: TFoo&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER :: bar&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; CONTAINS&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROCEDURE, PUBLIC :: getBar&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROCEDURE, PUBLIC :: setBar&lt;BR /&gt;
	&amp;nbsp; END TYPE TFoo&lt;/P&gt;

&lt;P&gt;CONTAINS&lt;BR /&gt;
	&amp;nbsp; INTEGER FUNCTION getBar( this ) RESULT(bar)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS(TFoo), INTENT(in) :: this&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; bar = this % bar&lt;BR /&gt;
	&amp;nbsp; END FUNCTION getBar&lt;BR /&gt;
	&amp;nbsp; SUBROUTINE SetBar( this, bar)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS(TFoo), INTENT(inout) :: this&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTENT(in)&amp;nbsp;&amp;nbsp;&amp;nbsp; :: bar&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; this % bar = bar&lt;BR /&gt;
	&amp;nbsp; END SUBROUTINE SetBar&lt;BR /&gt;
	END MODULE class_TFoo&lt;BR /&gt;
	PROGRAM test_array_of_abstract&lt;BR /&gt;
	&amp;nbsp; USE class_IFoo, ONLY : IFoo&lt;BR /&gt;
	&amp;nbsp; USE class_TFoo, ONLY : TFoo&lt;BR /&gt;
	&amp;nbsp; IMPLICIT NONE&lt;BR /&gt;
	&amp;nbsp; INTEGER,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PARAMETER&amp;nbsp;&amp;nbsp; :: N = 2&lt;BR /&gt;
	&amp;nbsp; INTEGER&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :: i, bar&lt;BR /&gt;
	&amp;nbsp; CLASS(IFoo), ALLOCATABLE :: foo(:)&lt;BR /&gt;
	&amp;nbsp; CLASS(IFoo), ALLOCATABLE :: fooSource&lt;BR /&gt;
	&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; ALLOCATE( TFoo :: fooSource )&lt;BR /&gt;
	&amp;nbsp; CALL fooSource % setBar( 13 )&lt;BR /&gt;
	&amp;nbsp; PRINT '(A,I2)', 'The bar value of the source is set to ', fooSource % getBar()&lt;/P&gt;

&lt;P&gt;&amp;nbsp; ALLOCATE( foo, SOURCE = SPREAD( fooSource, 1, N ) )&lt;/P&gt;

&lt;P&gt;&amp;nbsp; DO i = 1, N&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT '(A,I2)', 'Getting bar from foo#', i&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bar = foo(i)%getBar()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !&amp;nbsp; This line terminates the code with no message&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT '(A,I2)', 'Found bar to be', bar&lt;BR /&gt;
	&amp;nbsp; END DO&lt;/P&gt;

&lt;P&gt;END PROGRAM test_array_of_abstract&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2014 10:30:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/compiler-bug-array-of-abstract-class/m-p/1049848#M114909</guid>
      <dc:creator>Ernst_A__Meese</dc:creator>
      <dc:date>2014-11-07T10:30:16Z</dc:date>
    </item>
    <item>
      <title>A good one.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/compiler-bug-array-of-abstract-class/m-p/1049849#M114910</link>
      <description>&lt;P&gt;A good one.&lt;/P&gt;

&lt;P&gt;It'll be interesting to learn about this from Intel folks. &amp;nbsp;The problem appears with the statement [fortran]&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;ALLOCATE( foo, SOURCE = SPREAD( fooSource, 1, N ) )[/fortran] specifically the use of SPREAD intrinsic since the following executes [fortran]ALLOCATE( foo(N), SOURCE = fooSource ) !.. works ok[/fortran].&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2014 14:48:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/compiler-bug-array-of-abstract-class/m-p/1049849#M114910</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-11-07T14:48:44Z</dc:date>
    </item>
    <item>
      <title>Looks like an ifort bug</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/compiler-bug-array-of-abstract-class/m-p/1049850#M114911</link>
      <description>&lt;P&gt;Looks like an ifort bug getting the return type of SPREAD( fooSource, 1, N ) correct, ie, a rank one array of extent N, each element a copy of fooSource.&amp;nbsp; Just as FortranFan noted, that should be equivalent to ALLOCATE( foo(N), SOURCE = fooSource).&lt;/P&gt;

&lt;P&gt;I'll report this to the developers.&lt;/P&gt;

&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2014 20:30:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/compiler-bug-array-of-abstract-class/m-p/1049850#M114911</guid>
      <dc:creator>pbkenned1</dc:creator>
      <dc:date>2014-11-10T20:30:32Z</dc:date>
    </item>
    <item>
      <title>Reported to the developers,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/compiler-bug-array-of-abstract-class/m-p/1049851#M114912</link>
      <description>&lt;P&gt;Reported to the developers, internal tracking ID DPD200363043.&amp;nbsp; I'll let you know what they have to say.&lt;/P&gt;

&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2014 21:13:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/compiler-bug-array-of-abstract-class/m-p/1049851#M114912</guid>
      <dc:creator>pbkenned1</dc:creator>
      <dc:date>2014-11-10T21:13:21Z</dc:date>
    </item>
    <item>
      <title>This is resolved in Composer</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/compiler-bug-array-of-abstract-class/m-p/1049852#M114913</link>
      <description>&lt;P&gt;This is resolved in Composer XE 2015 update #2, so I'm closing this ticket now.&amp;nbsp; This was complicated to fix, numerous tweaks were needed to make spread work correctly with polymorphic vars.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Patrick&lt;/P&gt;

&lt;P&gt;[U535070]$ ifort -V&lt;BR /&gt;
	Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.2.164 Build 20150121&lt;BR /&gt;
	Copyright (C) 1985-2015 Intel Corporation.&amp;nbsp; All rights reserved.&lt;/P&gt;

&lt;P&gt;[U535070]$ ifort U535070.f90 -o U535070.f90.x&lt;BR /&gt;
	[U535070]$ ./U535070.f90.x&lt;BR /&gt;
	The bar value of the source is set to 13&lt;BR /&gt;
	Getting bar from foo# 1&lt;BR /&gt;
	Found bar to be13&lt;BR /&gt;
	Getting bar from foo# 2&lt;BR /&gt;
	Found bar to be13&lt;BR /&gt;
	[U535070]$&lt;/P&gt;</description>
      <pubDate>Wed, 11 Feb 2015 22:22:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/compiler-bug-array-of-abstract-class/m-p/1049852#M114913</guid>
      <dc:creator>pbkenned1</dc:creator>
      <dc:date>2015-02-11T22:22:15Z</dc:date>
    </item>
  </channel>
</rss>

