Utility Subroutines

About Utility Subroutines

The utility subroutines provide all the functionality found in the dataset function expressions, and more. You use utility subroutines to perform operations such as the following:
Access data defined in a model.
Access current state information.
Interpolate through raw data using standard curve-fitting techniques.
Evaluate standard functions.
The utility subroutines are divided into the following categories:

Execution Control Subroutines

CONSUB is the only subroutine that can call execution control subroutines. In conjunction with ANALYS, DATOUT, and MODIFY, you can use CONSUB to control an Adams simulation.
ANALYS and MODIFY contain the FORTRAN equivalents of interactive commands to initiate analysis and to modify the Adams Solver dataset, respectively. DATOUT produces output from the simulation(s).
These subroutines are of most value if you want to run many simulations on a single dataset or on variations of that dataset.
 
Subroutine:
Does the following:
Performs an Adams analysis.
Outputs all data for the current time step into the specified output files.
Allows execution of any Adams Solver commands, except CONTROL and STOP.

Data Access Subroutines

The data access subroutines report the current values for system variables, or return static data stored in a model. User subroutines can use this data to define their output quantities.
The following table lists the names and definitions for the data access subroutines:
 
Subroutine:
Does the following:
Uses the Akima cubic-curve fitting method to interpolate data specified in a SPLINE statement.
Evaluates a BISTOP function.
Evaluates a Chebyshev polynomial.
Used to register a scalar measure
Uses the traditional cubic-curve fitting method to interpolate data specified in a SPLINE statement.
Allows user subroutines to output information/warning error messages.
Evaluates a Fourier cosine series.
Evaluates a Fourier sine series.
Retrieves the current CPU time.
Retrieves information as to whether the current Adams Solver command input mode is interactive or command file-driven.
Retrieves the type of integrator used for the current simulation.
Returns an integer variable that specifies the current analysis mode.
Retrieves the name of the active solver, either HARWELL or CALAHAN.
Retrieves the current simulation time.
Retrieves the current Adams Solver version number as it appears in the Adams Solver banner.
Accesses the double-precision numbers stored by an IC-type ARRAY statement.
Computes the compliance matrix for a set of markers in an Adams Solver model.
Evaluates a B-spline or user-written curve that a CURVE statement creates.
Accesses the character string that a STRING statement stores.
Accesses model unit information from Adams Solver.
Evaluates a haversine function.
Provides a simple contact model.
Converts a number in an integer variable to the characters representing that number. The character data in ISTRNG is always left justified. Unused space in ISTRNG is padded with blanks.
Accesses the original mode numbers and the modal frequencies, in Hertz, of all active modes associated with a FLEX_BODY statement.
Accesses the number of modal generalized coordinates associated with a FLEX_BODY statement.
Evaluates a polynomial function.
Passes Adams Solver the x, y, and z data that defines a SPLINE element.
Converts rotational coordinates from one representation to another.
Converts a double-precision variable to a character string.
Evaluates a simple harmonic function.
Approximates a STEP function with a cubic polynomial.
Approximates a STEP5 function with a quintic polynomial.
Provides system-state values, such as displacement and velocity, to your subroutines, and defines and stores the Adams Solver state variables on which the system states are dependent.
Provides a single-system state value, such as displacement or velocity, to your subroutines, and defines and stores the Adams Solver state variables on which the system state is dependent.
Allows you to supply the analytical partial derivatives of a subroutine with respect to values measured through SYSFNC and SYSARY.
Converts translational coordinates from one type of coordinate system to another.
Returns the simulation time corresponding to the last successful simulation step.
Used with UCOSUB, tells Adams Solver which of the principal axes coordinates are used in the user-defined constraint.
Allows you to output messages for information or for documenting errors that occur in user-written subroutines.

Serialization Subroutines

The serialization subroutines are used as an alternative to the SAVSUB and RELSUB user subroutines to save and restore static data, stored in user subroutines, when issuing SAVE/RELOAD commands. During executing Save and Reload command Adams Solver calls all user subroutines with IFAG=7, and IFLAG=9 respectively. Through branching on the IFLAG values your user subroutines can save and restore data.
 
Subroutine:
Does the following:
Uses to serialize character data.
Uses to serialize double-precision data.
Uses to serialize integer data.
Uses to un-serialize character data.
Uses to un-serialize double-precision data.
Uses to un-serialize integer data.

Unsupported Subroutines

Although Adams Solver continues to recognize unsupported subroutines, new subroutines have made them obsolete. The new subroutines are more flexible and straightforward to use. We recommend that you use the new subroutines, as the unsupported ones might be removed from future Adams Solver releases.
The following table lists the unsupported subroutines, along with references to alternate subroutines:
Unsupported Subroutines and Their Alternates
 
Instead of:
Use:
DEQINF
FNCDEP
INFO
SPLINE
ANLMOD