我想这是我错过的一些愚蠢的东西,但我已经问过我的整个班级,没有人能够解决这个问题。在一个子程序中调用一个简单的程序,并且在矩阵的条目中执行循环读操作时遇到问题。简单阅读功能错误
program Householder_Program
use QR_Factorisation
use numeric_kinds
complex(dp), dimension(:,:), allocatable :: A, Q, R, V
integer :: i, j, n, m
print *, 'Enter how many rows in the matrix A'
read *, m
print *, 'Enter how many columns in the matrix A'
read *, n
allocate(A(m,n), Q(m,n), R(n,n), V(n,n))
do i = 1,m
do j = 1,n
Print *, 'Enter row', i, 'and column', j, 'of matrix A'
read *, A(i,j)
end do
end do
call Householder_Triangularization(A,V,R,n,m)
print *, R
end program
它会问我要A(1,1),但是当我在一个号码类型也不会问我要A(1,2),就会留下一个空行。当我试图把在第2个数字,就会报错,说:
Enter row 1 and column 1 of matrix A
1
2
At line 22 of file HouseholderProgram.f90 (unit = 5, file = 'stdin')
Fortran runtime error: Bad repeat count in item 1 of list input
非常感谢 – malonej