(j3.2006) (SC22WG5.4337) Has something dropped out of Fortran 2008?

N.M. Maclaren nmm1
Sun Sep 26 13:54:34 EDT 2010


This arose out of the Interoperability and MPI area. None of NAG, gfortran 
or Intel allow me to use an element of an assumed-shape array as an actual 
argument where the dummy is assumed-size. No problem - except that I can't 
find any such restriction in Fortran 2008. In the absence of that, 
12.5.2.11 paragraph 1 is a little ambiguous.

Is there there and I failed to find it, is it a change, or has it dropped
out by accident?

A program that shows the error is:

PROGRAM Main
    INTEGER :: i, j
    INTEGER :: a(9,9)
    DO j = 1,9
        DO i = 1,9
            a(i,j) = 10*j+i
        END DO
    END DO
    CALL Fred(a(5,:))
CONTAINS
    SUBROUTINE Fred (b)
        INTEGER :: b(:)
        PRINT *, b
        CALL Joe(b(1))    ! This is erroneous
    END SUBROUTINE Fred
    SUBROUTINE Joe(c)
        INTEGER :: i
        INTEGER :: c(*)
        DO i = 1,9
            PRINT *, c(i)
        END DO
    END SUBROUTINE Joe
END PROGRAM Main

Regards,
Nick.




More information about the J3 mailing list