标题: 求助一个有关Fortran动态链接库的问题 [打印本页] 作者: 小剑 时间: 2021-4-14 19:38 标题: 求助一个有关Fortran动态链接库的问题 有一款仿真软件是使用如下方法进行二次开发的:
file:///C:\Users\XIAOJIANJJJ\Documents\Tencent Files\1429709479\Image\C2C\HTLG$2G3BL_EZRW)25~R4IJ.png1. Implement an equation for wear rate within the FORTRAN subroutine and save it as UserWearModel.fNote: A sample UserWearModel.f exists within the advanteng bin.
2. Compile the subroutine to a *.dll file by typing the following command into the Intel FORTRAN COMPILER:
>ifort /DLL /libs:static /threads UserWearModel.f
3. If necessary, rename the *.dll file as UserWearModel.dll
4. Replace any existing UserWearModel.dll file located in the advanteng bin with the new
UserWearModel.dll
5. Create a simulation
我按照这个用VS+IVF进行编译之后,替换掉原来的.dll文件之后,发现仿真软件无法正确使用了。还有就是软件自带的.dll文件只有8kb,而我编译的确有17.5kb,文件代码如下
c User Defined Tool Wear Subroutine
c Version 4.4-006
c Copyright Third Wave Systems, Inc 2003
c 7900 West 78th Street - Suite 250
c Edina, MN 55439
c 1.952.832.5515
c
SUBROUTINE WEARMODEL_USER(wdot,pressure,velocity,temperature,
1 uwearpar)
c
!DEC$ ATTRIBUTES DLLEXPORT :: WEARMODEL_USER
implicit real*8 (a-h,o-z)
real*8 uwearpar(10)
c
c uwearpar(10) is cutting velocity unless user assigns number.
c
c Usui's Model
c
wdot=pressure*velocity*uwearpar(1)
1 *exp(-uwearpar(2)/(temperature+273.15))
c
return
end