写成如下代码就可以,fortran只有子函数是不能编译通过的。我已经刚才编译成功了。但有几个警告还没消除,楼主自己干吧。 program usrknt_main call usrknt(n,ncomp,nr,nrl,nrv,t,tliq,tvap,p,phfrac,f,x, y, @idx,nbopst,kdiag,stoic,ihlbas,hldliq,timliq,ihvbas,hldvap,timvap, @nint,int,nreal,real,rates,ratel,ratev,nintb,intb,nrealb,realb, @niwork,iwork,nwork,work) stop end subroutine usrknt(n,ncomp,nr,nrl,nrv,t,tliq,tvap,p,phfrac,f,x, y, @idx,nbopst,kdiag,stoic,ihlbas,hldliq,timliq,ihvbas,hldvap,timvap, @nint,int,nreal,real,rates,ratel,ratev,nintb,intb,nrealb,realb, @niwork,iwork,nwork,work) implicit none !declare variables used in dimensioning integer ncomp, nr, nrv, nint, nintb, nrealb,niwork,nwork, @user_iumiss real user_rumiss !#include "ppexec_user.cmn" equivalence (rmiss, user_rumiss) equivalence (imiss, user_iumiss) !declare arguments integer nrl(3),idx(ncomp),nbopst(6), int(nint),intb(nintb), &iwork(niwork),n,kdiag, ihlbas, ihvbas,nreal real*8 phfrac(3),x(ncomp,3),y(ncomp), &stoic(ncomp,nr),rates(ncomp), &ratel(1),ratev(nrv), &realb(nrealb),work(nwork), t,tliq, &tvap,p,f,hldliq,timliq real*8 hldvap,timvap !declare local variables integer imiss real*8 real(nreal), rmiss !begin executable code integer i real*8 c,g,e,r,dp,k,rate i=10 c=10 g=0.002 e=2.7182 dp=0.00093 r=8.314 k=c*g*e**(22000/(r*t))/dp rates=k*x(1,1) return end