Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28442 Discussions

RANK intrinsic does not accept KIND argument

OP1
New Contributor II
410 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
389 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=.. )

 

0 Kudos
Steve_Lionel
Honored Contributor III
377 Views

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

0 Kudos
OP1
New Contributor II
341 Views

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

0 Kudos
Reply