這應該是一個容易..我不明白爲什麼我的讀語句有語法錯誤。我有一個文件7477行長,我希望每個這些變量對應每行像我的格式指定。這裏的任何幫助都會很棒。謝謝!FORTRAN 90 - 輸入語法錯誤
implicit none
integer :: spe, flen = 7477, i
real, dimension (7477):: wnum,s,A,abh
character :: other
integer :: lun = 11
write(*,*) 'Opening File!'
open(lun,file ='h2o_allbands',status = 'old',action ='read')
write(*,*) 'Success!'
17 format (1x,i2,3x,F9.6,1x,E9.3,1x,E9.3,F5.5,A120)
do i = 1, 7477
read(lun,17) spe(i),wnum(i),s(i),A(i),abh(i),other
write(*,*) wnum(i)
end do
你有意將'other'設爲單個字符,還是'character *(LEN = 120)'。 – ja72 2013-02-17 07:46:00