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.
29280 Discussions

RANK intrinsic does not accept KIND argument

OP1
New Contributor III
1,000 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 III
979 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
967 Views

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

0 Kudos
OP1
New Contributor III
931 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