Fortran 90 allows arrays to be created on-the-fly; these are known as deferred-shape arrays:
INTEGER, DIMENSION(:), ALLOCATABLE :: ages ! 1D REAL, DIMENSION(:,:), ALLOCATABLE :: speed ! 2D
Note ALLOCATABLE attribute and fixed rank.
READ*, isize ALLOCATE(ages(isize), STAT=ierr) IF (ierr /= 0) PRINT*, "ages : Allocation failed" ALLOCATE(speed(0:isize-1,10),STAT=ierr) IF (ierr /= 0) PRINT*, "speed : Allocation failed"
For more information, click here