Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26747 Discussions

Internal error in declaring parametric object

Trent_Hawkins
Beginner
89 Views

Parallel Studio XE 2017 update 1

When compiling:

#     ifndef matrix_algebra_F90
#     define matrix_algebra_F90

      module matrix_algebra

            implicit none

            integer,parameter::x_=8
            type::matrix(size)
               integer,len::size
               complex(kind=x_)::component(0:size,0:size)
            contains
               procedure,private::initialize_matrix
        end type  matrix

            interface matrix
               module procedure matrix_source_constructor
        end interface matrix

      contains

            subroutine initialize_matrix(this,source)

                  implicit none

                  class(matrix(*))::this
                  complex(kind=x_),intent(in),optional::source(0:this%size,0:this%size)

                  if(present(source)) then
                     this%component=source
                  else
                     this%component=(0.0_x_,0.0_x_)
              end if!present(source)

        end subroutine initialize_matrix!this,source

            function matrix_source_constructor(source) result(that)

                  implicit none

                  complex(kind=x_),intent(in),optional::source(0:,0:) ! Internal error if deferred size
                  type(matrix(size(source)-1))::that

                  call that%initialize_matrix(source)

        end function matrix_source_constructor!source

  end module matrix_algebra

#     endif

I get:

internal_errors.F90(42): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
                  type(matrix(size(source)-1))::that
^
[ Aborting due to internal error. ]
compilation aborted for internal_errors.F90 (code 1)

The error disappears if I declare the dummy variable source with fixed size instead of deferred like above. 

0 Kudos
1 Reply
Xiaoping_D_Intel
Employee
89 Views

Thanks for reporting the issue. I have reproduced the error and escalated it to developers for fixing. The bug ID is DPD200416910.

 

Thanks,

Xiaoping Duan

Intel Customer Support

Reply