2.8. Running Mechanical APDL as a Subroutine

To call the Mechanical APDL program, use the following:

program ansys

For multiple calls to subroutine ansys, you must open and close standard input in the calling subroutine. (Usually, input and output are FORTRAN units 5 and 6, respectively.) The calling subroutine cannot use the database access subroutines; however, other user-programmable features can use the database access subroutines freely.

2.8.1. Mechanical APDL Exit Codes

There may be times when Mechanical APDL exits abnormally. Check the file.err file to see if Mechanical APDL wrote an exit code to the file before ending. These error codes may help you to understand what caused the abnormal program exit:

Table 2.1: Mechanical APDL Exit Codes

CodeExplanation
0Normal exit
1Indicated error
5Command line argument error
7Licensing failure
8End of run
11Error in user routine
12Macro stop command
14Untrapped geometry kernel error
15Fatal error
16Possible full disk
17Possible corrupted or missing file
18Possible corrupted database
21Unauthorized feature accessed
25Unable to open x11 server
30Quit signal
31Failure to get signal in max time
33Crash signal (bus error, seg vi, FPE, etc.)
35Fatal error on another MPI process (DMP)
100Job already running (.lock file error)
134[a]Job aborted by the program.
137[b]Job killed by user or operating system.

[a] This exit code, specifically for Linux, occurs when the program aborts the job. An unexpected error may be the cause, and sending the data leading to the unexpected abort to your technical support provider can enable ANSYS, Inc. to improve the program.

[b] This exit code, specifically for Linux, occurs when either the user or the OS kills the job. The OS may kill the simulation process(es) if the simulation consumes too much memory, and thus reducing the model size or running on a system with more RAM may achieve a successfully completed simulation.