- 积分
- 0
- 注册时间
- 2004-10-13
- 仿真币
-
- 最后登录
- 1970-1-1
|
请教大家一个关于在fortran生成*.dll文件的问题.我没怎么用过这个软件,最近由于在用到一个模拟软件时,需要用fortran语言编写几句话,以便那个软件调用.可是在调用时一定要在fortran里生成一个*.dll文件才行,可是由于那几句话在编译时老出现两个错误,好象都是语法上的错误.所以不能生成*.dll文件.我不知道怎么修改,麻烦各位帮帮忙,帮我看看问题出在哪,帮我修改一下,如果可以的话,麻烦告诉一下生成*.dll文件的详细步骤.我把我的那几句fortran语句(在我的模拟软件帮助文件里找的)贴出来,麻烦大家看一下,我实在是不会.
#include "cfx5ext.h"
dllexport(myinjection1)
SUBROUTINE MYINJECTION1 (NLOC,NRET,NARG,RET,ARG,CRESLT
& CZ,DZ,IZ,LZ,RZ)
CC
CC
CC --------------------
CC Input
CC --------------------
CC
CC NLOC - number of entities
CC NRET - length of return stack
CC NARG - length of argument stack
CC ARG - argument values
CC CRESLT - Result
CC
CC --------------------
CC Output
CC --------------------
CC
CC RET - return values
CC
CC --------------------
CC Details
CC --------------------
CC
CC======================================================================
C
C ------------------------------
C Preprocessor includes
C ------------------------------
C
#include "cfd_sysdep.h"
#include "cfd_constants.h"
C
C ------------------------------
C Argument list
C ------------------------------
C
INTEGER NARG, NRET, NLOC
C
REAL ARG(NLOC,NARG), RET(NLOC,NRET)
C
INTEGER IZ(*)
CHARACTER CZ(*)*(1)
DOUBLE PRECISION DZ(*)
LOGICAL LZ(*)
REAL RZ(*)
CHARACTER CRESLT*(*)
C
C ------------------------------
C Local Variables
C ------------------------------
C
REAL SLPVEL,RE,CD
C=======================================================================
C
C ---------------------------
C
Executable Statements
C ---------------------------
C
C=======================================================================
C
C Return variables:
C -----------------
C
C Particle position starts at : CRD_PT = RET(1,1)
C Particle mass flow rate starts at : PMASS = RET(1,4)
C Particle diameter starts at : DIAM_PT = RET(1,5)
C Particle velocity starts at : VEL_PT = RET(1,6)
C Particle temperature starts at : TEMP_PT = RET(1,9)C=======================================================================
C
C-----------------------------------------------------------------------
C Calculate the particle quantities
C-----------------------------------------------------------------------
C
CALL MYINJECTION1_SUB (NLOC,RET(1,1),RET(1,4),RET(1,5),RET(1,6)
& ,RET(1,9))
C
END
SUBROUTINE MYINJECTION1_SUB (NPART,CRD_PT,PMASS,PDIAM,PVEL,PTEMP)
C
C=======================================================================
C Calculate the particle positions and velocities
C=======================================================================
C
C ------------------------------
Preprocessor includes
C ------------------------------
C
#include "cfd_sysdep.h"
#include "cfd_constants.h"
C
C ------------------------------
C Argument list
C ------------------------------
C
INTEGER NPART
REAL CRD_PT(3,NPART),PMASS(NPART),PDIAM(NPART),
& PVEL(3,NPART),PTEMP(NPART)
C
C ------------------------------
C Executable statements
C ------------------------------
C
C---- All particle are started from the same position (0.42,0,0.12)
C
DO IPART=1,NPART
CRD_PT(1,IPART) = ZERO
CRD_PT(2,IPART) = 0.025+0.05*MOD(IPART-1,2)
CRD_PT(3,IPART) = 0.025+0.05*((IPART-1)/2)
PMASS(IPART) = 5E-2
PDIAM(IPART) = 5E-5
PVEL(1,IPART) = 0.0
PVEL(2,IPART) = 0.0
PVEL(3,IPART) = 0.0
PTEMP(IPART) = 273.0
ENDDO
C
END
提示的错误是:1)Error: The assumed-size array must be a dummy argument.[CZ]
CHARACTER CZ(*)*(1) ------------------^
2)Error: This passed length character name has been used in an invalid context. [CRESLT] CHARACTER CRESLT*(*) ------------------^
Error executing df.exe.
麻烦大家帮我看下错在哪里并告诉一下生成.dll文件的步骤,谢谢! |
|