本帖最后由 xiao. 于 2021-1-7 11:24 编辑
[Fortran] 纯文本查看 复制代码
program co2h20n2
implicit none
integer,parameter::M=2966296,N=2,L=1227852
integer::cob(60000000,2)
real::co2(L,N)
real::h2o(M,N)
real::k
integer::i,j,q,p
open(unit=10,file='T_1800_P_25.0_CO2Mol_0.1_N2mol_0.9.data')
do i=1,1227852
do j=1,2
read(10,*)co2(i,j)
end do
end do
close(10)
open(unit=11,file='T_1800_P_25.0_H2OMol_0.1_N2mol_0.9.data')
do i=1,2966296
do j=1,2
read(11,*)h2o(i,j)
end do
end do
close(11)
q=1
do k=0,6000,0.000001
do p=1,1227852
if (abs(co2(p,1)-k)<=0.0001)then
cob(q,2)=co2(p,2)
end if
end do
q=q+1
end do
q=1
do k=0,6000,0.000001
do p=1,2966296
if (abs(h2o(p,1)-k)<=0.0001)then
cob(q,2)=cob(q,2)+h2o(p,2)
end if
end do
q=q+1
end do
open(unit=12,file='hecheng.txt')
do i=1,60000000
do j=1,2
write (12,*)cob(i,j)
end do
end do
close(12)
end
谢谢各位大神帮忙!!!!!
|