User subroutines represent an excellent opportunity in Abaqus to significantly expand its range of applications. User subroutines are traditionally created in the Fortran programming language. The use of C++ is also possible. For reasons of quality and performance, Dassault Systèmes SIMULIA requires the use of a special Fortran compiler for Abaqus. In recent years, this has been limited to the Intel Fortran compiler.
In this article we will discuss the installation and use of a Fortran compiler. The focus is currently on the installation under Windows.
Much worth knowing about the current Abaqus version as well as the technical requirements can be found in the Program Directories Library, [1].
Here you select the Product Line (SIMULIA Abaqus, Isight, fe-safe, Tosca), the Release (Established Products 2022) and the Level (FD 08 (FP.2319)). Here FP.2319 stands for the fixpack from the 19th week of the year 2023. Within the Prerequisites for Abaqus in the Additional Notes, there is a note about the compiler, see picture below.
On Windows, the Intel Fortran compiler also requires Microsoft Visual Studio, [2]. Detailed installation instructions can be found in [3]. For the knowledge base you need an ID. We will be happy to help you with the creation.
To date, we have not observed any problems with newer versions of the Fortran compiler.
Intel oneAPI Toolkits is a collection of Intel software development tools [4]. Different groups of tools are available in so-called kits (kits). Building on a base toolkit, there are kits for HPC, IoT and rendering development. The Base Toolkit should always be installed first and then additional kits as needed.The Fortran compiler is included in the HPC Toolkit.
Intel oneAPI currently includes 2 Fortran compilers:
- ifort – classic (in the following this will be used)
- ifx – ifort plus further functionalities OpenMP
Please pay attention if ifort is omitted in future versions
On Windows, the Fortran compiler requires Microsoft Visual Studio. Information about the compatibility of the versions can be found in [5]. The following combination is recommended for Windows 11: OneAPI 2022.3 – Visual Studio 2019.
However, only the current version is available free of charge.
Microsoft Visual Studio is a comprehensive software development environment (IDE) for .NET and C++ developers [10]. There is a free Community Edition – conditions in the right image below
On Windows, the routines used by Abaqus are linked to Microsoft’s libraries. Usually, necessary libraries are also installed with every Abaqus installation. Accordingly, Visual Studio is required to create user subroutines. Under Linux, their installation is not necessary.
There is a note under the Intel website that the Microsoft Build Tools might be sufficient. The Microsoft website states that “Use of this tool requires a valid Visual Studio license.”. Also, the C++ capabilities within Abaqus are needed if C++ applications are to be created under Windows.
It also seems that for the community version, only the latest version can be installed at a time. Here 2022.
Intel oneAPI is available in the website under Free Development Tools. In [4] you can find the link to the End User License Agreement
In [8] you can find the oneAPI Licensing Overview. Here the Fortran Compiler belongs to the End User License Agreement for Developer Tools.
It is found under 2.1 B: “use the Materials solely for Your personal or business use to develop Your Product, in accordance with the documentation included as part of the Materials;”.
Regarding the support, a distinction is made between community support (probably free of charge) and priority support (probably with costs). Older versions are probably only available with the paid support version [9], see also image below.
Microsoft Visual Studio
- Visual Studio core editor (by default)
- Desktop development with C++ (manually select additional)
- Picture on the right shows the installed components
The Visual Studio Installer is installed with it, with which the installation can be customized very well.
Intel one API
When the installer starts, it checks the environment and detects the installed Visual Studio. Here please select an appropriate coupling with Visual Studio.
- Intel oneAPI Base Kit
- Intel oneAPI HPC Kit
Via the installer (but here the downloaded .exe file) the installation can be displayed well
Overall, the installation is performed without any problems. An installation can also be done well after Abaqus has already been installed. Detailed installation instructions can also be found in [3].
One problem with using the Fortran compiler on Windows is properly enabling the environment variables. In [3] there are instructions how to integrate this activation into the call of Abaqus and Abaqus/CAE. This makes sense, if you want to compile user subroutines always directly when starting the simulation. In the form of: abaqus -job jobname -user subroutine
An alternative is to start Abaqus/CAE and calculations from the CMD window of the Intel Fortran compiler. Open the CMD window via the Start menu and select the Intel oneAPI command prompt for Intel 64, see picture on the right.
One disadvantage is the antiquated user interface of a CMD window.
Here it might be useful to compile user subroutines before the start of a simulation and provide subroutines as a compiled Abaqus library. This has other advantages as well. (see below)
Libraries can be created under both Windows and Linux, which are accessed when Abaqus is started.
With abaqus make library=usersubroutine you create a library which does not have to be actively included in the calculation call via user=usersubroutine. Also you can provide the subroutine for different Abaqus versions.
For example, a directory Fortran is created and the user subroutine exampleSub.f is provided there. Then create a subdirectory v2022, change to this directory and execute the following command
abq2022hf5 make library=..\exampleSub
Now the files standardU.dll (in case of a user subroutine for Abaqus/Standard) and exampleSub-std.obj are created.
To use this library in an Abaqus calculation, the abaqus_v6.env must be created or adapted in the home or working directory. The following line should be inserted
usub_lib_dir=”d:\niceDir\Fortran\v2022“
One advantage of this method is that the user subroutine is in only one location and thus cannot exist in different versions in different locations.
Another advantage is that you can use this library also on other computers without Fortran compiler. The only condition is that it should be the same operating system and the same Abaqus version.
- User subroutines are an excellent way in Abaqus to significantly expand the scope of Abaqus applications. User subroutines are traditionally created in the Fortran programming language. The use of C++ is also possible.
- For reasons of quality and performance, Abaqus requires the use of a special Fortran compiler. In recent years this has been limited to the Intel Fortran compiler.
- With oneAPI, Intel has been making various software tools available free of charge for some time. Among them also the Fortran compiler necessary for the creation of user subroutines in Abaqus.
- On Windows, however, the installation of Microsoft Visual Studio is additionally required. This product is chargeable for most companies (Enterprise).
- A (major) limitation of the free versions is that only the current version is available for download.
- On the part of Abaqus compiled user subroutines can be distributed arbitrarily on the same operating systems for the same Abaqus version. Thus, a minimal installation of oneAPI and Visual Studio for the development of user subroutines is possible on only one computer.
- Recommendation: For professional and frequent use of user subroutines, commercial versions of Intel Fortran Compiler and Microsoft Visual Studio should be used respectively.
In part, this text and illustrations shown are based on research of evaluated literature. If this is the case, the sources are marked in the text by a number, e.g. [2], and the source is listed here.
In part, however, the sources listed here should simply be understood as recommendations for further reading.
- oneAPI License Overview – Nov 22 2021.pdf
- Intel End User License Agreement forDeveloper Tools – Oct2021.pdf
[9] Intel Priority Support Lizenz[10] Microsoft Visual Studio