It seems that the rank function has not been implemented. I would like to inquire if there are any plans to implement it in the future.
program test
implicit none
real, dimension(3,3) :: A
print*,rank(A)
end program test
nvfortran 23.11-0 64-bit target on x86-64 Linux -tp haswell
NVIDIA Compilers and Tools
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
NVFORTRAN-S-0038-Symbol, rank, has not been explicitly declared (test.f90: 1)
0 inform, 0 warnings, 1 severes, 0 fatal for test
F2018 features like “rank” are being added to the LLVM community F18 flang project which will eventually replace nvfortran. However I don’t have a time line on when that will occur.
Though I went ahead and added an RFE for it, TPR #34954. If it’s something easy, engineering might be willing to add it to nvfortran as well.
In looking at TPR #34954, it appears engineering did implement this but it seems to have caused some issues so they needed to back it out and it missed inclusion in 24.11. Assuming they can get these issues resolved, there’s a good chance it will be adding in an early 2025 release. Otherwise, we may need to wait for our version for F18 flang, which will be F2018 compliant, for this feature.