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.

REAL*8 TEMPERATURE TEMPERATURE = 300.0D0

An array stores a collection of values under one variable name.

REAL*8 STRESS(6) STRESS(1) = 100.0D0 STRESS(2) = 50.0D0 STRESS(3) = 25.0D0

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.
REAL*8 TIME_CURRENT REAL*8 TEMPERATURE REAL*8 YOUNGS_MODULUS REAL*8 TOLERANCE TIME_CURRENT = 0.1D0 TEMPERATURE = 293.15D0 YOUNGS_MODULUS = 210000.0D0 TOLERANCE = 1.0D-10

Integer Variables

Integer variables are commonly used for counters, array indices and identifiers.

INTEGER I INTEGER NCOMP NCOMP = 6 DO I = 1, NCOMP ! Process component I END DO

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 PLASTIC_ACTIVE PLASTIC_ACTIVE = .FALSE. IF (PLASTIC_STRAIN .GT. 0.0D0) THEN PLASTIC_ACTIVE = .TRUE. END IF

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.

CHARACTER*80 MESSAGE MESSAGE = 'Abaqus user subroutine diagnostic'

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.

SUBROUTINE EXAMPLE(A,B,C) IMPLICIT NONE REAL*8 A REAL*8 B REAL*8 C C = A + B END

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.

REAL*8 VALUES(5) VALUES(1) = 10.0D0 VALUES(2) = 20.0D0 VALUES(3) = 30.0D0 VALUES(4) = 40.0D0 VALUES(5) = 50.0D0

Fortran normally uses one-based indexing, so the first element above is VALUES(1).

Array Indexing

Array indices identify individual elements.

REAL*8 STRESS(6) STRESS(1) = SIGMA_11 STRESS(2) = SIGMA_22 STRESS(3) = SIGMA_33 STRESS(4) = SIGMA_12 STRESS(5) = SIGMA_13 STRESS(6) = SIGMA_23

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.

REAL*8 STATEV(10) DO I = 1, 10 STATEV(I) = 0.0D0 END DO

The loop above is safe because the index remains within the declared range.

Always check array dimensions.

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.

REAL*8 VECTOR(3) VECTOR(1) = X VECTOR(2) = Y VECTOR(3) = Z

Coordinates, material parameters and component vectors can all be represented this way.

Two-Dimensional Arrays

Two-dimensional arrays are commonly used for matrices.

REAL*8 MATRIX(3,3) DO I = 1, 3 DO J = 1, 3 MATRIX(I,J) = 0.0D0 END DO END DO

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.

REAL*8 DATA(3,3,4) DATA(1,1,1) = 0.0D0

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.

DO I = 1, N ARRAY(I) = 0.0D0 END DO

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:

STATEV(1) = PLASTIC_STRAIN STATEV(2) = DAMAGE STATEV(3) = HARDENING_VARIABLE STATEV(4) = INTERNAL_VARIABLE

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.

! STATEV(1) = Equivalent plastic strain ! STATEV(2) = Damage variable ! STATEV(3) = Hardening variable ! STATEV(4) = Internal temperature

This becomes increasingly important as the number of state variables increases.

Arrays Passed Through Subroutine Arguments

Abaqus commonly passes arrays directly into user subroutines.

SUBROUTINE MY_ROUTINE( & STRESS, & STRAIN, & STATEV) REAL*8 STRESS(*) REAL*8 STRAIN(*) REAL*8 STATEV(*) END

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.

PROPS(1) = YOUNGS_MODULUS PROPS(2) = POISSON_RATIO PROPS(3) = YIELD_STRESS PROPS(4) = HARDENING_MODULUS

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.

INTEGER I_E INTEGER I_NU INTEGER I_YIELD I_E = 1 I_NU = 2 I_YIELD = 3 E = PROPS(I_E) NU = PROPS(I_NU) YIELD = PROPS(I_YIELD)

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.

FIELD(1) = TEMPERATURE_FACTOR FIELD(2) = MOISTURE_FACTOR FIELD(3) = AGE_FACTOR

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.

DO I = 1, NCOMP VECTOR(I) = VECTOR(I) * SCALE END DO

This avoids repeating the same expression for every component.

Nested Loops Over Matrices

DO I = 1, N DO J = 1, N C(I,J) = A(I,J) + B(I,J) END DO END DO

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.

Δt = tcurrent − tprevious

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.

FLUX = BASE_FLUX IF (X .GT. X_LIMIT) THEN FLUX = HIGH_FLUX END IF

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.

COORD(1) = X COORD(2) = Y COORD(3) = Z

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.

INITIAL_STRESS(1) = S11 INITIAL_STRESS(2) = S22 INITIAL_STRESS(3) = S33

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.

CALL UPDATE_STRESS( & STRAIN, & PROPS, & STATEV, & STRESS)

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.

! ------------------------------------------------ ! STATE VARIABLES ! STATEV(1) = Plastic strain ! STATEV(2) = Damage ! STATEV(3) = Hardening ! STATEV(4) = Internal variable ! ------------------------------------------------

Use Named Constants for Indices

Named indices can make a large implementation much easier to maintain.

INTEGER I_PLASTIC INTEGER I_DAMAGE INTEGER I_HARDENING I_PLASTIC = 1 I_DAMAGE = 2 I_HARDENING = 3 PLASTIC = STATEV(I_PLASTIC) DAMAGE = STATEV(I_DAMAGE)

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.

CURRENT_TIME AMPLITUDE_VALUE AMPLITUDE_INCREMENT

Data Type Consistency

Mixing incompatible data types can lead to subtle numerical problems.

REAL*8 A REAL*8 B REAL*8 RESULT A = 1.0D0 B = 2.0D0 RESULT = A + B

Keep the numerical types consistent throughout calculations wherever appropriate.

Integer vs Real Division

Programmers should understand the difference between integer and floating-point arithmetic.

INTEGER I INTEGER N I = 1 N = 2 ! Be careful with integer arithmetic. REAL*8 R R = DBLE(I) / DBLE(N)

Explicit conversion can make the intended numerical behaviour clearer.

Copying Arrays

Arrays can be copied directly when appropriate.

A = B

However, unnecessary copying inside a frequently called routine can increase computational cost.

Temporary Arrays

Temporary arrays can make complicated calculations easier to understand.

REAL*8 TRIAL_STRESS(6) REAL*8 CORRECTION(6) DO I = 1, 6 TRIAL_STRESS(I) = STRESS(I) CORRECTION(I) = 0.0D0 END DO

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.

DOT_PRODUCT = 0.0D0 DO I = 1, N DOT_PRODUCT = DOT_PRODUCT & + A(I) * B(I) END DO

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

STATE_OLD = STATEV(1) ! Calculate updated state STATE_NEW = STATE_OLD + INCREMENT STATEV(1) = STATE_NEW

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:

WRITE(*,*) 'STATEV(1) = ', STATEV(1) WRITE(*,*) 'STRESS(1) = ', STRESS(1) WRITE(*,*) 'TEMP = ', TEMPERATURE

Diagnostic output should be used selectively because Abaqus may call a user routine many times.

Organising a Large User Subroutine

Abaqus interface ↓ Read arguments ↓ Assign meaningful local variables ↓ Prepare arrays ↓ Run engineering calculation ↓ Update state variables ↓ Assign output arrays ↓ Return to Abaqus

Separate Physical Meaning From Array Indices

Avoid writing large sections of code filled with unexplained indices.

! Less readable VALUE = STATEV(7) ! More readable DAMAGE = STATEV(I_DAMAGE)

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

  1. Identify every quantity supplied by Abaqus.
  2. Identify its data type.
  3. Identify its dimensions.
  4. Document its physical meaning.
  5. Assign clear local variable names where useful.
  6. Perform the calculation.
  7. Update state or output arrays.
  8. 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

  1. Every variable has a clear data type.
  2. Arrays have clearly defined dimensions.
  3. Array indices are within valid ranges.
  4. State-variable locations are documented.
  5. Material-property locations are documented.
  6. Field-variable locations are documented.
  7. Previous and updated values are distinguished.
  8. Temporary arrays are initialised.
  9. Matrix dimensions are checked.
  10. Numerical precision is appropriate.
  11. The Abaqus interface is followed exactly.
  12. 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.

Best practice:

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.