Suppose during the execution of a program you get the following output file:
1 2
2 2
3 1
.
.
.
n 5
and the first line tells you that you need a matrix say A(2,k), the second line a matrix B(2,k), the third line a matrix C(1,k),..., and the last line a matrix S(5,k), where n and k are already known.
How do you allocate the matrices A,B,C,...,S? If the entries of second column of the file where the same e.g 5, I could allocate one matrix, i.e:
real, allocatable :: mymat(:,:,:)
and after reading the output file I would allocate:
allocate(mymat(n,5,k))
and that would be the end of the story. In this case, I can't do that, since the second dimension varies, so I need n different matrices. Any ideas?