[Fortran] 纯文本查看 复制代码
program Console1
USE iso_Fortran_env, ONLY: wp => real64
implicit none
external dgesv, dgetrf
integer, parameter :: nn=2, lda=2, nrhs=1, ldb=2
REAL(wp), dimension(lda,nn) :: A
REAL(wp), dimension(ldb,nrhs) :: B
integer :: info, i, j
integer, dimension(nn) :: ipiv
A(1,1)=1
A(1,2)=2
A(2,1)=3
A(2,2)=4
B(1,1)=5
B(2,1)=6
ipiv = 0
info = 0
write(*,*), 'Hello World'
print *, 'ipiv =', ipiv
print *, 'INFO =', info
print *, ((A(i,j),i=1,lda),j=1,nn)
print *, ((B(i,j),i=1,ldb),j=1,nrhs)
call dgesv(nn,nrhs,A,lda,ipiv,B,ldb,info)
print *, "END OF PROGRAM..."
end program Console1