How to set up Abaqus for User Subroutines (updated)
Posted: Fri Oct 13, 2023 7:55 pm
The instructions in App. E.1 (p. 511) of my textbook "Finite Element Analysis of Composite Materials Using Abaqus Second Edition" works well if you can install Intel oneAPI 2021, but with the new version 2023, things have changed.
If you install more than the strictly necessary set of components, the API will flood the PATH environment in your Windows computer and, at the command line or Powershell
> Abaqus cae nogui=job.py
... Abaqus will crash, and it will also crash if you call the .py script from inside CAE, or paste it at the >> prompt inside CAE.
The solution is to install only 2 components of the API, plus off course do the integration with VS 2019.
1 -- Math Kernel Library (and in the same step Integrate with VS 2019)
2 -- Intel Fortran Compiler and Intel Fortran Compiler Classic (bundled)
Then, the abq2020.bat has to be modified like this:
@echo off
rem Next line, environment for Fortran, needed for Fortran Abaqus user subroutines
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" -arch intel64
rem Next line, environment for C++, not needed for Fortran Abaqus user subroutines
rem call "C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat" -arch intel64
rem setlocal
rem set ABA_COMMAND=%~nx0
rem set ABA_COMMAND_FULL=%~f0
@call
"C:\SIMULIA\EstProducts\2020\win_b64\code\bin\ABQLauncher.exe" %*
rem endlocal
The modification of
SIMULIA\EstProducts\2020\win_b64\SMA\site\win86_64.env
is to simply add the last two lines below:
## Fortran compile command for User Subroutines
compile_fortran=['ifort',
'/Qmkl:sequential', #EJB <-- MKL
'/free', #EJB <-- free format Fortran95, do not use with VUMAT
You do not need to modify win86_64.env if you just use *.obj code developed by someone else, but you definitely need those 2 lines if you want to develop your own Fortran 90/95 formatted code. Otherwise, you are forced to develop your code in F77 fixed format--something that I refuse to do.
If you have done the modification, then
Abaqus verify -user_std
will fail, because the verification code uses F77-formatted code, that is incompatible because we modified
SIMULIA\EstProducts\2020\win_b64\SMA\site\win86_64.env
to set file with extension ".for" to hold FREE FORMAT code, just like file with extension ".f90" (see above "'/free', ").
We have no choice but to do this, or else return to the dark ages of F77-formatted code.
If you install more than the strictly necessary set of components, the API will flood the PATH environment in your Windows computer and, at the command line or Powershell
> Abaqus cae nogui=job.py
... Abaqus will crash, and it will also crash if you call the .py script from inside CAE, or paste it at the >> prompt inside CAE.
The solution is to install only 2 components of the API, plus off course do the integration with VS 2019.
1 -- Math Kernel Library (and in the same step Integrate with VS 2019)
2 -- Intel Fortran Compiler and Intel Fortran Compiler Classic (bundled)
Then, the abq2020.bat has to be modified like this:
@echo off
rem Next line, environment for Fortran, needed for Fortran Abaqus user subroutines
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" -arch intel64
rem Next line, environment for C++, not needed for Fortran Abaqus user subroutines
rem call "C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat" -arch intel64
rem setlocal
rem set ABA_COMMAND=%~nx0
rem set ABA_COMMAND_FULL=%~f0
@call
"C:\SIMULIA\EstProducts\2020\win_b64\code\bin\ABQLauncher.exe" %*
rem endlocal
The modification of
SIMULIA\EstProducts\2020\win_b64\SMA\site\win86_64.env
is to simply add the last two lines below:
## Fortran compile command for User Subroutines
compile_fortran=['ifort',
'/Qmkl:sequential', #EJB <-- MKL
'/free', #EJB <-- free format Fortran95, do not use with VUMAT
You do not need to modify win86_64.env if you just use *.obj code developed by someone else, but you definitely need those 2 lines if you want to develop your own Fortran 90/95 formatted code. Otherwise, you are forced to develop your code in F77 fixed format--something that I refuse to do.
If you have done the modification, then
Abaqus verify -user_std
will fail, because the verification code uses F77-formatted code, that is incompatible because we modified
SIMULIA\EstProducts\2020\win_b64\SMA\site\win86_64.env
to set file with extension ".for" to hold FREE FORMAT code, just like file with extension ".f90" (see above "'/free', ").
We have no choice but to do this, or else return to the dark ages of F77-formatted code.