A2AD error?!

Hi everybody,

I started recently my PhD about drive train system of Wind Turbines.

I´d like to use Fast as Pre-processor and integrate my own drive train models in Adams. Therefore I used one of the sample model input files and created the Adams model, worked.
I can compile A2AD code with my compiler…

my compiler setting are: /c /O1 /automatic /Ob2 /MD /Gm /traceback /Qzero /Qsave /real_size:32 /assume:byterecl /Qdiag-disable:5268

and link it with Adams but when I´d like to run it (mdi.bat->ru-user: ADAMS10.dll+test01_ADAMS.acf), I am getting an error, see in the attachment. I could see that this problem is also mentioned in the forum (Results comparison ADAMS and FAST - #9 by Justin.Madsen) but I can´t find a solution for it?!

Can you help me with that?

My Software:
MD ADAMS x64 2010 or
ADAMS x64 2011
Visual Studio 2008
Intel Visual Fortran Compiler XE 2011
or Fortran Compiler 11.1

Kind Regards,
Stephan


Hi, Stephan.

By default, Adams 2010 uses its C++ solver, while previous versions defaulted to its FORTRAN solver. The INFARY() and INFFNC() routines used in the current version of A2AD do not work in the C++ solver.

You can change the solver by going to the “Adams - Settings” shortcut (Start/All Programs/MSC.Software/{Adams version}/), which will open an Adams Registry Editor. Go to ASolver/Preferences and set “soverSelection” to “F77”. While you are there, also check that “memSize” is set to “huge” to avoid other errors when you run some simulations.

Hope that helps!

Hi Bonnie,

thank you again for your reply!

I managed now to run the code with MD ADAMS x64 R3, Intel Visual Fortran Compiler 11.1 x64, because everything I tried on MD ADAMS 2010-2011 was not successful. I had to activate the code fragment within A2AD_Mod.f90 for ADAMS 11, see below.
Another little notice I´d like to mention here is that one has to switch to MKS- Units (default in my case: MMKS) when importing the *.adm- file, otherwise Adams crashes without any error.

!======= ADAMS 11 code block; comment out for ADAMS 10.1 ==============
REAL(DbKi)     :: SCALES(4)  ! *** Use for ADAMS 11  SCALES array (1 to 4): TIME=1,LENGTH=2,FORCE=3,MASS=4

!bjj chg: LOGICAL(1)     :: EXIST      ! *** Use for ADAMS 11
LOGICAL(1)        :: EXIST      ! *** Use for ADAMS 11

CHARACTER( 2)  :: UNITS(4)   ! *** Use for ADAMS 11

CALL GTUNTS(EXIST,SCALES,UNITS)  ! *** Use for ADAMS 11
FCONV = SCALES(3)                ! *** Use for ADAMS 11
! ======= End of ADAMS 11 code block =================================== 

best regards,
Stephan

Hello,

I am also working with A2AD and trying to create the ADAMS dll file. I modified the batch file as shown below. I’m using MD ADAMS R3 2008 and Intel Visual Fortran compiler version 11.0.074. When I run the batch file the codes compile with no errors, but when it gets to the linking part of ADAMS2AD with AeroDyn, it gives some link errors (unresolved external symbols) and the dll file does not get created. The image shows the errors I’m getting. I was wondering if anyone had an issue with linking these codes together.

@ECHO OFF

REM ----------------------------------------------------------------------------
REM -------------------- LOCAL VARIABLES ---------------------------------------
REM ----------------------------------------------------------------------------
REM USERS SHOULD CHOOSE Compaq Digital Fortran (DF) or Intel Visual Fortran (IVF):

rem SET MyCompiler=DF
SET MyCompiler=IVF

SET ROOT_NAME=ADAMS


REM ----------------------------------------------------------------------------
REM -------------------- LOCAL PATHS ------------------------------------------
REM ----------------------------------------------------------------------------
REM USERS WILL NEED TO EDIT THESE PATHS TO POINT TO FOLDERS ON THEIR LOCAL MACHINES:
REM DF_LOC       is the location of the Compaq Digital Fortran files: DFVARS.bat and DF.exe for CVF.
REM IVF_LOC      is the location of the Intel Visual Fortran files (IFORTVARS.bat and IFORT.exe).
REM A2AD_Loc     is the location of the ADAMS-to-AeroDyn source files.
REM AeroDyn_Loc  is the location of the AeroDyn source files.
REM FAST_LOC     is the location of the FAST source files: FFTMod.f90, HydroCalc.f90, fftpack.f, UserSubs.f90, and possibly PitchCntrl_ACH.f90, UserVSCont_KP.f90, and/or BladedDLLInterface.f90.
REM NWTC_Lib_Loc is the location of the NWTC subroutine library files.
REM ----------------------------------------------------------------------------

SET DF_LOC="C:\Program Files\Microsoft Visual Studio\DF98\BIN"
SET IVF_LOC="C:\Program Files (x86)\Intel\Compiler\11.0\074\fortran\Bin\IA32"

REM NOTE: DO NOT USE QUOTATION MARKS HERE (AROUND THE PATH NAMES) FOR THE FOLLOWING
REM       FILE NAMES OR THE FILE CONCATENATION BELOW WILL NOT WORK

SET NWTC_Lib_Loc=C:\Users\Kwon\Desktop\A2AD\NWTC_Lib\Source
SET AeroDyn_Loc=C:\Users\Kwon\Desktop\A2AD\AD_v13\Source
SET Wind_Loc=C:\Users\Kwon\Desktop\A2AD\AD_v13\Source\InflowWind\Source
SET FAST_Loc=C:\Users\Kwon\Desktop\A2AD\FAST\Source
SET A2AD_Loc=C:\Users\Kwon\Desktop\A2AD\Source


REM ----------------------------------------------------------------------------
REM -------------------- LIST OF ALL SOURCE FILES ------------------------------
REM -------- please note that all source files must have a blank line ----------
REM --------   at the end so that they can be concatenated properly   ----------
REM ----------------------------------------------------------------------------

SET NWTC_Files=
SET NWTC_Files=%NWTC_Files%   "%NWTC_Lib_Loc%\SingPrec.f90"
IF "%MyCompiler%"=="DF" ( SET NWTC_Files=%NWTC_Files% + "%NWTC_Lib_Loc%\SysCVF.f90"
) ELSE ( SET NWTC_Files=%NWTC_Files% + "%NWTC_Lib_Loc%\SysIVF.f90" )
SET NWTC_Files=%NWTC_Files% + "%NWTC_Lib_Loc%\NWTC_IO.f90"
SET NWTC_Files=%NWTC_Files% + "%NWTC_Lib_Loc%\NWTC_Num.f90"
SET NWTC_Files=%NWTC_Files% + "%NWTC_Lib_Loc%\NWTC_Aero.f90"
SET NWTC_Files=%NWTC_Files% + "%NWTC_Lib_Loc%\NWTC_Library.f90"

SET Wind_Files=
SET Wind_Files=%Wind_Files%   "%Wind_Loc%\SharedInflowDefs.f90"
SET Wind_Files=%Wind_Files% + "%Wind_Loc%\HHWind.f90"
SET Wind_Files=%Wind_Files% + "%Wind_Loc%\FFWind.f90"
SET Wind_Files=%Wind_Files% + "%Wind_Loc%\FDWind.f90"
SET Wind_Files=%Wind_Files% + "%Wind_Loc%\CTWind.f90"
SET Wind_Files=%Wind_Files% + "%Wind_Loc%\UserWind.f90"
SET Wind_Files=%Wind_Files% + "%Wind_Loc%\InflowWindMod.f90"

SET AeroDyn_Files=
SET AeroDyn_Files=%AeroDyn_Files%   "%AeroDyn_Loc%\SharedTypes.f90"
SET AeroDyn_Files=%AeroDyn_Files% + "%AeroDyn_Loc%\AeroMods.f90"
SET AeroDyn_Files=%AeroDyn_Files% + "%AeroDyn_Loc%\GenSubs.f90"
SET AeroDyn_Files=%AeroDyn_Files% + "%AeroDyn_Loc%\AeroSubs.f90"
SET AeroDyn_Files=%AeroDyn_Files% + "%AeroDyn_Loc%\AeroDyn.f90"

SET Fixed_Files =
SET Fixed_Files=%Fixed_Files%   "%FAST_Loc%\fftpack.f"

SET FAST_Files=
SET FAST_Files=%FAST_Files%   "%FAST_Loc%\UserSubs.f90"
SET FAST_Files=%FAST_Files% + "%FAST_Loc%\UserVSCont_KP.f90"
SET FAST_Files=%FAST_Files% + "%FAST_Loc%\PitchCntrl_ACH.f90"
SET FAST_Files=%FAST_Files% + "%FAST_Loc%\FFTMod.f90"
SET FAST_Files=%FAST_Files% + "%FAST_Loc%\HydroCalc.f90"

SET A2AD_Files=
SET A2AD_Files=%A2AD_Files%   "%A2AD_Loc%\FAST_params.f90"
SET A2AD_Files=%A2AD_Files% + "%A2AD_Loc%\A2AD_Mod.f90"
SET A2AD_Files=%A2AD_Files% + "%A2AD_Loc%\Adams_subs.f90"


REM ----------------------------------------------------------------------------
REM ----------- Concatenate them into one file for free-format -----------------
REM ----------- Fortran and one file for fixed-format Fortran  -----------------
REM ----------------------------------------------------------------------------

COPY %NWTC_Files% + %Wind_Files% + %AeroDyn_Files% + %FAST_Files% + %A2AD_Files%  %ROOT_NAME%.f90
COPY %Fixed_Files% %Root_Name%.f


REM ----------------------------------------------------------------------------
REM ------- SET CREATE OBJECT FILE BASED ON SPECIFIED COMPILER -----------------
REM ----------------------------------------------------------------------------

IF "%MyCompiler%"=="DF" GOTO df


:ivf
REM ----------------------------------------------------------------------------
REM --------------------- INTEL VISUAL FORTRAN ---------------------------------
REM ---------------------   with Adams 2008R1  ---------------------------------
REM ----------------------------------------------------------------------------
ECHO.
ECHO Using Intel Visual Fortran
ECHO.


REM ............................................................................
REM .................. set compiler internal variables .........................
REM ............................................................................
IF "%INTEL_SHARED%"=="" CALL %IVF_LOC%\..\IFORTVARS.bat ia32


REM ............................................................................
REM ..................... set compiler options .................................
REM ............................................................................
REM SET COPTS= /c /automatic /architecture:pn4 /Ob2 /MD /Gm /O1     /traceback /real_size:32 /assume:byterecl /stand:f95 /check:bounds
REM SET COPTS= /c /automatic /architecture:pn4 /Ob2 /MD /Gm /Ot /O3 /traceback /real_size:32 /assume:byterecl /stand:f95  /Qdiag-disable:5268

SET COPTS= /c /Ob2 /MD /Gm /traceback /Qzero /Qsave /real_size:32 /assume:byterecl  /Qdiag-disable:5268
REM SET COPTS = /c /O1 /automatic /Ob2 /MD /Gm /traceback /Qzero /Qsave /real_size:32 /assume:byterecl /Qdiag-disable:5268

REM ............................................................................
REM ............................ compile .......................................
REM ............................................................................

ECHO.
ECHO Compiling ADAMS2AD and AeroDyn routines to create ADAMS.obj:
CALL %IVF_LOC%\IFORT %COPTS% /object:%ROOT_NAME%.obj %ROOT_NAME%.f90
CALL %IVF_LOC%\IFORT %COPTS% /object:%ROOT_NAME%f.obj %ROOT_NAME%.f


REM ............................................................................
REM ........................ link with Adams ...................................
REM ............................................................................
REM
ECHO Linking ADAMS2AD and AeroDyn routines with ADAMS 2008r1:
CALL C:\MSC.Software\MD_Adams\R3\common\mdi.bat cr-user n %ROOT_NAME%.obj %ROOT_NAME%f.obj -n %ROOT_NAME%.dll exit < NewLine.txt

GOTO end


:df
REM ----------------------------------------------------------------------------
REM --------------------- COMPAQ VISUAL FORTRAN --------------------------------
REM ---------------------   with Adams 2005R2  ---------------------------------
REM ----------------------------------------------------------------------------
ECHO.
ECHO Using Compaq Visual Fortran
ECHO.


REM ............................................................................
REM .................. set compiler internal variables .........................
REM ............................................................................
CALL %DF_LOC%\DFVARS.bat
REM      ----------------- set compiler options ------------------
REM SET COPTS=/compile_only /threads /inline:speed /debug:full /traceback /real_size:32 /assume:byterecl /stand
SET COPTS=/compile_only /threads /inline:speed /optimize:5 /traceback /real_size:32 /assume:byterecl /stand


REM ............................................................................
REM ............................ compile .......................................
REM ............................................................................

ECHO.
ECHO Compiling ADAMS2AD and AeroDyn routines to create ADAMS.obj:
CALL %DF_LOC%\DF %COPTS%  %ROOT_NAME%.f90 /object:%ROOT_NAME%.obj
CALL %DF_LOC%\DF %COPTS%  %ROOT_NAME%.f   /object:%ROOT_NAME%f.obj


REM ............................................................................
REM ........................ link with Adams ...................................
REM ............................................................................
ECHO Linking ADAMS2AD and AeroDyn routines with ADAMS 2005r2:
CALL mdi cr-user n %ROOT_NAME%.obj %ROOT_NAME%f.obj -n %ROOT_NAME%05r2.dll exit < NewLine.txt


:end
REM ----------------------------------------------------------------------------
REM ------------------------- CLEAR MEMORY -------------------------------------
REM ------------- and delete all .mod and .obj files ---------------------------
REM ----------------------------------------------------------------------------
ECHO a

DEL *.mod
DEL *.obj

SET MyCompiler=
SET DF_LOC=
SET IVF_LOC=
SET ROOT_NAME=
SET COPTS=

SET NWTC_Files=
SET Wind_Files=
SET AeroDyn_Files=
SET FAST_Files=
SET A2AD_Files=
SET Fixed_Files=

SET NWTC_Lib_Loc=
SET Wind_Loc=
SET AeroDyn_Loc=
SET A2AD_Loc=
SET FAST_Loc=

Hi,

If you are getting errors related to trig functions in the linking stage, you can try compiling with the optimization option set to /O1 (change /Ob2 in variable COPTS to /O1). See this post for details: http://forums.nrel.gov/t/results-comparison-adams-and-fast/217/1

Regards,

Thanks Bonnie. I changed /ob2 to /O1 and the dll has been built.

Hi Again

I had another question regarding A2AD dll interface. I want to connect the GH bladed interface to what I’m compiling to run 5MW NREL turbine with ADAMS. So I guess I have to involve the BladedDLLInterface.f90 into the batch file that I’m using and with the same way that we compile FAST comment out some of the subroutines from usersubs.f90 and UserVSCont_KP.f90 and remove PitchCtrl_ACH.f90 from the batch file. What I have in the CompileLinkA2AD.bat for the FAST codes part looks like this:

SET FAST_Files=
SET FAST_Files=%FAST_Files%   "%FAST_Loc%\UserSubs_forBladedDLL.f90"
SET FAST_Files=%FAST_Files% + "%FAST_Loc%\UserVSCont_KP_forBladedDLL.f90"
SET FAST_Files=%FAST_Files% + "%FAST_Loc%\FFTMod.f90"
SET FAST_Files=%FAST_Files% + "%FAST_Loc%\HydroCalc.f90"
SET FAST_Files=%FAST_Files% + "%FAST_Loc%\BladedDLLInterface.f90"

There are some errors in compiling the program (First one being: check INCLUDE paths [OUTPUT]) using the top files so the dll will not be created. I added the FAST_Mods.f90 which has the output module but encountered some other errors. Has anyone done this before? Is there a specific order for compiling the FAST Files with bladed interface? I saw the posts in the forum (http://forums.nrel.gov/t/5mw-onshore-baseline-windturbine-simulated-by-adams/187/1) but the problem does not get solved.

Thanks in advance,
Amin.

To compile A2AD with the Bladed dll interface option, you can try using the batch script here: wind.nrel.gov/public/bjonkman/De … 1a-bjj.bat.

See this topic for more information: http://forums.nrel.gov/t/compile-a2ad-with-bladed-dll-interface/266/1

Hi Friends,

During running A2AD to build dll file, when it receives to linking stage the following error appears in prompt command window:
LINK : fatal error LNK1104: cannot open file “ADAMS10.dll”


Here is my A2AD.bat file container:
A2AD.txt (5.8 KB)
Note I am using Windows 7 x64 and IVF v11.066 compiler, MD ADAMS 2010 x64 and I installed ADAMS after installing IVF.
Could anybody help me to solve this problem? Or is there anybody that have faced with such issue?
Thanks
Mehdi,

From the error message you posted, I would guess that the Adams10.dll file is protected so it cannot be overwritten. You could verify this by trying to delete the file manually.

If you can’t unprotect the file (try rebooting), you could also change the .bat script to write to a different file name.

Dear Bonnie,
Thanks to your reply.
That problem solved by removing Adams 2010 64bit and installing MD ADAMS 2010, because my IVF was 32bit. Forget that problem.
Below statements are for my last effort.

Followings are whole things that i did to create dll file,
1.Go to C:\Design Codes\A2AD\DLL
2.I modify the CompileLinkA2AD.bat file as attached.
CompileLinkA2AD.txt (5.79 KB)
3.Run the CompileLinkA2AD.bat file by double click on it. Then I faced with tons of errors like these:
ADAMS.f90<112>: error #7002: Error in opening the compiled module file. Check INCLUDE path. [IFPORT]


4.Then I copied the ifport.mod and ifport_types.mod files from C:\Program Files (x86)\Intel\Compiler\11.0\066\fortran\include\ia32 and paste them in C:\Design Codes\A2AD\DLL , then run the CompileLinkA2AD.bat file again, but this time the errors have changed as below:
link : fatal error LNK1181 : cannot open input file ‘libifcoremd.lib’

I found that this file is in C:\Program Files (x86)\Intel\Compiler\11.0\066\fortran\Bin\IA32.
I copied ‘libifcoremd.lib’ and then paste it in my working folder that my CompileLinkA2AD.bat is there (for example C:\Design Codes\A2AD\DLL) but the error persists as well.
I searched internet for this error but I saw different opinions and advices, I do some of them but the mentioned error also persists.
For example one have said that you must change /Ob2 / to /O1/ in compiler option. I did so, but the error did not disappear.
Note I am using Windows 7 64-bit and IVF v11.066 32-bit compiler, MD ADAMS 2010 32-bit and I installed ADAMS after installing IVF.
I dont know what I must to do?
Actually Your help is vital for me. And will be so appreciable.

All the Best,
Mehdi

After you run the IFORTVARS.bat file, I would think “C:\Program Files (x86)\Intel\Compiler\11.0\066\fortran\include\ia32” should be in your INCLUDE path. Apparently it is not (or perhaps IFORVARS.bat was not run properly), because you should NOT have to copy files from the compiler folders into your working directory.

I suggest you contact the support at MSC Software to help you figure out the various error you are getting.

Dear Bonnie,
After 4 days running the A2AD batch file, I finally found out that there must be a blank space between “” and CALL in (IF “%INTEL_SHARED%”=="" CALL %IVF_LOC%…\ifortvars.bat ia32) statement.
After implementing that, the dll file was created with no errors.

Your comment helped me to find that out. Thank you.

Mehdi,