[Fortran] 纯文本查看 复制代码 program watersave
implicit none
character*5 filename
integer :: i,k,j,q,flag
integer :: a1, a2, a3 , a5, a6, a7, a8, a9, a10, a11, a12,a13
real*8 :: a4
open(10, file = "D:\a\tem.txt")
do i = 1, 221
read(10, *) filename
flag = 0 !// 每次赋初值
open(11, file = "D:\a\"//filename//".txt")
do k = 1,19358
read(11, *)a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13
do j = 1961, 2013
q = 0
if(a5 == j .and. a8 == 32766) then
q = q+1
if(q>18) then
flag = 1
endif
endif
end do
end do
if(flag == 1) then
close(11, status = "delete")
else
close(11, status = "keep")
endif
end do
end
每一个文件时间序列都是1961到2013年,每一年只要a8列等32766的数大于18就把这个文件删掉,可是运行之后没有删掉,请高手帮忙指点一下哪里写的不对。
|