PROGRAM t1
IMPLICIT NONE
INTEGER :: number_nodes
REAL, DIMENSION(6) :: info_nodes
INTEGER :: ierror
INTEGER :: i,j
! open the file
OPEN (UNIT=8, FILE = 'nodes1.dat', STATUS='OLD', ACTION = 'READ', IOSTAT=ierror)
! read integers
READ (8,*) number_nodes
! read nodes
DO i = 1,number_nodes
READ(8,*) info_nodes(i)
END DO
WRITE(*,*) 'number of nodes is', number_nodes
DO i = 1,number_nodes
WRITE(*,*) 'node ', i , 'is ', info_nodes(i)
END DO
CLOSE(UNIT=8)
END PROGRAM t1
matliu 发表于 2015-12-30 22:53
比如我读取的是0.2,真实数值也是0.2吧,是显示有问题!可以这样理解吧。
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |