矩阵运算编译问题求助
尊敬的FORTRAN老师,您好!有编译运行较大型矩阵操作合集程序一则, 过程中有疑问,无法进行下去,求助解决,盼复!谢谢! :-handshake
9970 | lambda(i) = 2.0D+00* * ( i - 1 )
| 1
Error: Invalid character in name at (1)
上述的错误在哪里? 如何更正?
main.f90:14167:40:
14236 | a(i,j) = - dot
| 1
Error: The function result on the lhs of the assignment at (1) must have the pointer attribute.
main.f90:4680:36:
上述是哪里出错?!什么意思?如何更正?
33901 | data a_save /0.002025462963002D+06, &
| 1
Error: DATA statement at (1) has more values than variables
main.f90:33927:41:
34014 | data a_save /0.075953934362606D+00,0.139678536121698D+00, &
| 1
Error: DATA statement at (1) has more values than variables
main.f90:34087:43:
上述两句(独立)的意思是不是给出的数据值太多,个数大于多于定义指定的·个数?!
矩阵操作运算较大型合集编译问题继续一
FORTRAN老师您好,另有疑问求助,以便编译继续进行下去:
main.f90:14225:12:14225 | a(i,j) = 0.0D+00 | 1Error: Unclassifiable statement at (1)
什么意思?! 如何纠正?! 盼复! 谢谢!:-sleepy:
编译错误先看第一个,后面的无视。
错误提示有时候需要结合上下文才能判断。建议给出第一个错误所在行的附近20行代码。 lambda(i) = 2.0D+00* * ( i - 1 )
两个乘号表示乘方时,不可分开,中间不可有空格。
data a_save /0.075953934362606D+00,0.139678536121698D+00, &
建议放弃 data 语句。具体还要看 a_save 的定义,以及续行后的代码内容。
收到! 谢谢!
矩阵操作运算合集编译问题续二
按老师提示, 请教如下: 盼复,谢谢! :-sleepy:问题1: 附近程序行I
********************************************
main.f90:14225:12:
14225 | a(i,j) = 0.0D+00
| 1
Error: Unclassifiable statement at (1)
main.f90:17595:35:
subroutine eulerian_inverse ( n, a )
do j = 1, n
do i = 1, n
if ( i .lt. j ) then
14225 a(i,j) = 0.0D+00
else if ( i .eq. j ) then
a(i,j) = 1.0D+00
else if ( j .lt. i ) then
dot = 0.0D+00
do k = j, i - 1
dot = dot + b(i,k) * a(k,j)
end do
a(i,j) = - dot
end if
end do
end do
return
end
***********************************************
问题2: 附件程序行II
***********************************************
main.f90:14237:12:
14237 | a(i,j) = - dot
| 1
Error: The function result on the lhs of the assignment at (1) must have the pointer attribute.
subroutine eulerian_determinant ( n, determ )
implicit none
double precision determ
integer n
determ = 1.0D+00
return
end
subroutine eulerian_inverse ( n, a )
do j = 1, n
do i = 1, n
if ( i .lt. j ) then
a(i,j) = 0.0D+00
else if ( i .eq. j ) then
a(i,j) = 1.0D+00
else if ( j .lt. i ) then
dot = 0.0D+00
do k = j, i - 1
dot = dot + b(i,k) * a(k,j)
end do
14237 a(i,j) = - dot
end if
end do
end do
return
end
subroutine exchange ( m, n, a )
implicit none
integer m
integer n
double precision a(m,n)
integer i
integer j
do j = 1, n
do i = 1, m
if ( i + j .eq. n + 1 ) then
a(i,j) = 1.0D+00
else
a(i,j) = 0.0D+00
end if
end do
end do
return
end
要是不能给完整的代码,可以自己把没问题的部分删除,再编译看看错误出在哪
a(i,j)没声明直接当数组用肯定不行 收到,谢谢
页:
[1]