2.7. 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.

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:  ANSYS Exit Codes

CodeExplanationCodeExplanation
0Normal Exit14XOX Error
1Stack Error15Fatal Error
2Stack Error16Possible Full Disk
3Stack Error17Possible Corrupted or Missing File
4Stack Error18Possible Corrupted DB File
5Command Line Argument Error21Authorized Code Section Entered
6Accounting File Error25Unable to Open X11 Server
7Auth File Verification Error30Quit Signal
8Error in ANSYS or End-of-run31Failure to Get Signal
11User Routine Error>32System-dependent Error
12Macro STOP Command  


Release 18.2 - © ANSYS, Inc. All rights reserved.