各位大神,我这个程序能够编译成功。但是,一运行程序就出现这个情况:
[Fortran] 纯文本查看 复制代码 Program main
Include 'link_fnl_shared.h' !//必须要写
use lin_sol_gen_int
use rand_gen_int
use error_option_packet
Implicit None
!// This is Example 1 for Lin_sol_gen
Integer,Parameter :: n = 32
Real( kind(1e0) ),Parameter :: one = 1e0
Real( kind(1e0) ) :: err
Real( kind(1e0) ) :: A(n,n), b(n,n), x(n,n), res(n,n), y(n*n)
!// Generate a random matrix
Call rand_gen(y)
A=reshape( y,[n,n] )
!// Genarate random right-hand sides
Call rand_gen(y)
b=reshape( y,[n,n] )
!// Compute the solution matrix of Ax = b
Call lin_sol_gen( A,b,x )
!// Check the result for small residuals
res=b - matmul( A,x )
err=maxval( abs(res) )/sum( abs(A)+abs(b) )
If (err<=sqrt( epsilon(one)) ) then
Print*, 'Example 1 for Lin_sol_gen is correct.'
End If
End Program |