Hi I'm completely new in fortran programming and I just ran this code(adsbygoogle = window.adsbygoogle || []).push({});

program array_test

implicit none

integer, parameter :: row = 3, column = 4

integer :: i, j

integer, dimension(row: column) :: array2

open(1, file = "matrix.txt")

array2 = reshape((/1,2,3,4,5,6,7,8,9,10,11,12/),(/row,column/))

do i = 1, row

write(1, "(12i5)") (array2(i, j), j = 1, column)

enddo

end program

and I get these errors :

7 Incompatible ranks in 1 and 2 in assignment

9 ranks mismatch in array reference (2/1)

can u help me out?!

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Fortran Rank mismatch and incompatible ranks 1 and 2

Tags:

**Physics Forums | Science Articles, Homework Help, Discussion**