DO seqnum = 1,857,8
WRITE(seqfilein(5:7),'(I3.3)')seqnum
WRITE(*,*)seqfilein
OPEN (UNIT=10,FILE=seqfilein,STATUS='OLD',ACTION='READ',IOSTAT=ierr)
CALL READDATA(vdata,n,seqfilein)
CALL MEAN(nvdata,avg,n,seqfilein)
ENDDO
DO seqnum = 866,942,1
WRITE(seqfilein(5:7),'(I3.3)')seqnum
WRITE(*,*)seqfilein
OPEN (UNIT=10,FILE=seqfilein,STATUS='OLD',ACTION='READ',IOSTAT=ierr)
CALL READDATA(vdata,n,seqfilein)
CALL MEAN(nvdata,avg,n,seqfilein)
ENDDO
The above code works with two different sequences, 1 to 857 and 866 to 942. Is there any efficient way to write the same code?
Many thanks!