|
需要将三列数据(ia,ja,acsr)输出至txt文件,单独输出一个变量时没有问题,三列同时输出的时候,ja是接在ia后面输出,acsr的值跟单独输出的时候也不一样。另,三列长度不同,ia为2401行,ja acsr为13320行。求指导如何正确输出文件。[Fortran] 纯文本查看 复制代码 05 | integer , parameter :: m = 2400 , n = 2400 , lda = 2400 , nzmax = 13320 |
06 | integer :: ia ( m +1 ) , ja ( nzmax ) |
07 | real :: adns ( m , n ) , acsr ( nzmax ) |
10 | integer :: job ( 8 ) , i , j , info , ibase 1 , ibase 2 , locat |
21 | open ( 11 , file = "Vollmatrix.txt" ) |
28 | call mkl_sdnscsr ( job , m , n , adns , lda , acsr , ja , ia , info ) |
29 | open ( 12 , file = "csr.txt" ) |
30 | write ( 12 , "(2x,'IA ;',2x,'JA ;',5x,'Value ;')" ) |
31 | write ( 12 , 100 ) ia , ja , acsr |
32 | 100 format ( I 6 , 2 x , I 6 , E 13.5 ) |
35 | end program converters |
|
|