[Fortran] 纯文本查看 复制代码
program main
implicit real*8(a-z)
integer::N,i
real*8::x1(10000),px1(10000),z1(10000),pz1(10000)
real*8::x(10000),px(10000),z(10000),pz(10000)
open(unit=11,file='x.txt')
open(unit=12,file='px.txt')
open(unit=13,file='z.txt')
open(unit=14,file='pz.txt')
open(unit=15,file='cyyb.txt')
N=10000
DO i=1,N
read(11,25)x(i)
x1(i)=x(i)
read(12,25)px(i)
px1(i)=px(i)
read(13,25)z(i)
z1(i)=z(i)
read(11,25)pz(i)
pz1(i)=z(i)
write(15,26)x1(i),px1(i),z1(i),pz1(i)
25 format(1X,F20.11)
26 format(1X,F15.6,6F15.5)
end do
end program