在编译Aspen Fortran模型时出现下面的错误提示,求解决 ...? 补充代码: c$ #1 by: anavi date: 1-jul-1994 new for user models c c user unit operation model (or report) subroutine for user2 c subroutine hfum (nmati, msin, ninfi, sinfi, nmato, 2 sout, ninfo, sinfo, idsmi, idsii, 3 idsmo, idsio, ntot, nsubs, idxsub, 4 itype, nint, int, nreal, real, 5 ids, npo, nbopst, niwork, iwork, 6 nwork, work, nsize, size, intsiz, 7 ld ) c implicit none c c declare variables used in dimensioning c #include "ppexec_user.cmn" #include "dms_plex.cmn" real*8 b(1) equivalence(b(1),ib(1)) #include "dms_ncomp.cmn" c c c this subroutine will separate water into the second outlet c c first copy first inlet to first outlet c c c declare arguments c integer nmati, ninfi, nmato, ninfo, ntot, + nsubs, nint, npo, niwork,nwork, + nsize,nreal integer idsmi(2,nmati), idsii(2,ninfi), + idsmo(2,nmato), idsio(2,ninfo), + idxsub(nsubs),itype(nsubs), int(nint), + ids(2,3), nbopst(6,npo), + iwork(niwork),intsiz(nsize), ld real*8 msin(ntot,nmati), sinfi(ninfi), + sout(ntot,nmato), sinfo(ninfo), + work(nwork), size(nsize),real(nreal) c c declare local variables c integer offset,ierr,ldata,kdiag,idx(10),ncp,i,j,index, + lmw,ntubes,iperm,iret,ifail real*8 diam, len, diff, cg, rej_coef, c1, c2, c3, c4, p_perm, + delta_p,rho,mu,fin,cin,pin,uave,re,sc, + cp,cr,km,jm,fp,pret,xmw,x(10),flow c c declare functions c integer usrutl_get_real_param,usrutl_get_int_param, + usrutl_set_real_param integer dms_ifcmnc real*8 dlog c c begin executable code c get configured real variables form aspen plus ifail = 0 index = 0 ierr = usrutl_get_real_param('diam',index,diam) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if ierr = usrutl_get_real_param('len',index,len) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if ierr = usrutl_get_real_param('diff',index,diff) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if ierr = usrutl_get_real_param('get_conc',index,cg) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if ierr = usrutl_get_real_param('rej_coef',index,rej_coef) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if ierr = usrutl_get_real_param('coef1',index,c1) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if ierr = usrutl_get_real_param('coef2',index,c2) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if ierr = usrutl_get_real_param('coef3',index,c3) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if ierr = usrutl_get_real_param('coef4',index,c4) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if ierr = usrutl_get_real_param('perm_pres',index,p_perm) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if ierr = usrutl_get_real_param('delta_p',index,delta_p) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if c c get congigured integer variables from aspen plus c ierr = usrutl_get_int_param('ntubes',index,ntubes) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if c c calculate viscosity c call shs_cpack(msin(1,1),ncp,idx,x,flow) kdiag = 4 call ppmon_viscl(msin(ncomp_ncc+2,1),msin(ncomp_ncc+3,1), + idx,nbopst,kdiag,mu,ierr) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if if (ifail .eq. 1) return c c get location of molecular weight data c lmw = dms_ifcmnc('mw') c c model equations c rho = msin(ncomp_ncc+8,1)/1000. mu = mu * 10. fin = msin(ncomp_ncc+1,1) cin = msin(2,1) * b(lmw+2)/fin*360000. pin = msin(ncomp_ncc+3,1)/101325. uave = fin/(diam**2*3.14*ntubes/4.) re = diam*uave*rho/mu sc = mu/(rho*diff) cp = cg * (1-rej_coef) km = c1*re**c2 * sc**c3 * (diam/len)**c4 *diff/diam/100. jm = km * dlog(cg-cp)/(cin-cp) fp = jm *diam*len*3.14*ntubes*100*3600/1000. cr = (cin -fp/fin*cp)/(1-fp/fin) pret = pin -delta_p c c assume permeate stream is first,switch if not iperm =1 iret =2 if (idsmo(1,1) .eq. 'rete' ) then iperm =2 iret =1 end if c c fill sout array for permeate stream c sout(1,iperm) = fp * rho /3600. sout(2,iperm) = fp * cp /1000. / 3600. /b(lmw+2) sout(3,iperm) =sout(1,iperm)+sout(2,iperm) sout(4,iperm) = msin(4,1) sout(5,iperm) = p_perm * 101325. c c fill sout array for retentat stream using values form permeate stream c sout(1,iret) = msin(1,1) -sout(1,iperm) sout(2,iret) = msin(2,1) - sout(2,iperm) sout(3,iret) = sout(1,iret) + sout(2,iret) sout(4,iret) = msin(4,1) sout(5,iret) = pret *101325. c c now set values of the two variables designated as output parameters c ierr = usrutl_set_real_param('cp_prot',index,cp) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if ierr = usrutl_set_real_param('cr_prot',index,cr) if (ierr .ne. 0) then write(user_nhstry,*) ifail = 1 end if return end 复制代码 查看更多