在编译Aspen Fortran模型时出现下面的错误提示,求解决方案
ASPCOMP: Using compiler C:\Program Files (x86)\Intel\Composer XE 2013 SP1\bin\intel64_mic\ifort.exeASPCOMP: Warning! Microsoft C runtime library msvcrt.lib not found in %LIB%
ASPCOMP: Warning! Microsoft C runtime library is needed for Dynamic Linking.
ASPCOMP: Warning!Intel Fortran runtime library libifcoremd.lib not found in %LIB%
ASPCOMP: Warning!Intel Fortran runtime library is needed for Dynamic Linking.
ifort.exe /nologo /c -DAWINNTN -DWIN32 -I. "-IC:\Program Files (x86)\AspenTech\AprSystem V7.3.2\Engine\commons" "-IC:\Program Files (x86)\AspenTech\Aspen Plus V7.3.2\Engine\commons" /fpp /Qsave /iface:cvf /MD -object:"HFUM.obj" "HFUM.f"
ifort: error #10236: File not found:'/nologo'
ifort: error #10236: File not found:'/c'
ifort: error #10236: File not found:'/fpp'
ifort: error #10236: File not found:'/Qsave'
ifort: error #10236: File not found:'/iface:cvf'
ifort: error #10236: File not found:'/MD'
ifort: warning #10362: Environment configuration problem encountered.Please check for proper MPSS installation and environment setup.
HFUM.f(17): warning #5117: Bad # preprocessor line
#include "ppexec_user.cmn"
-^
HFUM.f(18): warning #5117: Bad # preprocessor line
#include "dms_plex.cmn"
-^
HFUM.f(21): warning #5117: Bad # preprocessor line
#include "dms_ncomp.cmn"
-^
HFUM.f(20): error #6229: This EQUIVALENCE object must be an array.
Equivalence(B(1),IB(1))
-----------------------^
HFUM.f(71): error #6404: This name does not have a type, and must have an explicit type.
WRITE(USER_NHSTRY,*)
----------------^
HFUM.f(148): error #6404: This name does not have a type, and must have an explicit type.
CALL PPMON_VISCL(MSIN(NCOMP_NCC+2,1),MSIN(NCOMP_NCC+3,1),
----------------------------^
HFUM.f(20): error #6404: This name does not have a type, and must have an explicit type.
Equivalence(B(1),IB(1))
-----------------------^
compilation aborted for HFUM.f (code 1)
ifort: error #10236: File not found:'/nologo'
ifort: error #10236: File not found:'/c'
ifort: error #10236: File not found:'/fpp'
ifort: error #10236: File not found:'/Qsave'
ifort: error #10236: File not found:'/iface:cvf'
ifort: error #10236: File not found:'/MD'
ifort: warning #10362: Environment configuration problem encountered.Please check for proper MPSS installation and environment setup.
HFUM.f(17): warning #5117: Bad # preprocessor line
#include "ppexec_user.cmn"
-^
HFUM.f(18): warning #5117: Bad # preprocessor line
#include "dms_plex.cmn"
-^
HFUM.f(21): warning #5117: Bad # preprocessor line
#include "dms_ncomp.cmn"
-^
HFUM.f(20): error #6229: This EQUIVALENCE object must be an array.
Equivalence(B(1),IB(1))
-----------------------^
HFUM.f(71): error #6404: This name does not have a type, and must have an explicit type.
WRITE(USER_NHSTRY,*)
----------------^
HFUM.f(148): error #6404: This name does not have a type, and must have an explicit type.
CALL PPMON_VISCL(MSIN(NCOMP_NCC+2,1),MSIN(NCOMP_NCC+3,1),
----------------------------^
HFUM.f(20): error #6404: This name does not have a type, and must have an explicit type.
Equivalence(B(1),IB(1))
-----------------------^
compilation aborted for HFUM.f (code 1)
--------------------------------------------------------------
在官方帮助文档里面,跟着教程做里面的第四节一个案例,遇到了上面的问题
自己分析一下问题:
自认为已经排除了拼写的错误,很可能官方给点程序代码有关(个人认为与下面三条关系较大,代码参见参考部分):
#include "ppexec_user.cmn"
#include "dms_plex.cmn"
#include "dms_ncomp.cmn"
补充:原本来没有将C:\Program Files (x86)\Intel\Composer XE\bin\intel64_mic添加到系统变量path中时提示的错误信息是这样子的:
ASPCOMP: Warning!Intel Fortran compiler ifort.exe not found in %PATH%
ASPCOMP: Warning! Microsoft C runtime library msvcrt.lib not found in %LIB%
ASPCOMP: Warning! Microsoft C runtime library is needed for Dynamic Linking.
ASPCOMP: Warning!Intel Fortran runtime library libifcoremd.lib not found in %LIB%
ASPCOMP: Warning!Intel Fortran runtime library is needed for Dynamic Linking.
ifort.exe /nologo /c -DAWINNTN -DWIN32 -I. "-IC:\Program Files (x86)\AspenTech\AprSystem V7.3.2\Engine\commons" "-IC:\Program Files (x86)\AspenTech\Aspen Plus V7.3.2\Engine\commons" /fpp /Qsave /iface:cvf /MD -object:"HFUM.obj" "HFUM.f"
'ifort.exe' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
'ifort.exe' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
参考资料:AspenPlusCustomizingV732-Start.pdf4 Creating an Aspen Plus Fortran Model
问题已经解决,贴出来方便大家吧。
出现上面错误提示的主要原因应该是编译时找不到相关的Fortran编译文件,所以可以:
先打开Fortran自带的命令行(我用的是ia32这一个),
再在命令行里打开Aspen simulation engine对于的bat文件(可以在属性里找到它的位置,对于的脚本为aspsetup.bat),
这样就进入了Aspen simulation engine的环境了,接着用aspcomp.bat来对要编译的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*8DIAM, 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*8DLOG
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
补充:
系统环境为Aspen 7.3、 Intel Fortran 2013 、Visual Studio 2010 系统win7 64位 旗舰版 不知道是不是一开始就一堆英文把人都吓走了。。。 问下楼上fortran是怎么学的呢,整个内容自己写,还是有模板呢 1040534752 发表于 2014-5-22 08:39
问下楼上fortran是怎么学的呢,整个内容自己写,还是有模板呢
Fortran学习可以参考Fortran 编程指南;
上面的代码是官方文档里面就有的,我只是敲出来验证一下。 我也有此问题,是不是fortran软件的问题 感谢老师的帮助,要不然这个问题就没法解决了 fengzheng 发表于 2014-5-30 20:06
问题已经解决,贴出来方便大家吧。
出现上面错误提示的主要原因应该是编译时找不到相关的Fortran编译文 ...
请问你说的Fortran自带命令行指的是什么?我是初学者,遇到和你一样的问题,求解答
请问我在做AspenPlusCustomizingV732-Start.pdf-2 customizing the Excel/Aspen Plus Interface部分,出现以下问题,在将f文件转换成obj文件时,aspcomp Mem2时出现错误,跟这个帖子http://meng.horse/thread-41150-1-1.html是一样的错误,请问你知道为什么吗? 大家好,我是初学者,还不太懂怎么把Fortran和Aspen联系到一起来,我也在看这个帮助文档,我想请问一下HFUM是什么意思啊?是一个程序吗? 楼主你好,我在做Aspen链接的时候也遇到了这个问题,请问您是怎么解决的呢? dada0926 发表于 2015-5-22 20:42
请问我在做AspenPlusCustomizingV732-Start.pdf-2 customizing the Excel/Aspen Plus Interface部分,出现 ...
我也遇到了这个问题,请问你解决了吗,求分享{:1106_361:} 2446867118 发表于 2016-7-22 09:40
我也遇到了这个问题,请问你解决了吗,求分享
已结解决 dada0926 发表于 2015-5-22 20:42
请问我在做AspenPlusCustomizingV732-Start.pdf-2 customizing the Excel/Aspen Plus Interface部分,出现 ...
请问你解决了吗?求分享 fengzheng 发表于 2014-5-30 20:06
问题已经解决,贴出来方便大家吧。
出现上面错误提示的主要原因应该是编译时找不到相关的Fortran编译文 ...
大神能不能说的详细一点 fengzheng 发表于 2014-5-21 22:31
不知道是不是一开始就一堆英文把人都吓走了。。。
请问楼主怎么解决的呀,可以交流一下吗 fengzheng 发表于 2014-5-21 21:34
补充:
系统环境为Aspen 7.3、 Intel Fortran 2013 、Visual Studio 2010 系统win7 64位 旗舰版
可以邮件或者微信交流一下吗,slinw@outlook.com fengzheng 发表于 2014-5-21 21:34
补充:
系统环境为Aspen 7.3、 Intel Fortran 2013 、Visual Studio 2010 系统win7 64位 旗舰版
可以邮件或者微信交流一下吗,slinw@outlook.com
页:
[1]