top of page
Search
Writer's picturePhilip Dai

Running subroutine with ABAQUS on a machince without fortran compiler

Updated: Jan 30, 2024


The first step is of course compile the fortran subroutine with Abaqus on a machine with fortran compiler. The abaqus make utility is used to create user postprocessing executables and user-defined libraries of Abaqus user subroutines. User subroutine shared libraries created using this procedure are used by specifying the usub_lib_dir variable in the Abaqus environment file. The advantage of doing this is that an analysis using user subroutines can execute without having to compile or link the user subroutine.


In a Linux (Windows) machine with access to fortran compiler, the user subroutine shared libraries can be created using the following command:

abaqus make library=my_usubs.f(or)

Command summary of ABAQUS make utility


abaqus make

{job=job-name | library=source-file}

user={source-fileobject-file}

directory=library-dir

object_type={fortran | c | cpp}


Compiled subroutines are specific to the Abaqus version used to compile them. The above command produces 2 files; one object file (.obj on Windows or .o for Linux machines) and a shared library file (.dll for Windows and .so for Linux)


Once the user subroutine shared libraries are created, specify the usub_lib_dir variable in the Abaqus environment file either locally or globally as shown below.


Method-1

Follow the following steps to setup Compiler file to work with Fortran user subroutine


1. Copy the standardU.dll file into a folder (like C:\tmp)

2. Create an empty file with the following name: abaqus_v6.env and add the sentence into the file.

usub_lib_dir="C:\tmp"

3. Copy the abaqus_v6.env file to the working folder (the same folder where your .inp file is located), submit job in normal way (abaqus j=filename int cpus=3), in this way, "user=" option is not needed from command line when submitting a job


It is important to note that you need this abaqus_v6.env file in your working directory. Alternatively, you can copy the shared library file to your working directory, and add the following lines in your local abaqus_v6.env file on your working directory:


import os

usub_lib_dir=os.getcwd()


Method-2

Find the abaqus_v6.env file in your system folder of Abaqus installation (for abaqus 2016, normally it is at C:\Program Files\Abaqus 2016\SimulationServices\win_b64\SMA\site),

add the sentence into the existing abaqus_v6.env file and save it.

usub_lib_dir="C:\tmp"


Or you can add the sentence into the existing 'basic_v6.env' or 'custom_v6.env'.


Note though you need administrator's privilege to use Method-2.



For multiple fortran files, you might do the following:


It is worth noting that an object file (without the source code) can be merged with another source file (with different subroutines) using the ‘directory’ option to produce a common shared library as shown below:


abaqus make library=my_usub2.f[or] directory=[~]\my_usub1-std.o[bj]

30 views0 comments

Recent Posts

See All

Remote Interview Video Podcast

Based on the following link:   (Ref: https://www.vidyard.com/blog/interview-videos/?gdpr-consent=674 )   To record a quality interview,...

Comments


bottom of page