Linking ABAQUS and Fortran for Developing User Subroutines
ABAQUS has a vast library of elements and materials for any researcher or engineer who wants to model different responses of solids. However, if you want to describe a constitutive material model or develop a finite element that is not yet implemented in the ABAQUS libraries, you need to develop your own user subroutine from scratch and then integrate it with ABAQUS solver. Compiling a Fortran subroutine and linking it with ABAQUS is not an easy process. Different compatibility of each ABAQUS version makes it even more challenging. Here, I am going to summarize the compatibility between different version of Fortran, Microsoft Visual Studio, and ABAQUS and then show how you can link them successfully.
While you can write subroutines in either FORTRAN or C++, I found that learning materials for writing in FORTRAN is more available on the internet.
The following table shows the compatible versions of Intel Fortran and Visual Studio for ABAQUS. Most of them are based on my own experience. I installed all of them on Windows 10 and this tutorial is for Windows 10 OS.
ABAQUS version | Visual Studio | Intel Fortran |
---|---|---|
6.12 | 2010 | XE 2013 |
6.14 | 2010, 2012 | XE 2013, XE 2016 |
2017 | 2015 | XE 2016 |
2019 | 2015 | XE 2018 |
2020 | 2019 | XE 2019 |
While the order of installation does not really make a difference, if you install Visual Studio before installing Intel Fortran, Fortran will be linked to Visual Studio automatically. Thus, start with Visual Studio. You can find a free Community version of Visual Studio 2019, which is good enough. Find it here. While installation, make sure that you install Desktop Development with C++, especially MSVC v141 and MSVC v140 componenets.
If you are a student, you can also install Intel Parallel Studio free using a student license. Intel recently replaced Intel Parallel Studio XE with Intel oneAPI and I could not find the student version on their website. However, if you have checked out a license for Intel Parallel Studio previously, you should be able to renew it if you sign-in to your Intel account and down Parallel Studio. You can also download Intel Fortran Compiler as a single component here, but I have not used it this way.
At then end install ABAQUS. Get help from your IT manager, as the activation process in ABAQUS newer versions is a bit tricky. In later versions of ABAQUS, e.g. 2019 and 2020, remember to select SIMULIA Established Products and SIMULIA Established Products CAAAPI when installing the medias.
If you are installing ABAQUS older versions, e.g. 6.12 or 6.14, you need to change the Target
of ABAQUS shortcuts. Find the following four files on your system, righ click and open properties
, then change Target
as shown below:
- For ABAQUS CAE:
"C:\Program Files (x86)\Intel\Composer XE 2013\bin\ifortvars.bat" intel64 && C:\SIMULIA\Abaqus\Commands\abq6121.bat cae || pause
- For ABAQUS COMMAND:
"C:\Program Files (x86)\Intel\Composer XE 2013\bin\ifortvars.bat" intel64 && C:\Windows\SysWOW64\cmd.exe /k
- For ABAQUS VERIFICATION:
"C:\Program Files (x86)\Intel\Composer XE 2013\bin\ifortvars.bat" intel64 && C:\Windows\SysWOW64\cmd.exe /k
- For ABAQUS VIEWER:
"C:\Program Files (x86)\Intel\Composer XE 2013\bin\ifortvars.bat" intel64 && C:\SIMULIA\Abaqus\Commands\abq6121.bat viewer || pause
The first part of each address points to the location of ifortvars.bat
on your system and the second part is what is the previous targets of those shortcuts. "
should be kept as it is shown.
If you are using later ABAQUS versions, e.g. 2019 or 2020 and Intel XE 2019, you need to add ifortvars.bat
and vcvars64.bat
to the path
environment variable on Windows. To do that, open System Variables
on Windows and add the path to these two files in separate rows. You can find ifortvars.bat
by default in Intel installation folder:
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin
and vcvars64.bat
in the Microsft Visual Studio installation folder:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64
Then, open C:\SIMULIA\Commands
and open abq{abaqus version}.bat
with a text editor. At the top of the file, after the @echo off
command, change the following lines if you are using Microsoft Visual Studio 2019:
setlocal
set ABA_COMMAND=%~nx0
set ABA_COMMAND_FULL=%~f0
@call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin\ifortvars.bat" intel64 vs2019
@call "C:\SIMULIA\EstProducts\2020\win_b64\code\bin\ABQLauncher.exe" %*
endlocal
Remember to pu @
before each command to prevent them from displaying on the screen. To check wether the linking process is performed successfully, open Abaqus Command
and run the following test:
abaqus verify -user_std
It takes a few minutes to run the test and shows ...PASS
` if it finds all necessary components and perform the test analysis with user subroutine.
Intel recently changed the packaging of its compilers and introduced Intel oneAPI, which contains free FORTRAN and C++ compilers. First, you need to install Intel® oneAPI Base Toolkit and Intel® oneAPI HPC Toolkit on your local machine.
Then, add the following two addresses to the path
variable:
C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env
C:\Program Files (x86)\Microsoft Visual Studio\{installed version}}\Community\VC\Auxiliary\Build
Then, like the previous case, open C:\SIMULIA\Commands
and open abq{abaqus version}.bat
with a text editor. At the top of the file, after the @echo off
command, paste the following code if you are using Microsoft Visual Studio 2019:
@echo off
setlocal
set ABA_COMMAND=%~nx0
set ABA_COMMAND_FULL=%~f0
@call "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat" intel64 vs2019
@call "C:\SIMULIA\EstProducts\{installed_version}\win_b64\code\bin\ABQLauncher.exe" %*
endlocal
A quick note: I found that Program Files (x86)
has a space in it and causes an error when Python scripting is used. If an error of The input line is too long
is shown after submitting a job, try replacing C:\Program Files (x86)
with C:\PROGRA~2
in the .bat
file.
Fr ABAQUS 2019, you also need to add the following line to the win86_64.env
file, which contains the variables to build the ABAQUS environment. You can find this file inC:\Program Files\Dassault Systemes\SimulationServices\V6R2019x\win_b64\SMA\site
:
compile_fortran+= ['/names:lowercase',]
You do not need to add this line for ABAQUS 2020, since ABAQUS parameters are updated for Intel oneAPI in the newer version. If you need to use free form Fortran instead of fixed form, which is the default for ABAQUS, you should add the following line to win86_64.env
:
compile_fortran+= ['/free',]
You can find the file for ABAQUS 2020 in C:\SIMULIA\EstProducts\2020\win_b64\SMA\site
. You can also check whether ABAQUS linking works properly by entering the following command in Command Prompt:
abaqus info=system
While I successfully passed the ABAQUS verification case and compiled simple elastic UMAT with oneAPI, it seems that the newest version of Fortran compiler, version 20, is not compatible with ABAQUS 2020 and you should still use Fortran compiler version 19.
Resources: https://www.researchgate.net/publication/349991987_Linking_ABAQUS_2019_and_Intel_oneAPI_Base_Toolkit_FORTRAN_Compiler