# Is there an intrinsic way to transpose N-dim arrays?

**URL:** <https://fortran-lang.discourse.group/t/is-there-an-intrinsic-way-to-transpose-n-dim-arrays/3771>\
**Category:** Help\
**Created:** [June 16, 2022, 7:12pm UTC](https://fortran-lang.discourse.group/t/is-there-an-intrinsic-way-to-transpose-n-dim-arrays/3771 "2022-06-16T19:12:20Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![FortranFan](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@FortranFan](https://fortran-lang.discourse.group/u/FortranFan)\
**Post date:** [June 27, 2022, 6:17pm UTC](https://fortran-lang.discourse.group/t/is-there-an-intrinsic-way-to-transpose-n-dim-arrays/3771/21 "2022-06-27T18:17:54Z")

</div>

> [@FortranFan](#):
>
> > [@milancurcic](#):
> >
> > 10.1.12 in [18-007r1](https://j3-fortran.org/doc/year/18/18-007r1.pdf), `array` in this case is not a constant expression, so neither is `rank(array)`
> 
> For whatever it’s worth, I think the code conforms and `IFORT` has a bug here.
> 
> The expression that has `IFORT` stumble is a specification inquiry using a standard intrinsic **inquiry** function where the argument is a variable whose properties are not assumed, deferred, or defined by an expression that is not a constant expression. The standard permits this in a constant expression.
> 
> Fyi I’ve turned in a support request with Intel OSC on this.

Intel Fortran team has confirmed among themselves and also with some on the standard committee (from what I can surmise) that this is a conformant use of the `RANK` intrinsic that was introduced starting Fortran 2018.

They have escalated this issue to their compiler engineering team for a fix in a future release.

---

<div class="post-metadata">

**Author:** ![milancurcic](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/milancurcic/32/2_2.png) [@milancurcic](https://fortran-lang.discourse.group/u/milancurcic)\
**Post date:** [June 28, 2022, 12:08am UTC](https://fortran-lang.discourse.group/t/is-there-an-intrinsic-way-to-transpose-n-dim-arrays/3771/22 "2022-06-28T00:08:20Z")

</div>

Thanks, @FortranFan, and everybody for your ideas!

[Previous page](https://fortran-lang.discourse.group/t/is-there-an-intrinsic-way-to-transpose-n-dim-arrays/3771.md?page=1)
