Fortran Arrays, Variables and Data Structures for Abaqus
Arrays and variables are at the centre of almost every Abaqus Fortran user subroutine. Abaqus passes physical and numerical information to the subroutine through arguments, and the Fortran code processes that information using variables, arrays, loops and mathematical operations.
Understanding how these data structures work is therefore essential before developing more advanced Abaqus user subroutines. A mistake in an array index, variable type, dimension or data update can produce incorrect results or cause an analysis to fail.
This guide explains the main Fortran data structures used by Abaqus users, with examples relevant to material models, user elements, field variables, loading routines, initial conditions and custom output.
Why Data Structures Matter in Abaqus
An Abaqus user subroutine does not normally receive one single number. Instead, Abaqus often passes groups of related quantities through arrays and arguments.
A material routine such as UMAT may work with arrays containing stress components, strain increments, material properties and state variables.
An Explicit material routine such as VUMAT uses its own interface and data organisation appropriate to Abaqus/Explicit.
The programming principle is the same: understand what each variable represents, what its dimensions are, and when its value changes.
Variables vs Arrays
A scalar variable stores one value.
An array stores a collection of values under one variable name.
This distinction becomes extremely important in Abaqus because many physical quantities are naturally represented as vectors or matrices.
Scalar Variables
Scalar variables are used for quantities such as:
- temperature;
- time;
- material constants;
- strain increments;
- tolerances;
- flags and counters.
Integer Variables
Integer variables are commonly used for counters, array indices and identifiers.
In Abaqus user-subroutine programming, integers are particularly important when looping over components or selecting particular array locations.
Logical Variables
Logical variables can represent true/false conditions.
Logical variables can make complicated decision-making easier to read.
Character Variables
Character variables are less central to most numerical calculations but can be useful for text processing and diagnostic operations.
Numerical user subroutines should generally keep text processing separate from the main computational path whenever possible.
Explicit Variable Declaration
Explicit declarations are an important programming practice.
Using IMPLICIT NONE helps prevent spelling mistakes from
silently creating unintended variables.
Fortran Arrays
An array stores multiple values of the same general data type.
Fortran normally uses one-based indexing, so the first element above is
VALUES(1).
Array Indexing
Array indices identify individual elements.
The exact meaning and ordering of Abaqus stress or strain components depends on the particular user-subroutine interface and element formulation. Always use the interface definition applicable to the routine being implemented.
Why Array Indexing Errors Are Dangerous
Accessing an invalid array element can produce incorrect results or corrupt memory.
The loop above is safe because the index remains within the declared range.
Never assume that an array contains more components than have actually been allocated or supplied by the Abaqus interface.
One-Dimensional Arrays
One-dimensional arrays are useful for vectors and lists of quantities.
Coordinates, material parameters and component vectors can all be represented this way.
Two-Dimensional Arrays
Two-dimensional arrays are commonly used for matrices.
This structure is particularly important for stiffness matrices, transformation matrices and user-element calculations.
User-Defined Elements and Matrix Data
Matrix and array programming becomes especially important when developing a user-defined element with UEL .
A user element can require arrays for element residuals, stiffness matrices, coordinates, properties and other element-level quantities.
For Abaqus/Explicit, the corresponding user-element workflow uses VUEL .
Three-Dimensional Arrays
More complex algorithms can use three-dimensional arrays.
Although powerful, higher-dimensional arrays should be used only when they make the physical or numerical structure clearer.
Array Initialisation
Arrays should be given appropriate initial values before they are used.
Using an uninitialised array can introduce unpredictable numerical behaviour.
State Variable Arrays
History-dependent models often require arrays that store information from previous increments.
For example, SDVINI can be used to initialise solution-dependent state variables.
Conceptually, a state-variable array may look like:
The meaning assigned to each location should be documented clearly.
Documenting State-Variable Indices
A simple comment block can make a state-variable array much easier to maintain.
This becomes increasingly important as the number of state variables increases.
Arrays Passed Through Subroutine Arguments
Abaqus commonly passes arrays directly into user subroutines.
The exact declarations and dimensions must follow the specific Abaqus interface. The example illustrates the general concept of receiving arrays through arguments.
Input Arrays vs Output Arrays
Not every argument has the same role.
| Type | Purpose |
|---|---|
| Input | Information supplied to the routine. |
| Output | Information calculated by the routine. |
| Input/Output | Information that is read, modified and returned. |
Understanding this distinction is essential when reading an Abaqus subroutine interface.
Material Properties as Arrays
Material parameters can be supplied as a list rather than individual variables.
A constitutive routine such as UMAT may therefore use an array of material properties to organise the parameters required by the model.
The programmer should document exactly what each property index means.
Using Parameter Indices
Instead of repeatedly writing unexplained numerical indices, a developer can define named parameters where appropriate.
This can make large constitutive routines easier to understand.
Arrays in Explicit Material Models
The same programming principles apply to VUMAT , although the interface and data organisation are specific to Abaqus/Explicit.
Always distinguish the physical meaning of an array from its programming representation.
Field Variable Arrays
Field variables are another example of data organised as arrays.
In Abaqus/Standard, USDFLD can calculate user-defined field variables.
The programmer must know which field-variable index represents which physical quantity.
Explicit Field Variables
The Explicit counterpart, VUSDFLD , uses the corresponding Abaqus/Explicit data interface.
The programming principle remains the same: document the meaning of every field-variable location and update it consistently.
Loops Over Arrays
Loops are the normal way to process array components.
This avoids repeating the same expression for every component.
Nested Loops Over Matrices
This pattern appears frequently in finite-element and constitutive calculations.
Array Operations and Performance
Abaqus can call a user subroutine many times. Therefore, an inefficient array operation can become expensive when repeated across many elements and increments.
- avoid unnecessary array copying;
- avoid repeated calculations;
- keep inner loops simple;
- avoid excessive file output;
- reuse quantities that do not change.
Time and Increment Variables
Time-related quantities are often represented by scalar variables, but their relationship with arrays and state variables can be important.
For a time-dependent material model such as CREEP , the programmer must distinguish current time, increment size and accumulated history.
Thermal Data Structures
Thermal user routines also rely on organised numerical data.
For example, UMATHT uses a dedicated interface for user-defined thermal material behaviour.
Temperature, energy-related quantities and other thermal variables should be clearly separated in the implementation.
Flux Calculations
A distributed flux routine such as DFLUX may calculate a scalar quantity from coordinates, time and other available information.
The scalar result can therefore depend on several input variables.
Arrays and Contact Variables
Contact routines provide another example of structured data passed into a user routine.
With FRIC , the programmer works with quantities associated with user-defined friction behaviour.
The important programming principle is to identify which quantities are inputs, which are outputs, and which values must be updated consistently.
Coordinate Arrays
Coordinates are naturally represented as vectors.
Coordinate information can then be used to define spatially varying behaviour.
Material Orientation Data
When material behaviour depends on direction, orientation information becomes an important part of the data structure.
The ORIENT interface allows user-defined material orientations.
The programmer must keep global and local coordinate systems clearly separated.
Initial Stress Data
Initial stress information can also be organised through arrays.
The SIGINI interface can be used to define initial stresses in Abaqus/Standard.
Output Arrays
Sometimes a calculation is useful but is not directly available through standard Abaqus output.
The UVARM interface allows user-defined output quantities to be calculated in Abaqus/Standard.
A well-organised output array can make it easier to inspect intermediate quantities during verification.
Passing Arrays Between Subroutines
Large user-subroutine projects may contain several helper procedures.
Passing arrays allows a mathematical calculation to be separated from the Abaqus-specific interface.
Keep Data Ownership Clear
When several procedures modify the same array, it should be clear which procedure is responsible for updating each quantity.
Abaqus inputs
↓
Main user subroutine
↓
Calculation procedure
↓
Updated arrays
↓
Return to Abaqus
Local vs Global Data
A variable declared inside a procedure has a different role from data shared across procedures.
For most engineering algorithms, keeping data local where possible makes the implementation easier to understand and reduces unintended dependencies.
Common Data-Structure Mistakes
Wrong Index
The code accesses an array element outside the intended range.
Wrong Dimension
A vector is treated as a matrix or a matrix is accessed with the wrong dimensions.
Uninitialised Data
A variable or array is used before receiving a valid value.
Undocumented Indices
The meaning of STATEV(4), PROPS(7) or FIELD(3) is unclear.
Incorrect Update
A value that should be preserved is accidentally overwritten.
Wrong Interface Assumption
The programmer assumes an argument has a meaning or dimension that does not match the selected Abaqus interface.
Document Every Important Array
A simple documentation block can prevent many future errors.
Use Named Constants for Indices
Named indices can make a large implementation much easier to maintain.
Data Structures for User-Defined Elements
User elements can involve several different data structures at once:
- nodal coordinates;
- element properties;
- degrees of freedom;
- element residual vectors;
- stiffness matrices;
- state variables;
- integration data.
This is why understanding arrays is especially important before developing a UEL or VUEL .
Data Structures for Boundary Conditions
User-defined boundary conditions usually require fewer arrays than user elements, but the same principles apply.
The DISP interface can be used to calculate user-defined displacement boundary conditions.
Time, node information and prescribed values should be handled as separate logical quantities rather than mixed together unnecessarily.
Data Structures for User Amplitudes
User-defined amplitudes provide another example of organising scalar and time-dependent data.
The UAMP interface allows custom amplitude behaviour in Abaqus/Standard.
Data Type Consistency
Mixing incompatible data types can lead to subtle numerical problems.
Keep the numerical types consistent throughout calculations wherever appropriate.
Integer vs Real Division
Programmers should understand the difference between integer and floating-point arithmetic.
Explicit conversion can make the intended numerical behaviour clearer.
Copying Arrays
Arrays can be copied directly when appropriate.
However, unnecessary copying inside a frequently called routine can increase computational cost.
Temporary Arrays
Temporary arrays can make complicated calculations easier to understand.
Use temporary arrays when they clarify the algorithm, but avoid creating unnecessary large data structures inside frequently executed routines.
Array-Based Mathematical Operations
Many engineering calculations can be expressed compactly using arrays.
Data Structures and Numerical Stability
Good data organisation can also make numerical stability problems easier to identify.
Keeping trial quantities, previous-state quantities and updated quantities in separate variables reduces the risk of accidentally using a value from the wrong stage of the calculation.
Previous State vs Current State
This pattern is particularly useful when implementing history-dependent material behaviour.
Protecting Important Data
A common programming mistake is overwriting a quantity that is still needed later.
Use separate variables when the old and new values must both remain available.
Data Structures and Debugging
Well-organised arrays make debugging considerably easier.
Instead of printing an entire calculation, inspect a small number of meaningful quantities:
Diagnostic output should be used selectively because Abaqus may call a user routine many times.
Organising a Large User Subroutine
Separate Physical Meaning From Array Indices
Avoid writing large sections of code filled with unexplained indices.
The second approach makes the physical meaning immediately visible.
Data Structures for Verification
During development, temporary arrays can store intermediate quantities that can then be compared against analytical or reference results.
This is especially useful when developing constitutive models or complicated element formulations.
Use Small Test Problems
A single-element model is often the best environment for testing arrays associated with a material routine.
Verify the values entering and leaving the routine before moving to a large finite-element model.
Recommended Data-Structure Workflow
- Identify every quantity supplied by Abaqus.
- Identify its data type.
- Identify its dimensions.
- Document its physical meaning.
- Assign clear local variable names where useful.
- Perform the calculation.
- Update state or output arrays.
- Verify the resulting values.
Common Mistakes With Abaqus Arrays
- Assuming all arrays start at index zero.
- Using an incorrect number of components.
- Confusing stress and strain component ordering.
- Overwriting previous state information.
- Failing to initialise temporary arrays.
- Using the wrong dimension for a matrix.
- Forgetting to document the meaning of array locations.
- Passing arrays with an incompatible interface.
- Performing unnecessary array operations inside frequently called code.
Best Practices for Abaqus Fortran Data
Use Clear Names
Prefer names that communicate the physical meaning of the quantity.
Document Indices
Record what each state, property or field-variable index represents.
Check Dimensions
Verify array sizes against the selected Abaqus interface.
Initialise Data
Do not rely on uninitialised memory for engineering calculations.
Separate Old and New
Keep previous and updated quantities separate when both are required.
Test Incrementally
Verify individual arrays and calculations before running the full model.
From Arrays to Complete Abaqus Subroutines
Once arrays, variables and data structures are understood, the next step is to apply them to a complete Abaqus interface.
A material developer may move from basic array manipulation into UMAT or VUMAT .
A developer working on field variables may instead use USDFLD or VUSDFLD .
The important point is that the programming concepts remain the same; what changes is the Abaqus interface and the physical quantities being exchanged.
Final Checklist
- Every variable has a clear data type.
- Arrays have clearly defined dimensions.
- Array indices are within valid ranges.
- State-variable locations are documented.
- Material-property locations are documented.
- Field-variable locations are documented.
- Previous and updated values are distinguished.
- Temporary arrays are initialised.
- Matrix dimensions are checked.
- Numerical precision is appropriate.
- The Abaqus interface is followed exactly.
- The implementation is tested with a small model.
Conclusion
Fortran arrays and variables provide the basic data structures through which Abaqus communicates with a user subroutine. Scalars represent individual quantities, one-dimensional arrays represent vectors and collections of values, while multidimensional arrays can represent matrices and more complex numerical structures.
For Abaqus users, understanding the physical meaning of each array is just as important as understanding its Fortran syntax. State variables, material properties, field variables, stress components, coordinates and output quantities must all be organised consistently.
The most reliable approach is to document every important index, verify array dimensions, distinguish old and new states, initialise temporary data and test the implementation using a small Abaqus model before moving to a complex analysis.
Treat every Abaqus array as a structured collection of physical information. Know what each element means, when it is updated, what units it uses and whether Abaqus expects it to be read, modified or returned.
