program test
implicit none
integer:: error,count=0
character(len=512) str
open(12,file="NLIST.txt")
do
read(12,'(a512)',iostat=error)str
if(error/=0)exit
if(index(str,"NODE")>0)then
read(12,'(a512)',iostat=error)str
if(error/=0)exit
COUNT=COUNT+1
end if
end do
close(12)
write(*,*)count end program
QQ截图20200321113341.png (51.46 KB, 下载次数: 245)
program test
implicit none
integer:: error,count=0
character,parameter::nodes="NODE"
character(len=512) str
open(12,file="NLIST.txt")
do
read(12,'(a512)',iostat=error)str
if(error/=0)exit
str=adjustl(str)
if(str(:len(nodes))==nodes)then
read(12,'(a512)',iostat=error)str
if(error/=0)exit
COUNT=COUNT+1
end if
end do
close(12)
write(*,*)count
end program
466 Bytes, 下载次数: 3
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |