Conventions, Requirements and Types
Subroutine Conventions
Throughout the help, the following type styles are used as visual cues:
This type of style: | Indicates: |
|---|
CONSUB | The subroutines that Adams recognizes. |
x | The argument in Adams subroutines. |
i | The type of value or types of parameters that are to follow the statement, command, or argument. A summary of these terms include: |
| i r c e v id x,y,z a,b,c | Integer Real Character string (alphanumeric) Function expression Varying type (integer, real or alphanumeric) Identifier Cartesian coordinate (real) Angular coordinate (real) |
PART | The underscored letters indicated the minimum allowable abbreviations of statements, commands, and arguments. |
{ } | That you are to make a selection from a series of items. |
[ ] | That you can optionally select an item. |
[[ ]] | That you can select any combination of the items. |
A | A two-dimensional matrix. |
a | A one-dimensional matrix. |
| A vector. |
| Unit vectors. |
Important: | Subroutine names are often modified by the compiling/linking process. Adams Solver looks at the final function names and tries to determine, if the subroutine was written in C or FORTRAN. How function names are modified is dependent on the compilers and the Operating System that are in use. A general rule that works across all platforms is this: ■FORTRAN: subroutine names should be upper case. For example, SFOSUB, GFOSUB and so on. ■C: subroutine names should be mixed case. For example, Sfosub, Gfosub and so on. |
System Requirements
To use subroutines, you need the system requirements outlined in the following sections.
Compilers and Linkers
To work with user-written subroutines you must have the appropriate compilers and linkers. For more information, refer to the hardware and software specifications included with your installation instructions, and on the
Adams Web site.
Languages
You can write user-written subroutines in any language, provided there is a way to call FORTRAN subroutines in that language. FORTRAN is the preferred language for writing user-written subroutines, although C and C++ are acceptable.
Debuggers
To facilitate the debugging of user-written subroutines, you should have a source-level debugger. Debuggers are not required when using your own subroutines with Adams Solver, but are useful for finding mistakes, such as improper syntax or logic, in your subroutines.
Types of Subroutines
The following sections introduce the three types of subroutines that Adams Solver provides:
About User-Written Subroutines
User-written subroutines are used primarily for modeling specialized phenomena or calculating nonstandard results. Many simulations require the modeling of special phenomena that are not a part of the standard Adams software. These phenomena may be expressed mathematically as differential equations, algebraic equations, applied forces, constraints, motion inputs to system, or a combination of these general modeling entities.
Adams Solver can accept user-specified descriptions of phenomena. You define the governing relationships for the phenomena in the user-written subroutines. Adams then evaluates these relationships as part of the solution process.
For more information about user-written subroutines and details about each of the user-written subroutines, see
User-Written Subroutines.
About Utility Subroutines
Utility subroutines are used for accessing current system state information. You typically use this information as input for defining phenomena or modeling elements that are not available as a part of standard Adams.
For more information about utility subroutines and details about each of the utility subroutines, see
Utility Subroutines.
About Callable Subroutines
MSC no longer supports callable subroutines. If you have questions on callable subroutines, please refer to: