[Fortran] 纯文本查看 复制代码
program co2h20n2
implicit none
integer,parameter::M=2966297,N=2,L=1227853
real ::cob(3000001,2)
real::co2(L,N)
real::h2o(M,N)
real ::k
integer::i,j,q,p,count
open(10,file='T_1800_P_25.0_CO2Mol_0.1_N2mol_0.9.data')
do i=1,1227852
read(10,*)co2(i,:)
end do
close(10)
open(11,file='T_1800_P_25.0_H2OMol_0.1_N2mol_0.9.data')
do i=1,2966296
read(11,*)h2o(i,:)
end do
close(11)
q=1
count=1
k=1000
do k=0,30000,0.01
do p=count,1227852
if (k-co2(p,1)<0)then
cycle
else if (k-co2(p,1)>0.01)then
else
cob(q,2)=cob(q,2)+co2(p,2)
count=count+1
end if
end do
cob(q,1)=k
q=q+1
end do
q=1
count=1
do k=0,30000,0.01
do p=count,2966296
if (k-co2(p,1)<0)then
cycle
else if (k-co2(p,1)>0.01)then
else
cob(q,2)=cob(q,2)+co2(p,2)
count=count+1
end if
end do
q=q+1
end do
open(12,file='hecheng.txt')
do i=1,3000000
write (12,*)cob(i,:)
end do
close(12)
end
|