So long as the value of lda is known,
the following are valid:
REAL, DIMENSION(100) :: A REAL, DIMENSION(10,10) :: B REAL, DIMENSION(-10:-1) :: X INTEGER, PARAMETER :: lda = 5 REAL, DIMENSION(0:lda-1) :: Y REAL, DIMENSION(1+lda*lda,10) :: Z
The above example demonstrates:
INTEGER, PARAMETER :: lda = 0
then the array Y would be zero sized.
Zero-sized arrays are useful when programming degenerate cases especially when invoking procedures (in this case we would expect lda to be a dummy argument which determines the size of some local (or automatic) array); no extra code has to be added to test for zero extents in any of the dimensions -- statements including references to zero sized arrays are simply ignored.