<?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 Quote:Steve Lionel (Intel) in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023616#M108794</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;.. the standard says "extension type (of one type with respect to another) is the &lt;STRONG&gt;same type &lt;/STRONG&gt;or is an extended type whose parent type is an extension&amp;nbsp;type of the other type." (emphasis mine)&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thanks, I missed that part.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Oct 2014 22:59:16 GMT</pubDate>
    <dc:creator>FortranFan</dc:creator>
    <dc:date>2014-10-13T22:59:16Z</dc:date>
    <item>
      <title>select type bug ??</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023607#M108785</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I put a small example together to show a behavior i don't understand, hoping for some explanation here.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;This code end up with the following in intel 15 version, the copy is not made despite the select type.&amp;nbsp; Also Is the extends_type_of results correct ?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;class cm2 is type tm T
 class cm2 is class cm T
 class cm2 is type tc T
 class cm2 is class cc T
 cm2=cm          10           1&lt;/PRE&gt;

&lt;P&gt;With gfortran 4.9.1 I have :&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;class cm2 is type tm T
 class cm2 is class cm T
 class cm2 is type tc F
 class cm2 is class cc T
 cm2=cm          10           1&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program toto
implicit none

type mother
integer :: i
end type mother
type,extends(mother) :: child
end type child

type(mother) :: tm
type(child) :: tc
class(mother),allocatable :: cm,cm2
class(child),allocatable :: cc

 allocate(cm)
 allocate(child::cm2)
 cm%i=10
 cm2%i=1
 select type (cm2)
 type is (mother)
                cm2=cm
 end select
 print *,'class cm2 is type tm',extends_type_of(cm2,tm)
 print *,'class cm2 is class cm',extends_type_of(cm2,cm)
 print *,'class cm2 is type tc',extends_type_of(cm2,tc)
 print *,'class cm2 is class cc',extends_type_of(cm2,cc)
 print *,'cm2=cm', cm%i,cm2%i
 
end program&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 14:20:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023607#M108785</guid>
      <dc:creator>Patrice_l_</dc:creator>
      <dc:date>2014-10-13T14:20:18Z</dc:date>
    </item>
    <item>
      <title>I think gfortran 4.9.1 gives</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023608#M108786</link>
      <description>&lt;P&gt;I think gfortran 4.9.1 gives the correct response for both aspects of your code: the SELECT TYPE construct as well as the EXTENDS_TYPE_OF inquiry function whereas Intel Fortran only seems to work for the first aspect. &amp;nbsp;Shouldn't the copy only take place with [fortran]CLASS IS (mother)[/fortran] construct since cm2 is a polymorphic object?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 15:38:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023608#M108786</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-10-13T15:38:18Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023609#M108787</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You are right, the type is (mother) is false in the select construct, but true in extends_type_of for both compiler.&lt;/P&gt;

&lt;P&gt;In my understanding, cm2 is polymorphic with dynamic type of child because of the allocate, but the select construct should allow&lt;/P&gt;

&lt;P&gt;to do a copy of the mother attributes. Also selecting class is (mother) , doesn' t suits me, because polymorphic assignment is not supported yet.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 15:55:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023609#M108787</guid>
      <dc:creator>Patrice_l_</dc:creator>
      <dc:date>2014-10-13T15:55:00Z</dc:date>
    </item>
    <item>
      <title>Quote:Patrice l. wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023610#M108788</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Patrice l. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You are right, the type is (mother) is false in the select construct, but true in extends_type_of for both compiler.&lt;/P&gt;

&lt;P&gt;In my understanding, cm2 is polymorphic with dynamic type of child because of the allocate, but the select construct should allow&lt;/P&gt;

&lt;P&gt;to do a copy of the mother attributes. Also selecting class is (mother) , doesn' t suits me, because polymorphic assignment is not supported yet.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I think your best bet would be defined assignment.&lt;/P&gt;

&lt;P&gt;My understanding is TYPE IS case in the SELECT TYPE construct only works when the dynamic type matches exactly with the case specification which is not true in your case.&lt;/P&gt;

&lt;P&gt;Also, when polymorphic assignment may also not work out for you whenever it becomes available: isn't it simply "syntactic sugar" i.e., short-form for&amp;nbsp;&lt;/P&gt;

&lt;P&gt;[fortran]&lt;/P&gt;

&lt;P&gt;IF (ALLOCATED(lhs)) THEN &amp;nbsp;!.. This may take place when lhs and rhs are not the same exact type&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;DEALLOCATE(lhs)&lt;/P&gt;

&lt;P&gt;END IF&lt;/P&gt;

&lt;P&gt;ALLOCATE(lhs, SOURCE=rhs))&lt;/P&gt;

&lt;P&gt;[/fortran]&lt;/P&gt;

&lt;P&gt;so the dynamic type of cm2 may change to mother following the assignment which may not be your desired result.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 17:21:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023610#M108788</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-10-13T17:21:41Z</dc:date>
    </item>
    <item>
      <title>I think the Intel results are</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023611#M108789</link>
      <description>&lt;P&gt;I think the Intel results are correct. TYPE IS is not the same as EXTENDS_TYPE_OF. The SELECT TYPE should not be done because the dynamic type of cm2 is child and not mother. But EXTENDS_TYPE_IS would return true because cm2 and tc are the same dynamic type (child) and the standard says "extension type (of one type with respect to another) is the &lt;STRONG&gt;same type &lt;/STRONG&gt;or is an extended type whose parent type is an extension&amp;nbsp;type of the other type." (emphasis mine)&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 20:21:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023611#M108789</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-10-13T20:21:57Z</dc:date>
    </item>
    <item>
      <title>Ok, In this case what is the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023612#M108790</link>
      <description>&lt;P&gt;Ok, In this case what is the best way to copy a mother information into a child one, knowing im exteding the type to allow a specific behavior for a function ?&lt;/P&gt;

&lt;P&gt;I tried many different combination of cm,cc,tc,tm apart from the cm assignment not supported, I can not perform this copy without writting it explicitly.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 20:38:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023612#M108790</guid>
      <dc:creator>Patrice_l_</dc:creator>
      <dc:date>2014-10-13T20:38:07Z</dc:date>
    </item>
    <item>
      <title>Quote:Patrice l. wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023613#M108791</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Patrice l. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Ok, In this case what is the best way to copy a mother information into a child one, knowing im exteding the type to allow a specific behavior for a function ?&lt;/P&gt;

&lt;P&gt;I tried many different combination of cm,cc,tc,tm apart from the cm assignment not supported, I can not perform this copy without writting it explicitly.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;As I mentioned in Quote #4, you can consider a defined assignment i.e., including a type-bound procedure in the base class that is tied to a generic assignment. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 20:54:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023613#M108791</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-10-13T20:54:55Z</dc:date>
    </item>
    <item>
      <title>Quote:FortranFan wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023614#M108792</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;FortranFan wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;
	&lt;/P&gt;&lt;P&gt;As I mentioned in Quote #4, you can consider a defined assignment i.e., including a type-bound procedure in the base class that is tied to a generic assignment. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;And I wrote without writting it explicitly .&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 20:59:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023614#M108792</guid>
      <dc:creator>Patrice_l_</dc:creator>
      <dc:date>2014-10-13T20:59:44Z</dc:date>
    </item>
    <item>
      <title>Perhaps you need to wait for</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023615#M108793</link>
      <description>&lt;P&gt;Perhaps you need to wait for polymorphic assignment (a F2008 feature) to be supported.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 22:02:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023615#M108793</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-10-13T22:02:16Z</dc:date>
    </item>
    <item>
      <title>Quote:Steve Lionel (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023616#M108794</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;.. the standard says "extension type (of one type with respect to another) is the &lt;STRONG&gt;same type &lt;/STRONG&gt;or is an extended type whose parent type is an extension&amp;nbsp;type of the other type." (emphasis mine)&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thanks, I missed that part.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 22:59:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023616#M108794</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-10-13T22:59:16Z</dc:date>
    </item>
    <item>
      <title>Quote:Steve Lionel (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023617#M108795</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Perhaps you need to wait for polymorphic assignment (a F2008 feature) to be supported.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Steve,&lt;/P&gt;

&lt;P&gt;How exactly will polymorphic assignment work when it does get implemented? &amp;nbsp;Will it not make the left-hand side end up with the same dynamic type as right-hand side? &amp;nbsp;i.e., for the code example in OP, will not cm2 end up with the dynamic type of cm i.e., mother and isn't that something that may not be the desired result, meaning the intent may be for cm2 to retain the type of child.&lt;/P&gt;

&lt;P&gt;In other words, can you please comment on the following?&lt;/P&gt;

&lt;P style="line-height: 19.5120010375977px;"&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;FortranFan wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P style="line-height: 19.5120010375977px;"&gt;..&lt;/P&gt;

&lt;P style="line-height: 19.5120010375977px;"&gt;Also, when polymorphic assignment may also not work out for you whenever it becomes available: isn't it simply "syntactic sugar" i.e., short-form for&amp;nbsp;&lt;/P&gt;

&lt;P style="line-height: 19.5120010375977px;"&gt;[fortran]&lt;/P&gt;

&lt;P style="line-height: 19.5120010375977px;"&gt;&lt;SPAN style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em; line-height: 19.5120010375977px;"&gt;IF (ALLOCATED(lhs)) THEN &amp;nbsp;!.. This may take place when lhs and rhs are not the same exact type&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush: fortran" style="font-size: 13px; line-height: 19.5120010375977px;"&gt;&amp;nbsp; &amp;nbsp;DEALLOCATE(lhs)
END IF
ALLOCATE(lhs, SOURCE=rhs))
&lt;/PRE&gt;

&lt;P&gt;[/fortran]&lt;/P&gt;

&lt;P style="line-height: 19.5120010375977px;"&gt;&lt;SPAN style="line-height: 19.5120010375977px; font-size: 1em;"&gt;so the dynamic type of cm2 may change to mother following the assignment which may not be your desired result.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="line-height: 19.5120010375977px;"&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 23:06:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023617#M108795</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-10-13T23:06:00Z</dc:date>
    </item>
    <item>
      <title>What FortranFan wrote is what</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023618#M108796</link>
      <description>&lt;P&gt;What FortranFan wrote is what the standard says the behavior is, and you can do that today. I had started to suggest that and had, for some reason, convinced myself it wouldn't help.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 04:37:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023618#M108796</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-10-14T04:37:10Z</dc:date>
    </item>
    <item>
      <title>FortranFan,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023619#M108797</link>
      <description>&lt;P&gt;FortranFan,&lt;/P&gt;

&lt;P&gt;In my understanding what might work is , cm2 has dynamic type of child, but in the select type it uses class is mother, then the copy that i want should be performed without modifying the dynamic type. Intrinsic assignment would be the feature in that case.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 13:19:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023619#M108797</guid>
      <dc:creator>Patrice_l_</dc:creator>
      <dc:date>2014-10-14T13:19:23Z</dc:date>
    </item>
    <item>
      <title>I'm thinking that the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023620#M108798</link>
      <description>&lt;P&gt;I'm thinking that the assignment would not be allowed. Note that inside the SELECT TYPE, cm2 loses its allocatable attribute (same as with ASSOCIATE) and thus you have a non-allocatable variable of type mother being assigned a value of type child, and that's not valid since they're not the same type.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 16:17:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023620#M108798</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-10-14T16:17:54Z</dc:date>
    </item>
    <item>
      <title>Quote:Patrice l. wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023621#M108799</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Patrice l. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;FortranFan,&lt;/P&gt;

&lt;P&gt;In my understanding what might work is , cm2 has dynamic type of child, but in the select type it uses class is mother, then the copy that i want should be performed without modifying the dynamic type. Intrinsic assignment would be the feature in that case.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Is this something you're looking for?&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;MODULE m

   !..
   IMPLICIT NONE

   !..
   PRIVATE

   TYPE, PUBLIC :: mother
      !..
      PRIVATE
      INTEGER, PUBLIC :: i

   CONTAINS
      PRIVATE
      PROCEDURE, PASS(this) :: assign_mother
      GENERIC, PUBLIC :: ASSIGNMENT(=) =&amp;gt; assign_mother
   END TYPE mother

   TYPE, EXTENDS(mother), PUBLIC :: child
   END TYPE child

CONTAINS

   PURE ELEMENTAL SUBROUTINE assign_mother(this, rhs)

      !.. Argument list
      CLASS(mother), INTENT(INOUT) :: this
      CLASS(*), INTENT(IN)         :: rhs

      !..
      SELECT TYPE (rhs)
         CLASS IS (mother)
            this%i = rhs%i
         TYPE IS (INTEGER)
            this%i = rhs
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CLASS DEFAULT
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; !.. Insert error handling here
      END SELECT

   END SUBROUTINE assign_mother

END MODULE m

PROGRAM p

   USE m, ONLY : mother, child

   !..
   IMPLICIT NONE

   !.. Local variables
   TYPE(mother) :: tm
   TYPE(child) :: tc
   CLASS(mother), ALLOCATABLE :: cm
   CLASS(mother), ALLOCATABLE :: cm2
   CLASS(child), ALLOCATABLE :: cc

   !..
   ALLOCATE(cm)
   ALLOCATE(child::cm2)
   SELECT TYPE (cm2)
      TYPE IS (mother)
         PRINT *, "cm2 is of type mother following allocation."
      TYPE IS (child)
         PRINT *, "cm2 is of type child following allocation."
      CLASS DEFAULT
         PRINT *, "cm2 is of type other than mother or child following allocation."
   END SELECT

   ALLOCATE(cc)

   cm%i=10
   !.. 
   cm2 = 1
   PRINT *, "cm2 = ", cm2%i, " following initialization."

   !..
   cm2 = cm

   !..
   PRINT *,'class cm2 is type tm',EXTENDS_TYPE_OF(cm2,tm)
   PRINT *,'class cm2 is class cm',EXTENDS_TYPE_OF(cm2,cm)
   PRINT *,'class cm2 is type tc',EXTENDS_TYPE_OF(cm2,tc)
   PRINT *,'class cm2 is class cc',EXTENDS_TYPE_OF(cm2,cc)
   PRINT *,'cm2=cm', cm%i,cm2%i

   SELECT TYPE (cm2)
      TYPE IS (mother)
         PRINT *, "cm2 is of type mother following assignment."
      TYPE IS (child)
         PRINT *, "cm2 remains of type child following assignment."
      CLASS DEFAULT
         PRINT *, "cm2 is of type other than mother or child following allocation."
   END SELECT

   !..
   STOP

END PROGRAM p&lt;/PRE&gt;

&lt;P&gt;The program runs as follows:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;&amp;nbsp;cm2 is of type child following allocation.
&amp;nbsp;cm2 = &amp;nbsp;1 &amp;nbsp;following initialization.
&amp;nbsp;class cm2 is type tm T
&amp;nbsp;class cm2 is class cm T
&amp;nbsp;class cm2 is type tc T
&amp;nbsp;class cm2 is class cc T
&amp;nbsp;cm2=cm 10 10
&amp;nbsp;cm2 remains of type child following assignment.
Press any key to continue . . .
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 17:40:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023621#M108799</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-10-14T17:40:00Z</dc:date>
    </item>
    <item>
      <title>FortranFan,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023622#M108800</link>
      <description>&lt;P&gt;FortranFan,&lt;/P&gt;

&lt;P&gt;The main program looks exactly like what i would like to write, and in practice I wrote a version avoid the select type in the assignment (i already know it). But ultimately It would be nice not to have to right that assignment function.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 18:40:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023622#M108800</guid>
      <dc:creator>Patrice_l_</dc:creator>
      <dc:date>2014-10-14T18:40:16Z</dc:date>
    </item>
    <item>
      <title>Does this do what you want?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023623#M108801</link>
      <description>&lt;P&gt;Does this do what you want?&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt; select type (cm2)
 type is (child)
                cm2%mother=cm
 end select&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 18:49:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023623#M108801</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-10-14T18:49:00Z</dc:date>
    </item>
    <item>
      <title>Yes steve,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023624#M108802</link>
      <description>&lt;P&gt;Yes steve,&lt;/P&gt;

&lt;P&gt;This is exactly what i was looking for. "But i'm confused now, there is no field mother but that works perfectly in the select type is there a part of the standard i missed ?"&amp;nbsp; Edit : Found it under type extension, very useful ;) Thank you.&lt;/P&gt;

&lt;P&gt;It doesn't work with gfortran but i think it is because of their bug with tm=cm which does not give the right result.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 19:04:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023624#M108802</guid>
      <dc:creator>Patrice_l_</dc:creator>
      <dc:date>2014-10-14T19:04:00Z</dc:date>
    </item>
    <item>
      <title>Quote:Steve Lionel (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023625#M108803</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Perhaps you need to wait for polymorphic assignment (a F2008 feature) to be supported.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Steve,&lt;/P&gt;

&lt;P&gt;Fyi, the article titled, "Compiler support for the Fortran 2003 and 2008 standards revision 15" by Ian Chivers, Jane Sleightholme at ACM SIGPLAN Fortran Forum, Volume 33 Issue 2, August 2014 indicates Intel Fortran supports the polymorphic assignment feature of Fortran 2008. &amp;nbsp;Do you think Intel would like to get this misinformation corrected?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2014 03:57:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023625#M108803</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-10-15T03:57:23Z</dc:date>
    </item>
    <item>
      <title>Quote:Patrice l. wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023626#M108804</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Patrice l. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;FortranFan,&lt;/P&gt;

&lt;P&gt;The main program looks exactly like what i would like to write, and in practice I wrote a version avoid the select type in the assignment (i already know it). But ultimately It would be nice not to have to right that assignment function.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Patrice I.,&lt;/P&gt;

&lt;P&gt;Out of curiosity, will it be possible to share on this forum how you resolved the code design for yourself that didn't utilize SELECT TYPE construct? &amp;nbsp;And also, how is avoiding the SELECT TYPE important?&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;In addition, why do you think it will be nice not to have to include an assignment in your class design (aka mother type)? &amp;nbsp;Isn't that the basic premise of object-oriented design, to encapsulate actions on the class side so the consuming code achieves greater clarity and simplicity? &amp;nbsp;Having a code section in your main program like the snippet by Steve in Quote #17 seems counter to conventional wisdom on OOP.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2014 13:58:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/select-type-bug/m-p/1023626#M108804</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-10-15T13:58:51Z</dc:date>
    </item>
  </channel>
</rss>

