You write The ascii file is a 11 rows and N columns and then allocate an array like this:
allocate(data(n,11))
This makes data
an n
-row, 11
-column array, which seems to transpose the dimensions from your file. If you were reading the input file element-by-element that probably wouldn't cause the run-time system to raise an error though it might leave you with the transpose of the array you want.
However, you read the input file row-by-row. As you have explained matters that file should have 11 rows of data but your program tries to read (and write) n
rows. Again, there's nothing actually wrong with your program to this point, though it perhaps doesn't do what you expect it to.
But your program expects each row in the input file to provide 11 values and I guess that it doesn't, leading to the error you report.