program rw implicit none character(128):: h(10),fn1,fn2,c1,c2 real(16), parameter:: pi26=3.1415926535897932384626434_16 real(16), parameter:: e26= 2.7182818284590452353602875_16 integer(8):: N,p,kr real(16):: x1,x2,t1,t2,d1,d2,ref integer:: i,j,k,l,m character(3):: prec(3),sk prec(1)="32_" prec(2)="64_" prec(3)="80_" h(1)="cluster" h(2)="cluster42" ! E-test ref=e26 do j=1,1 !computers do i=1,3 !precision do k=1,8 !no. of sample write(sk,'(i2)') k fn1= "./data/"//prec(i)//trim(h(j))//"_e.o2."//trim(adjustl(sk)) print*, fn1 fn2= prec(i)//trim(h(j))//"_E.o2" open(1,file=fn1,status='old') open(2,file=fn2) ! read and skip first 3 lines do l=1,3 read(1,'(a)') c1 ! write(2,*) c1 end do ! write header write(2,21)'# p','N = 2**p','type','E(seq)','(E-Eref)/Eref','time(seq)','E(par)','(E-Eref)/Eref','time(par)' do !read end of the file read(1,*,end=11) p,N,kr,x1,t1,x2,t2 d1=(x1-ref)/ref d2=(x2-ref)/ref write(2,22) p,N,kr,x1,d1,t1,x2,d2,t2 enddo 11 continue close(1) close(2) enddo !k enddo !i enddo !j 21 format(a3,a15,a6,2(a24,a16,a15)) 22 format(i3,i15,i4,2(f26.21,e16.6,e15.6)) end program