program main implicit none integer, allocatable :: x(:), A(:,:) real, allocatable :: y(:), B(:,:) integer :: i, j allocate(x(5),y(5),A(5,5),B(5,5)) x = (/1,2,3,4,5/) y = (/(real(i), i=1,5)/) !x = [1,2,3,4,5] ! F03 also supports square brackets !y = [(real(i), i=1,5)] A = reshape( (/(i, i=1,25)/), shape=(/5,5/) ) B = reshape( (/((real(i*j), i=1,5), j=1,5)/), shape=(/5,5/)) print*, "x =",x ; print*, "y =",y print*, "A =",A ; print*, "B =",B end program main