大家好,
我想请教大家一个问题。我在读取一个文件(INPUT.dat)的数据,其中文件的内容如下。
Hamiltonian file with magnetization along z axis
ac_111_0_90_wannier90_hr.dat
Output file with magnetization along z axis
ac_111_0_90_wannier90.wout
Hamiltonian file with magnetization along different direction
ac_111_0_85_wannier90_hr.dat
ac_111_0_95_wannier90_hr.dat
ac_111_90_85_wannier90_hr.dat
ac_111_90_95_wannier90_hr.dat
Angle difference in unit of degree
5.0
k point mesh
50 50
Velocity direction of Hamitlonian (0 - along x directin; 1 - along y direction)
0
Femi energy value in unit of eV
-0.5415
Energy window for Fermi surface in unit of eV
0.01
Broadening value in unit of eV
0.05
这个文件中的第11行是一个浮点数5.0。我读取该文件的部分程序如下。
[Fortran] 纯文本查看 复制代码 CHARACTER (LEN=50) :: na(6)
DOUBLE PRECISION :: an
INTEGER :: km(2)
INTEGER :: vd
DOUBLE PRECISION :: fermi
DOUBLE PRECISION :: wf
DOUBLE PRECISION :: bv
OPEN (UNIT=3, FILE='INPUT.dat', STATUS='OLD')
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT='(a)') na(1)
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT='(a)') na(2)
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT='(a)') na(3)
READ (UNIT=3, FMT='(a)') na(4)
READ (UNIT=3, FMT='(a)') na(5)
READ (UNIT=3, FMT='(a)') na(6)
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT='(a)') an
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT=*) km
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT=*) vd
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT=*) fermi
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT='(a)') wf
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT=*) bv
write (unit=*,fmt=*) na(6), an
但是,当我查看屏幕上输出的变量时,看到的却是
ac_111_90_95_wannier90_hr.dat 6.013568264329796E-154
也就是说变量an的值是6.013568264329796E-154,可是我的文件里对应于an变量的数据是5.0。
请问为什么会是这样呢?能麻烦大家给些建议,怎么解决这个问题吗?谢谢啦。
|