fcode 发表于 2018-6-26 08:28 非常感谢 |
|
lz用ivf的话,直接查阅MKL帮助文档吧 譬如 https://software.intel.com/en-us ... -fortran-mkl-csrcoo |
|
[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode program fcode_cn
Implicit None
Real , allocatable :: rMatrix(:,:) , value(:)
Integer , allocatable :: ipodia(:) , indexJ(:)
Integer :: N , M , i , j
Open( 12 , File = "Ipodia.txt")
Open( 13 , File = "Index J.txt")
Open( 14 , File = "Value.txt")
N = GetFileN( 12 )
M = GetFileN( 13 )
Allocate( rMatrix(N,N) , ipodia(0:N) , indexJ(M) , value(M) )
rMatrix = 0
ipodia(0) = 0
Read(12,*) ipodia(1:)
Read(13,*) indexJ
Read(14,*) value
Do i = 1 , N
rMatrix( indexJ( ipodia(i-1)+1 : ipodia(i) ) , i ) = value( ipodia(i-1)+1 : ipodia(i) )
rMatrix( i , :i-1 ) = rMatrix( :i-1 , i )
End Do
Close(12)
Close(13)
Close(14)
contains
Integer Function GetFileN( iFileUnit )
Integer , Intent( IN ) :: iFileUnit
character( Len = 1 ) :: cDummy
integer :: ierr
GetFileN = 0
Rewind( iFileUnit )
Do
Read( iFileUnit , * , ioStat = ierr ) cDummy
If( ierr /= 0 ) Exit
GetFileN = GetFileN + 1
End Do
Rewind( iFileUnit )
End Function GetFileN
end program fcode_cn |
捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )
GMT+8, 2025-10-30 23:51