The following code compiles fine in ftn95 (32bit) which it shouldn't. shape(a) returns an integer array, but the upper limit of a DO loop must be scalar.
subroutine foo(a)
implicit none
integer, intent(in) :: a(:,:)
integer :: i
print *, 'Shape of a:', shape(a)
do i = 1, shape(a) ! <-- This should be size(shape(a))
print *, 'Dimension', i, 'of a has', size(a, i), 'elements'
enddo
end subroutine
Interestingly, adding /iso yields the same result but if used with /64 /iso, the compiler fails with
...
0009) do i = 1, shape(a)
*** DO upper limit must be scalar valued
...
which is the correct behaviour. Summarized: ftn95 foo.f95 → Compiles ftn95 /iso foo.f95 → Compiles ftn95 /64 foo.f95 → Compiles ftn95 /64 /iso foo.f95 → Fails (correct behavior).
Best, André