Fortran for Abaqus: Complete Guide for Engineers

Fortran is an important part of advanced Abaqus modelling because many Abaqus user subroutines are written in Fortran. User subroutines allow engineers to extend Abaqus beyond the capabilities available through standard material, loading, field, interaction and element definitions.

Instead of treating Fortran as a separate programming subject, it is more useful for Abaqus users to understand the specific Fortran concepts required to write, compile, debug and validate user subroutines.

This guide explains the role of Fortran in Abaqus, the structure of a user subroutine, variables and arrays, compilation, debugging and practical development workflows.

Why Is Fortran Used in Abaqus?

Abaqus provides many built-in material models, loads, interactions and analysis capabilities. However, advanced research and engineering problems sometimes require behaviour that is not available directly in the standard interface.

User subroutines provide a programming interface through which an engineer can supply custom calculations during an Abaqus analysis.

The Abaqus subroutine-tutorial library covers several families of user-defined functionality, including materials, elements, field variables, loads, thermal behaviour, contact, amplitudes and output. :contentReference[oaicite:2]{index=2}

What Can You Do With Fortran in Abaqus?

Depending on the selected user subroutine, Fortran can be used to define or modify:

  • constitutive material behaviour;
  • user-defined finite elements;
  • hardening behaviour;
  • creep behaviour;
  • field variables;
  • thermal behaviour;
  • distributed loads;
  • amplitudes;
  • initial stresses;
  • solution-dependent state variables;
  • material orientation;
  • user-defined output.

Do You Need Fortran for Every Abaqus Model?

No. Most conventional Abaqus analyses can be performed without writing any Fortran.

Fortran becomes particularly useful when the required behaviour cannot be represented adequately using Abaqus/CAE settings, built-in material models, standard loads or predefined interactions.

Practical rule:

Do not use a user subroutine simply because you can. First determine whether the required behaviour can be represented reliably using the standard Abaqus capabilities.

Fortran and Abaqus User Subroutines

A user subroutine is essentially a Fortran procedure that Abaqus calls during the analysis when the relevant physical operation is required.

Abaqus analysis ↓ Relevant calculation ↓ Abaqus calls Fortran subroutine ↓ Your code performs calculation ↓ Values returned to Abaqus ↓ Analysis continues

UMAT: The Most Common Starting Point

UMAT is one of the most important Abaqus user subroutines for engineers developing custom constitutive material models in Abaqus/Standard.

A UMAT typically receives the current material state and deformation information and returns quantities such as updated stress and material Jacobian information.

This makes UMAT a natural example through which to learn the relationship between Fortran programming and Abaqus' solver.

VUMAT for Abaqus/Explicit

VUMAT is the corresponding major user-material interface for Abaqus/Explicit.

The programming concepts remain similar to UMAT, but the interface, data organisation and numerical requirements differ.

Fortran Variables and Data Types

A good understanding of variables is essential before writing an Abaqus user subroutine.

Typical Fortran programs use variables to store:

  • integers;
  • real-valued quantities;
  • logical flags;
  • character data;
  • arrays.
INTEGER :: I DOUBLE PRECISION :: X LOGICAL :: FLAG X = 1.0D0 I = 10 FLAG = .TRUE.

Why Double Precision Matters

Numerical calculations in finite element simulations involve quantities that can vary over many orders of magnitude.

Fortran code should therefore use numerical types consistently with the precision expected by the Abaqus environment and the particular calculation.

Good practice:

Avoid casually mixing single-precision and double-precision constants in numerical code. Be deliberate about numerical precision throughout the subroutine.

Arrays in Abaqus User Subroutines

Abaqus user subroutines frequently exchange information through arrays.

Examples include stress components, strain increments, state variables, coordinates and material properties.

ARRAY ↓ Abaqus supplies data ↓ Fortran processes data ↓ Fortran updates array ↓ Abaqus receives result

State Variables

History-dependent material models often require internal variables that evolve throughout the analysis.

The SDVINI subroutine can be used to initialize solution-dependent state variables before the analysis begins.

This is particularly important when the material does not start from a completely virgin state.

Initial Stress and SIGINI

For advanced initial-stress definitions, Abaqus provides SIGINI .

SIGINI is useful when an initial stress field must be calculated from user-defined logic rather than simply entered as a uniform initial value.

Fortran and User-Defined Elements

UEL allows engineers to develop completely user-defined finite elements for Abaqus/Standard.

UEL development requires a deeper understanding of both finite element formulation and Fortran programming.

VUEL for Abaqus/Explicit

For Abaqus/Explicit, the corresponding user-defined element interface is VUEL .

This is an advanced application of Fortran because the developer is responsible for supplying element-level behaviour compatible with the Explicit solver.

Fortran and Field Variables

Field variables can be calculated or updated using user subroutines.

The USDFLD interface allows user-defined field-variable behaviour in Abaqus/Standard.

Field variables can then influence material properties or other model behaviour where supported.

USDFLD Programming Concept

Coordinates / solution information ↓ USDFLD ↓ Field variable ↓ Material property ↓ Local response

Fortran and Creep

Time-dependent material behaviour can also be implemented through a dedicated user interface.

The CREEP subroutine is intended for user-defined creep and swelling behaviour in Abaqus/Standard.

Creep models require particular attention to time integration, state-dependent behaviour and numerical stability.

Fortran and Hardening

Some material models require specialised user-defined hardening laws.

Abaqus provides UHARD for user-defined hardening behaviour in Abaqus/Standard.

Fortran and Thermal Fluxes

User-defined thermal loading is another common application of Fortran.

The DFLUX subroutine can define user-specified distributed fluxes in Abaqus/Standard.

For example, the flux may depend on position, time or another quantity available to the subroutine.

Fortran and Custom Amplitudes

When a conventional amplitude definition is insufficient, a user-defined amplitude can be programmed using UAMP .

This can be useful when the prescribed history must be calculated dynamically rather than simply read from a fixed table.

Fortran and Material Orientation

Anisotropic materials sometimes require a material orientation that varies according to geometry or another user-defined rule.

The ORIENT subroutine provides a user-defined material-orientation capability.

Fortran and User-Defined Output

User-defined calculations may also be required for post-processing.

The UVARM subroutine can define user-defined output variables for Abaqus/Standard.

This is useful when an engineering quantity is calculated from existing solution variables but is not directly available as a standard output variable.

URDFIL and Reading Analysis Results

Some advanced workflows require a user subroutine to read and process analysis results while an analysis is running.

The URDFIL interface provides this type of Abaqus/Standard results-processing capability.

Basic Structure of a Fortran Subroutine

Although interfaces differ between Abaqus user subroutines, the general programming structure can be understood using a simple example.

SUBROUTINE EXAMPLE(A,B,C) IMPLICIT NONE DOUBLE PRECISION A DOUBLE PRECISION B DOUBLE PRECISION C C = A + B RETURN END

IMPLICIT NONE

Using IMPLICIT NONE is good Fortran programming practice because variables must be declared explicitly.

This can help catch typographical errors that would otherwise create unintended variables.

Arguments Passed by Abaqus

Abaqus user-subroutine interfaces define the arguments that the subroutine receives and returns.

These arguments are not arbitrary. They must match the interface expected by the particular Abaqus subroutine.

Important:

Do not copy the argument list from one user subroutine into another. UMAT, VUMAT, UEL, USDFLD, DFLUX and other interfaces have different argument lists and meanings.

Reading the Abaqus Subroutine Interface

Before writing code, identify:

  1. which solver is being used;
  2. which subroutine is required;
  3. what each argument represents;
  4. which arrays are inputs;
  5. which arrays must be updated;
  6. what units are expected;
  7. what quantities must be returned to Abaqus.

Fortran Loops

Loops are frequently required when processing arrays or multiple components.

INTEGER :: I DO I = 1, N A(I) = B(I) * 2.0D0 END DO

Conditional Statements

User subroutines often contain conditional logic.

IF (X .GT. 0.0D0) THEN VALUE = X ELSE VALUE = 0.0D0 END IF

Conditions can be used to implement different physical regimes, loading states or numerical branches.

Fortran Functions

Larger subroutines are often easier to maintain when repeated calculations are placed in functions or auxiliary procedures.

RESULT = MY_FUNCTION(X,Y)

However, auxiliary routines must be organised carefully so that they are compiled and linked correctly with the main Abaqus user subroutine.

Fortran Modules

Modules can be useful in larger Fortran projects for sharing constants, derived data and procedures.

They should be introduced carefully in Abaqus environments because the compilation order and build configuration must remain compatible with the Abaqus compilation process.

Constants and Parameters

Physical constants and model parameters should be clearly defined rather than scattered throughout the source code.

DOUBLE PRECISION, PARAMETER :: PI = 3.141592653589793D0

Units in Fortran Subroutines

Abaqus does not automatically enforce a universal unit system. Consequently, quantities introduced in a Fortran subroutine must be consistent with the unit system used by the complete model.

Example:

If stress is expressed in MPa and length in mm, every parameter, coefficient and derived quantity in the user subroutine must be consistent with that system.

Debugging Fortran User Subroutines

Debugging is one of the most important skills when developing Abaqus subroutines.

Typical problems include:

  • syntax errors;
  • incorrect variable declarations;
  • wrong array dimensions;
  • incorrect argument lists;
  • uninitialised variables;
  • incorrect numerical expressions;
  • division by zero;
  • invalid array indexing;
  • incorrect physical assumptions.

Compiler Errors vs Abaqus Errors

Problem Typical stage
Fortran syntax error Compilation
Undefined variable Compilation
Wrong argument type Compilation / linking
Invalid array access Runtime
Incorrect constitutive equation Analysis
Unstable numerical formulation Analysis

Printing Debug Information

During development, carefully selected diagnostic output can help determine whether a subroutine is receiving and returning sensible values.

WRITE(*,*) 'DEBUG: X = ', X

Excessive printing should be avoided in large analyses because a subroutine may be called extremely many times.

Debugging Strategy

  1. Start with the smallest possible model.
  2. Verify that the subroutine is being called.
  3. Check input variables.
  4. Check intermediate calculations.
  5. Check returned quantities.
  6. Test simple limiting cases.
  7. Only then increase model complexity.

Testing a User Subroutine

A user subroutine should be validated independently wherever possible.

For a material model, useful tests may include:

  • single-element tests;
  • uniaxial loading;
  • simple shear;
  • loading and unloading;
  • different time increments;
  • different mesh sizes.

Single-Element Testing

Single-element testing is one of the most effective ways to isolate a constitutive or user-subroutine problem.

Simple geometry ↓ Single element ↓ Controlled loading ↓ Known expected response ↓ Compare Abaqus result ↓ Validate subroutine

Fortran and Nonlinear Materials

Custom material subroutines must be designed with the nonlinear solver in mind.

For example, a UMAT may need to provide consistent stress updates and appropriate tangent information for Abaqus/Standard.

A mathematically correct constitutive equation is therefore not automatically a numerically robust Abaqus implementation.

Fortran and User-Defined Fields

When a physical property depends on location, temperature, time or another evolving quantity, a field-variable subroutine may be appropriate.

The USDFLD tutorial is directly relevant when developing this type of behaviour.

Fortran and Thermal Problems

Fortran can also be used to define custom thermal behaviour.

Depending on the physical requirement, Abaqus provides user interfaces for thermal material behaviour and thermal fluxes.

The UMATHT subroutine is intended for user-specified thermal material behaviour in Abaqus/Standard.

Fortran and Distributed Loads

When a distributed load must be calculated from user-defined equations, DLOAD provides a relevant Abaqus/Standard user-subroutine interface.

The load may depend on coordinates, time or other information supplied to the subroutine.

Fortran and Boundary Conditions

User-defined displacement boundary conditions can be implemented using DISP in Abaqus/Standard.

This is useful when a boundary motion cannot conveniently be represented using a standard prescribed-displacement definition.

Fortran and Contact

Advanced contact formulations can also be extended through user subroutines.

For example, FRIC provides a user-defined friction interface for Abaqus/Standard.

Fortran and Advanced Contact Behaviour

When the required interaction behaviour is beyond the standard contact definitions, a user-defined interaction interface can provide additional flexibility.

The UINTER subroutine is intended for custom interaction behaviour in Abaqus/Standard.

Compiling an Abaqus Fortran Subroutine

Writing the source code is only one part of the process. Abaqus must also compile and link the Fortran source with the analysis.

Fortran source ↓ Compiler ↓ Object / executable components ↓ Abaqus linking ↓ Abaqus analysis

Compiler Configuration

The exact compiler environment depends on the Abaqus release and the operating system.

Engineers should therefore configure the compiler according to the requirements of the installed Abaqus version rather than assuming that every compiler configuration is interchangeable.

Calling Abaqus With a User Subroutine

A typical Abaqus workflow specifies the Fortran source file when launching the analysis.

abaqus job=my_job user=my_subroutine.for

The exact command-line options should be checked against the installed Abaqus release and local environment.

One Source File or Multiple Files?

Small user subroutines can often be maintained in a single source file. Larger projects may be easier to manage using several source files.

A multi-file project can separate:

  • main Abaqus subroutine;
  • constitutive equations;
  • mathematical utilities;
  • material constants;
  • debugging utilities.

Organising a Large Fortran Project

Main interface

↓

Material / physical model

↓

Numerical routines

↓

Utility functions

↓

Validation tests

Common Fortran Mistakes in Abaqus

Incorrect Interface

The argument list must match the Abaqus interface for the selected subroutine.

Uninitialised Variables

Every variable used in a calculation should have a known value before it is used.

Array Bounds

Incorrect indexing can cause runtime failures or corrupt numerical results.

Wrong Units

A mathematically correct equation can still produce incorrect results if the units are inconsistent.

Excessive Debug Printing

Printing from a frequently called subroutine can create enormous output files and slow an analysis.

Testing Only Large Models

Always isolate the subroutine with simple verification problems before moving to production-scale analyses.

Fortran Code Quality

User subroutines can become difficult to maintain when physical equations, numerical algorithms and debugging statements are mixed together without structure.

Good code should have:

  • clear variable names;
  • consistent formatting;
  • comments explaining non-obvious equations;
  • well-defined interfaces;
  • separate numerical utilities where appropriate;
  • repeatable validation tests.

Fortran Comments

Comments are especially important in research-grade Abaqus subroutines. A future user should be able to determine what each physical equation represents and what units are expected.

! Calculate equivalent stress ! Input stress components are assumed ! to use the model's consistent stress unit.

From Fortran Code to Engineering Model

The ultimate objective is not to produce sophisticated Fortran. The objective is to implement a physically correct, numerically stable and verifiable engineering model.

Physical theory ↓ Mathematical formulation ↓ Fortran implementation ↓ Abaqus user subroutine ↓ Verification ↓ Validation ↓ Engineering application

Choosing the Right Abaqus Subroutine

Requirement Relevant subroutine
Custom material model UMAT
Explicit custom material VUMAT
User-defined finite element UEL
Field variables USDFLD
Creep / swelling CREEP
Hardening UHARD
Thermal material behaviour UMATHT
Distributed thermal flux DFLUX
Custom amplitude UAMP
Initial state variables SDVINI
Initial stresses SIGINI
Material orientation ORIENT
User-defined output UVARM
Results processing URDFIL

A Practical Learning Path

  1. Learn basic Fortran syntax and numerical programming.
  2. Understand how Abaqus calls user subroutines.
  3. Start with a relatively simple interface.
  4. Build a single-element or similarly controlled test.
  5. Verify numerical results against an analytical solution where possible.
  6. Introduce more complicated constitutive or physical behaviour.
  7. Validate against experimental or published results.
  8. Only then move to production-scale simulations.

Fortran Is a Tool, Not the Final Objective

The most important skill for an Abaqus user-subroutine developer is not simply knowing Fortran syntax.

The developer must understand the relationship between:

  • the physical problem;
  • the governing equations;
  • the finite element formulation;
  • the Abaqus subroutine interface;
  • the numerical algorithm;
  • the Fortran implementation;
  • the verification process.

Final Checklist for Abaqus Fortran Development

  • Have you selected the correct Abaqus user subroutine?
  • Have you checked whether it belongs to Abaqus/Standard or Abaqus/Explicit?
  • Do you understand every argument in the interface?
  • Are variables explicitly declared?
  • Are numerical types and precision consistent?
  • Are array dimensions correct?
  • Are units consistent?
  • Have you tested the simplest possible case?
  • Have you checked limiting cases?
  • Have you separated coding errors from physical-model errors?
  • Have you validated the final implementation?

Conclusion

Fortran remains an important engineering tool for extending Abaqus with user-defined behaviour. Its role becomes particularly significant when standard Abaqus capabilities are not sufficient to represent a material, field, load, element, initial state, output quantity or other physical process.

Engineers do not need to become general-purpose Fortran programmers before beginning Abaqus subroutine development. The most effective approach is to learn the Fortran constructs required by the selected Abaqus interface and then develop progressively more sophisticated models through controlled verification problems.

Practical rule:

Start with the physics, select the correct Abaqus subroutine, understand its interface, implement the smallest reliable Fortran model, verify it with a controlled problem, and only then introduce production-level complexity.