做数值计算,最后输出数据,代码是这样的
open(fid,file=trim(fpath)//'/p1.dat')
write(fid,120) (x(i),i=1,n)
write(fid,120) h0
do i = 1,n
write(fid,120) (p(i,j),j=1,n)
end do
do i = 1,n
write(fid,120) (h(i,j),j=1,n)
end do
close(fid)
open(fid,file=trim(fpath)//'/p1.dat')
write(fid,120) x(1:n)
write(fid,120) h0
do i = 1,n
write(fid,120) p(i,1:n)
end do
do i = 1,n
write(fid,120) h(i,1:n)
end do
close(fid)
120 format(512(es16.8e3,1x))