Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29282 Discussions

Selector in RANK (0) case block is not considered a scalar

NCarlson
New Contributor I
837 Views

ifx 2024.0 rejects the following valid code when it fails to recognize that the selector in the RANK (0) case block should be regarded as a scalar.

 

call foo(.true.)
contains
  subroutine foo(x)
    class(*), intent(in) :: x(..)
    select rank (x)
    rank (0)
      select type (x)
      type is (logical)
        if (x) print *, 'pass'  ! X IS A SCALAR IN THIS RANK-CASE BLOCK
      end select
    end select
  end subroutine
end
$ ifx intel-20231210.f90 
intel-20231210.f90(20): error #6512: A scalar-valued expression is required in this context.   [X]
        if (x) print *, 'pass'  ! X IS A SCALAR IN THIS RANK-CASE BLOCK
------------^
compilation aborted for intel-20231210.f90 (code 1)

 

 

1 Solution
Barbara_P_Intel
Employee
795 Views

Thanks for reporting this.

GOOD NEWS! It's fixed in ifx 2024.1.0 that is planned for April or so in 2024.

 

View solution in original post

1 Reply
Barbara_P_Intel
Employee
796 Views

Thanks for reporting this.

GOOD NEWS! It's fixed in ifx 2024.1.0 that is planned for April or so in 2024.

 

Reply