program converters
implicit none
! Definition arrays for sparse matrix formats
integer,parameter :: m=2400, n=2400, lda=2400, nzmax=13320
integer :: ia(m+1), ja(nzmax)
real :: adns(m,n) , acsr(nzmax)
! Declairation of local variables:
integer :: job(8), i, j, info, ibase1, ibase2, locat
info = 0
locat = 2
ibase1 = 1
ibase2 = 1
job(2) = ibase1
job(3) = ibase2
job(4) = locat
job(5) = nzmax
! Task1: densly matrix to csr
open(11,file="Vollmatrix.txt")
do i=1,m
read(11,*) adns(i,:)
end do
close(11)
job(1) = 0
job(6) = 1
call mkl_sdnscsr(job, m, n, adns, lda, acsr, ja, ia ,info)
open(12,file="csr.txt")
write(12,"(2x,'IA ;',2x,'JA ;',5x,'Value ;')")
write(12,100) ia,ja,acsr
100 format(I6,2x,I6,E13.5)
close(12)
end program converters
179.94 KB, 下载次数: 4
file11
open(12,file="csr.txt")
write(12,"(2x,'IA ;',2x,'JA ;',5x,'Value ;')")
do i = 1 , nzmax
write(12,100) ia(i),ja(i),acsr(i)
end do
100 format(I6,2x,I6,E13.5)
close(12)
vvt 发表于 2019-10-30 13:55
这是逻辑问题。三列长度不一样,不应该放在一起。否则后面你无法区分剩下2个数据是在哪一列?
长度一样的 ...
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |