<?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 The above code basically goes in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998801#M103166</link>
    <description>&lt;P&gt;The above code basically goes into an infinite loop in function named lower because of the overloaded intrinsic operation of "&amp;lt;" with a procedure containing two unlimited polymorphic arguments. &amp;nbsp;If one renames the defined operation to, say, .islessthan. and changes lines 102 and 105 to use this name, then the code runs fine. &amp;nbsp;I'm not convinced there is a compiler problem here; one just has to beware when one is dealing with unlimited polymorphism.&lt;/P&gt;

&lt;P&gt;Separately, the abstract derived type "sortable" plays no role in the code as shown. &amp;nbsp;The particular test program of only default integer and real arrays can be made to work with simpler code:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;! quicksort.f90 --
!     Implement a generic QUICKSORT
!
!     default integer and real supported
!
module quicksort_def

   implicit none

   private

   public :: quicksort

contains

   recursive subroutine quicksort( array )
   
      !.. argument list
      class(*), intent(inout) :: array(:)

      !.. local variables
      integer :: i
      integer :: j
      
      i = 1
      j = size(array)

      select type ( array )

         type is ( integer )

            blk_i: block

               integer :: v
               integer :: tmp

               include "i.f90"

            end block blk_i

         type is ( real )

            blk_r: block

               real :: v
               real :: tmp

               include "i.f90"

            end block blk_r

         class default

            !.. appropriate action elided
            !   need concrete design of sortable type to make use of it

      end select

      if ( 1 &amp;lt; j ) then
         call quicksort( array(1:j) )
      end if
      if ( i &amp;lt; size(array) ) then
         call quicksort( array(i:) )
      end if

      return

   end subroutine quicksort

end module quicksort_def
&lt;/PRE&gt;

&lt;P&gt;Include file "i.f90":&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;      v = array((j+i)/2) ! Use the middle element

      do
         do while ( array(i) &amp;lt; v )
            i = i + 1
         end do
         do while ( v &amp;lt; array(j) )
            j = j - 1
         end do

         if ( i &amp;lt;= j ) then
            tmp = array(i)
            array(i) = array(j)
            array(j) = tmp
            i = i + 1
            j = j - 1
         end if

         if ( i &amp;gt; j ) then
            exit
         end if
      end do
&lt;/PRE&gt;

&lt;PRE class="brush:fortran;"&gt;program test_quicksort
! test program

   use quicksort_def

   implicit none

   integer, dimension(10) :: int_array
   real, dimension(10)    :: real_array
   integer                :: i

   do i = 1,size(int_array)
      int_array(i)  = 11 - i
      real_array(i) = 11.0 - i
   enddo

   write(*,*) 'Sorting ...'
   call quicksort( int_array )
   call quicksort( real_array )

   write(*,*) 'Result:'
   write(*,'(i10)')   int_array
   write(*,'(f10.2)') real_array

   stop

end program test_quicksort
&lt;/PRE&gt;

&lt;P&gt;Upon execution using Intel Fortran:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt; Sorting ...
 Result:
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
      1.00
      2.00
      3.00
      4.00
      5.00
      6.00
      7.00
      8.00
      9.00
     10.00
Press any key to continue . . .&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Oct 2015 04:14:48 GMT</pubDate>
    <dc:creator>FortranFan</dc:creator>
    <dc:date>2015-10-02T04:14:48Z</dc:date>
    <item>
      <title>Program crashes using polymorphic variables</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998799#M103164</link>
      <description>&lt;P&gt;The program below crashes in the first iteration of QUICKSORT, using Intel Fortran 2015, whereas it works correctly (or perhaps more accurately: it produces the expected output) using gfortran .4.9.3. Wrt the first iteration: I inserted a write statement to see what part of the array is being handled. Only one line of output resulted - size = 10, then it crashed.&lt;/P&gt;

&lt;P&gt;I wrote it as an answer to a question about generic programming in Fortran. It may be related to the use of polymorphic variables, as I have another version using sortable classes that does do the job fine (and gfortran produces a somewhat strange result). So I may have reached a boundary as far as today's compilers are concerned (well, newer versions do exist, so perhaps, "last night's compilers?)&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;! quicksort.f90 --
!     Implement a generic QUICKSORT
!
!     Numeric basic types and a sortable class supported
!
module quicksort_def
    implicit none

    type, abstract :: sortable
        !integer :: value
    contains
        procedure(assign_object), deferred        :: copy
        procedure(one_lower_than_two), deferred   :: lower
    end type sortable

    abstract interface
        subroutine assign_object( left, right )
            import                         :: sortable
            class(sortable), intent(inout) :: left
            class(sortable), intent(in)    :: right
        end subroutine assign_object
    end interface

    abstract interface
        logical function one_lower_than_two( op1, op2 )
            import                      :: sortable
            class(sortable), intent(in) :: op1, op2
        end function one_lower_than_two
    end interface

    interface operator(&amp;lt;)
        module procedure lower
    end interface

contains
!
! Generic part
!
logical function lower( op1, op2 )
    class(*), intent(in) :: op1, op2

    select type (op1)
        type is (integer)
            select type (op2)
                type is (integer)
                    lower = op1 &amp;lt; op2
            end select

        type is (real)
            select type (op2)
                type is (real)
                    lower = op1 &amp;lt; op2
            end select

        class is (sortable)
            select type (op2)
                class is (sortable)
                    lower = op1%lower(op2)
            end select
    end select
end function lower

subroutine copy( op1, op2 )
    class(*) :: op1, op2

    select type (op1)
        type is (integer)
            select type (op2)
                type is (integer)
                    op1 = op2
            end select

        type is (real)
            select type (op2)
                type is (real)
                    op1 = op2
            end select

        class is (sortable)
            select type (op2)
                class is (sortable)
                    call op1%copy( op2 )
            end select
    end select
end subroutine copy

recursive subroutine quicksort( array )
    class(*), dimension(:) :: array

    class(*), allocatable :: v, tmp
    integer               :: i, j

    i = 1
    j = size(array)

    allocate( v,   source = array(1) )
    allocate( tmp, source = array(1) )

    call copy( v, array((j+i)/2) ) ! Use the middle element

    do
        do while ( array(i) &amp;lt; v )
            i = i + 1
        enddo
        do while ( v &amp;lt; array(j) )
            j = j - 1
        enddo

        if ( i &amp;lt;= j ) then
            call copy( tmp,      array(i) )
            call copy( array(i), array(j) )
            call copy( array(j), tmp      )
            i        = i + 1
            j        = j - 1
        endif

        if ( i &amp;gt; j ) then
            exit
        endif
    enddo

    if ( 1 &amp;lt; j ) then
        call quicksort( array(1:j) )
    endif
    if ( i &amp;lt; size(array) ) then
        call quicksort( array(i:) )
    endif
end subroutine quicksort

end module quicksort_def


! test program
program test_quicksort
    use quicksort_def

    implicit none

    integer, dimension(10) :: int_array
    real, dimension(10)    :: real_array
    integer                :: i

    do i = 1,size(int_array)
        int_array(i)  = 11 - i
        real_array(i) = 11.0 - i
    enddo

    write(*,*) 'Sorting ...'
    call quicksort( int_array )
    call quicksort( real_array )

    write(*,*) 'Result:'
    write(*,'(i10)')   int_array
    write(*,'(f10.2)') real_array

end program test_quicksort
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 06:53:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998799#M103164</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2015-10-01T06:53:52Z</dc:date>
    </item>
    <item>
      <title>Thanks for your report. I</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998800#M103165</link>
      <description>&lt;P&gt;Thanks for your report. I escalated this issue to the development team (DPD200376764).&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 22:45:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998800#M103165</guid>
      <dc:creator>Amanda_S_Intel</dc:creator>
      <dc:date>2015-10-01T22:45:22Z</dc:date>
    </item>
    <item>
      <title>The above code basically goes</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998801#M103166</link>
      <description>&lt;P&gt;The above code basically goes into an infinite loop in function named lower because of the overloaded intrinsic operation of "&amp;lt;" with a procedure containing two unlimited polymorphic arguments. &amp;nbsp;If one renames the defined operation to, say, .islessthan. and changes lines 102 and 105 to use this name, then the code runs fine. &amp;nbsp;I'm not convinced there is a compiler problem here; one just has to beware when one is dealing with unlimited polymorphism.&lt;/P&gt;

&lt;P&gt;Separately, the abstract derived type "sortable" plays no role in the code as shown. &amp;nbsp;The particular test program of only default integer and real arrays can be made to work with simpler code:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;! quicksort.f90 --
!     Implement a generic QUICKSORT
!
!     default integer and real supported
!
module quicksort_def

   implicit none

   private

   public :: quicksort

contains

   recursive subroutine quicksort( array )
   
      !.. argument list
      class(*), intent(inout) :: array(:)

      !.. local variables
      integer :: i
      integer :: j
      
      i = 1
      j = size(array)

      select type ( array )

         type is ( integer )

            blk_i: block

               integer :: v
               integer :: tmp

               include "i.f90"

            end block blk_i

         type is ( real )

            blk_r: block

               real :: v
               real :: tmp

               include "i.f90"

            end block blk_r

         class default

            !.. appropriate action elided
            !   need concrete design of sortable type to make use of it

      end select

      if ( 1 &amp;lt; j ) then
         call quicksort( array(1:j) )
      end if
      if ( i &amp;lt; size(array) ) then
         call quicksort( array(i:) )
      end if

      return

   end subroutine quicksort

end module quicksort_def
&lt;/PRE&gt;

&lt;P&gt;Include file "i.f90":&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;      v = array((j+i)/2) ! Use the middle element

      do
         do while ( array(i) &amp;lt; v )
            i = i + 1
         end do
         do while ( v &amp;lt; array(j) )
            j = j - 1
         end do

         if ( i &amp;lt;= j ) then
            tmp = array(i)
            array(i) = array(j)
            array(j) = tmp
            i = i + 1
            j = j - 1
         end if

         if ( i &amp;gt; j ) then
            exit
         end if
      end do
&lt;/PRE&gt;

&lt;PRE class="brush:fortran;"&gt;program test_quicksort
! test program

   use quicksort_def

   implicit none

   integer, dimension(10) :: int_array
   real, dimension(10)    :: real_array
   integer                :: i

   do i = 1,size(int_array)
      int_array(i)  = 11 - i
      real_array(i) = 11.0 - i
   enddo

   write(*,*) 'Sorting ...'
   call quicksort( int_array )
   call quicksort( real_array )

   write(*,*) 'Result:'
   write(*,'(i10)')   int_array
   write(*,'(f10.2)') real_array

   stop

end program test_quicksort
&lt;/PRE&gt;

&lt;P&gt;Upon execution using Intel Fortran:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt; Sorting ...
 Result:
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
      1.00
      2.00
      3.00
      4.00
      5.00
      6.00
      7.00
      8.00
      9.00
     10.00
Press any key to continue . . .&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 04:14:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998801#M103166</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2015-10-02T04:14:48Z</dc:date>
    </item>
    <item>
      <title>I do not quite agree: I</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998802#M103167</link>
      <description>&lt;P&gt;I do not quite agree: I resolve the unlimited polymorphism using the select type construct. So within these type cases the compiler can and should choose the intrinsic operations, as it knows the actual type of the polymorphic variables.&lt;/P&gt;

&lt;P&gt;I agree that the sortable class plays no role in the program as given - it was to illustrate how you could this for non-intrinsic types.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 06:25:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998802#M103167</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2015-10-02T06:25:44Z</dc:date>
    </item>
    <item>
      <title>Quote:arjenmarkus wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998803#M103168</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;arjenmarkus wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I do not quite agree: I resolve the unlimited polymorphism using the select type construct. So within these type cases the compiler can and should choose the intrinsic operations, as it knows the actual type of the polymorphic variables. ..&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I guess this should come down to the standard - does it say explicitly say as such and if so, where? &amp;nbsp;I don't recall seeing it as such, so it'll be helpful to know it. &amp;nbsp;From what I remember, don't the rules for procedure overloading as described in the &amp;nbsp;standard effectively come down to the defined operation takes precedence over the intrinsic one? &amp;nbsp;Below is a simpler test case using which Intel development team can provide feedback on how the compiler should work in strict accordance with the standard and if there are aspects left up to the processor, how they want to approach it.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;module m

   implicit none

   private

   interface operator(&amp;lt;)
      module procedure lower
   end interface operator(&amp;lt;)
   public :: operator(&amp;lt;)

contains

   function lower( op1, op2 ) result(islessthan)

      !.. argument list
      class(*), intent(in) :: op1, op2
      !.. function result
      logical :: islessthan

      !.. local variables
      integer :: in1
      integer :: in2

      print *, " enter lower: "
      islessthan = .false.

      select type (op1)

         type is (integer)

            in1 = op1
            print *, " op 1 = ", in1

            select type (op2)

               type is (integer)

                  in2 = op2
                  print *, " op 2 = ", in2

                  islessthan = op1 &amp;lt; op2

            end select

         type is (real)

            select type (op2)

               type is (real)

                  islessthan = op1 &amp;lt; op2

            end select

         class default

            !.. appropriate action elided

      end select

   end function lower

end module m
&lt;/PRE&gt;

&lt;PRE class="brush:fortran;"&gt;program p

   use m, only : operator(&amp;lt;)

   implicit none

   logical :: islessthan

   islessthan = ( 0 &amp;lt; 42 )
   print *, " is 0 &amp;lt; 42? ", islessthan

   stop

end program p
&lt;/PRE&gt;

&lt;P&gt;Upon execution,&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;  op 1 =  0
  op 2 =  42
  enter lower:
  op 1 =  0
  op 2 =  42
  enter lower:
  op 1 =  0
  op 2 =  42
  enter lower:
  op 1 =  0
  op 2 =  42
  enter lower:
  op 1 =  0
  op 2 =  42
  enter lower:
  op 1 =  0
  op 2 =  42
  enter lower:
  op 1 =  0
  op 2 =  42
  enter lower:
  op 1 =  0
  op 2 =  42
  enter lower:
...
&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="loop_0.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8080i8B59A3FD0A811DBE/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="loop_0.png" alt="loop_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 12:25:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998803#M103168</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2015-10-02T12:25:00Z</dc:date>
    </item>
    <item>
      <title>Hm, my understanding is that</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998804#M103169</link>
      <description>&lt;P&gt;Hm, my understanding is that defined operations cannot override operations defined for intrinsic types.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 12:44:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998804#M103169</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2015-10-02T12:44:42Z</dc:date>
    </item>
    <item>
      <title>Here's some tidbit that may</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998805#M103170</link>
      <description>&lt;P&gt;Here's some tidbit that may help Intel development team during their review. &amp;nbsp;Fortran 2008 standard (J3/10-007r1 WD 1539-1 2010-11-24)&amp;nbsp;documentation says in section 12.4 Restrictions on generic declarations:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;11 12.4.3.4.5 Restrictions on generic declarations 
.. 
38 not all functions or not all subroutines. If a generic invocation applies to both a speci&amp;#12;fic procedure from an 
39 interface and an accessible intrinsic procedure, it is the speci&amp;#12;fic procedure from the interface that is referenced. &lt;/PRE&gt;

&lt;P&gt;Metcalf et al. in "Modern Fortran Explained" say in section 5.18:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;"If a generic invocation is ambiguous between a non-intrinsic and an intrinsic procedure, the non-intrinsic procedure is invoked."&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 14:43:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998805#M103170</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2015-10-02T14:43:00Z</dc:date>
    </item>
    <item>
      <title>In a new thread on comp.lang</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998806#M103171</link>
      <description>&lt;P&gt;In a new thread on comp.lang.fortran related to the code in Message #5, IanH commented:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;IanH wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;Note that paragraph starts "Within the scope of a generic name...". &amp;nbsp;An&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;operator is not a name. &amp;nbsp;The context for the text from Modern Fortran&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;Explained that you quoted is similar.&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;I think the standard should specify that you cannot override intrinsic&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;operations. &amp;nbsp;I see no benefit in permitting such operations to be&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;overridden by CLASS(*) dummy argument functions, but I see the&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;considerable possibility for lots of cost in terms of implementation and&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;language specification complexity. &amp;nbsp;I think the apparently ability to do&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;such an override is an oversight in the wording of the standard that has&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;arisen with the introduction of CLASS(*).&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;12.4.3.4.2 says in regards to defined operations that "...the types,&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;kind type parameters, or ranks of the dummy arguments shall differ from&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;those required for the intrinsic operation". &amp;nbsp;For the aspect of type,&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;instead of "differ" it should say something like "type shall not be&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;compatible".&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;I note that interp F08/0087 explicitly broke Fortran 95 compatibility in&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;order to squish the related possibility of overriding assignment of&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;intrinsic types.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Perhaps someone from the Intel team who interface with the standards committee can seek an interpretation and clarification on the current standard that may lead to a change in wording of the standard, assuming the standard did mean one "&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;cannot override intrinsic&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;operations ..&amp;nbsp;an oversight .. that has&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal;"&gt;arisen with the introduction of CLASS(*)&lt;/SPAN&gt;"?&lt;/P&gt;

&lt;P&gt;But for Intel compiler, it would mean more than a change in wording but a fix to prevent such overrides.&lt;/P&gt;

&lt;P&gt;But I'm not convinced this is just an oversight in the wording of the standard. &amp;nbsp;My hunch is the standard did mean to allow this, but the oversight is in not extending the INTRINSIC statement to include operators. &amp;nbsp;If one could do as shown in line 21 below, it will be a cleaner way to deal with such situations in my simple-minded thinking.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;module m

   implicit none

   private

   interface operator(&amp;lt;)
      module procedure lower
   end interface operator(&amp;lt;)
   public :: operator(&amp;lt;)

contains

   function lower( op1, op2 ) result(islessthan)

      !.. argument list
      class(*), intent(in) :: op1, op2
      !.. function result
      logical :: islessthan

      intrinsic :: operator(&amp;lt;) !.. NOT SUPPORTED AT PRESENT, but it should be

      !.. local variables
      integer :: in1
      integer :: in2

      print *, " enter lower: "
      islessthan = .false.

      select type (op1)

         type is (integer)

            in1 = op1
            print *, " op 1 = ", in1

            select type (op2)

               type is (integer)

                  in2 = op2
                  print *, " op 2 = ", in2

                  islessthan = op1 &amp;lt; op2

            end select

         type is (real)

            select type (op2)

               type is (real)

                  islessthan = op1 &amp;lt; op2

            end select

         class default

            !.. appropriate action elided

      end select

   end function lower

end module m
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 14:39:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998806#M103171</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2015-10-06T14:39:43Z</dc:date>
    </item>
    <item>
      <title>Yes this does currently</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998807#M103172</link>
      <description>&lt;P&gt;Yes this does currently result in infinite recursion. The development team has decided that the compiler should instead be doing intrinsic less-than.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 21:54:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998807#M103172</guid>
      <dc:creator>Amanda_S_Intel</dc:creator>
      <dc:date>2015-10-15T21:54:19Z</dc:date>
    </item>
    <item>
      <title>Quote:AmandaS (Intel) wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998808#M103173</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;AmandaS (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Yes this does currently result in infinite recursion. The development team has decided that the compiler should instead be doing intrinsic less-than.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Amanda,&lt;/P&gt;

&lt;P&gt;Thanks for the feedback. &amp;nbsp;Is it possible for the development team to provide some additional background on the rationale used for their decision? &amp;nbsp;Can they provide reference information in the Fortran standard that guided them toward the decision, or if this is a case where the standard pretty much leaves it up to the "processor", then where does it indicate so? &amp;nbsp;I ask because my own read of the standard suggests there is a gap when it comes to user overloads of intrinsic operations with unlimited polymorphic dummy arguments and what would be the consequent order of operations. &amp;nbsp;But I could be wrong; I don't have the patience and experience to interpret "standard speak".&lt;/P&gt;

&lt;P&gt;At present, my sense is it will be very useful if the Intel reps on the Fortran standards committee can work with the committee to get clarification on this. &amp;nbsp;And if applicable, the committee can perhaps ponder over the value of extending the "INTRINSIC" statement to cover operators too, like I show in Message #8. &amp;nbsp;But if the development team does not think all this is necessary, then it will be good to understand why they think so i.e., which sections in the standard inform them on how this should be handled.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 14:36:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-crashes-using-polymorphic-variables/m-p/998808#M103173</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2015-10-16T14:36:00Z</dc:date>
    </item>
  </channel>
</rss>

