Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.
27551 Discussions

RANK intrinsic does not accept KIND argument

OP1
New Contributor II
191 Views

I vaguely remember reading not too long ago that there was a plan for all fortran intrinsics to accept a KIND argument - now I can't remember if this was for a future version of the standard or for F2018.

Today (in Intel ifort classic 2021.5.0) the following syntax

 

 

RANK(SOME_ARRAY, KIND = SOME_INTEGER_KIND)

 

 

is not valid. Is this an oversight? Am I simply ahead of the curve? Or (not entirely impossible) am I making all this thing up?

0 Kudos
3 Replies
FortranFan
Honored Contributor II
170 Views

You're way ahead of the curve, Fortran is not scheduled to support a rank for arrays > 15 anytime soon, and the result of RANK intrinsic shall remain that of default integer.  In the meantime, you may even find the following in your own codes!

int( rank(a), kind=.. )

 

Steve_Lionel
Black Belt Retired Employee
158 Views

Just to add to what @FortranFan said, RANK continues to have only one argument in F202X.

OP1
New Contributor II
122 Views

ok, got it. I do like having KIND arguments for intrinsics, but in the meantime @FortranFan 's workaround will do of course. Thanks!

Reply