Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
27228 Discussions

Assumed Rank Character Variable Fails in Select Rank Statement

CarlB
Beginner
302 Views

 

Hello everyone,

 

This function compiles with all data types using gfortran. ifort, however, fails if I try to define a behaviour for rank(0). Higher ranks do work, including rank default.

Minimal example:

subroutine sub(c)
character(*), intent(in) :: c(..)

select rank(c)
rank(0)
   print*, 0
end select
end subroutine sub

 Result:

$ ifort -c ./src/lib.f90 -warn all -check all -error-limit 1 -O0 -g -assume byterecl -traceback -module build/ifort_5C58216731706F11/testingrange -Ibuild/ifort_5C58216731706F11/testingrange  -o build/ifort_5C58216731706F11/testingrange/src_lib.f90.o
./src/lib.f90(10): error #5529: CHARACTER variable 'C' has no length argument in routines with C or STDCALL attribute
select rank(c)
------------^

 Compiler provided by my company:

ifort (IFORT) 19.1.2.254 20200623

 

Is this a bug or a feature? At least the error message isn't that clear.

I assume it has something to do with the additional len parameter of the character type. But I'm curious because it does compile and work with gfortran.

 

Best,
Carl

0 Kudos
1 Solution
Barbara_P_Intel
Moderator
244 Views

I got the same wrong error message with the current compiler release, 2021.3.0. I filed a bug report, CMPLRIL0-34096, on your behalf. I'll keep you posted on its progress to a fix.



View solution in original post

3 Replies
Steve_Lionel
Black Belt Retired Employee
279 Views

Bug.

Barbara_P_Intel
Moderator
245 Views

I got the same wrong error message with the current compiler release, 2021.3.0. I filed a bug report, CMPLRIL0-34096, on your behalf. I'll keep you posted on its progress to a fix.



CarlB
Beginner
196 Views

Thank you for clarifying and for the bug report!

Reply