|
想TXT读40位的整数,读不出来。试了很多遍,发现代码30行取I15时能读出来,读15位后就报错了,怎么解决?[Fortran] 纯文本查看 复制代码 05 | INTEGER ( KIND = 2 ) :: Run_time |
06 | integer ( kind = 8 ) :: Gene |
09 | CALL Get_Best ( 8 , 10 , 1 , Gene ) |
10 | write ( * , * ) 'Gene:' , Gene |
15 | subroutine Get_Best ( tmin , Npop , Run_time , Gene ) |
17 | integer , intent ( in ) :: tmin , Npop |
19 | integer ( KIND = 8 ) :: Gene |
20 | integer ( KIND = 8 ) , dimension ( Npop ) :: GeneZ |
22 | CHARACTER ( LEN = 2 ) :: cRun_time |
23 | character ( LEN = 100 ) :: Nome , annotation |
24 | CHARACTER ( * ) , PARAMETER :: fileplace = "D:/simulation/" |
26 | write ( cRun_time , '(I2)' ) Run_time |
27 | Nome = TRIM ( ADJUSTL ( cRun_time ) ) / / 'namlist_in.txt' |
28 | OPEN ( 1 , file = fileplace / / Nome , status = 'old' , FORM = 'FORMATTED' ) |
29 | read ( 1 , '(A)' ) annotation |
30 | read ( 1 , '(6X,I40)' ) ( GeneZ ( i ) , i = 1 , Npop ) |
32 | write ( * , * ) 'GeneZ:' , GeneZ |
34 | end subroutine Get_Best |
|
|