ST1ERR
Fortran |
ST1ERR(IERR, SUBR, MESS) |
|
---|---|---|
C-interface |
tq_st1err(TC_INT ierr,TC_STRING subr,TC_STRING mess); |
|
Full name: |
Set Error Code and Give Message. |
|
Purpose: |
This is called when an error that cannot be handled by the current program unit occurs. The error message is printed on the error unit but also saved internally in the error handling package. The program unit should return to the calling program. |
|
Comments: |
The error-handling routines are those defined by SGTE for use in the thermodynamic model package. Note that the error-handling is constructed in such a way that when a subroutine detects an error it cannot handle, it should first call an ST* subroutine to set an appropriate error code and then return to the calling subroutine. In that subroutine the error code should be tested, and possibly that subroutine can correct the error and proceed, otherwise it should return to its calling subroutine and so on, until either the error is corrected or the top level of the program is reached.In this way it is possible to design a program where minor problems at a low level do not cause program to terminate. Instead, the error is passed up to a higher level where it can be corrected or ignored. The normal subroutines to use are ST2ERR to set the error code and SG2ERR to check it. The other subroutines are less used. The TQ subroutines normally do not clear the error code when called. An error set in an earlier subroutine but not tested and detected after that call may cause strange error messages later on. This should be used only for fatal or almost fatal errors. |
|
Arguments |
||
Name |
Type |
Value set on call or returned |
IERR |
Integer |
Set to an error code. |
SUBR |
Character*6 |
Set to the current subroutine name. |
MESS |
Character*72 |
Set to the error message to be printed |

Note the following conventions to distinguish between the programming languages.
- Routines starting with TQXXX, for example, TQGDAT, are in the Fortran interface
- Routines starting with tq_xxxx, for example tq_gdat, are in the C-interface.
- In Fortran, all routines are subroutines and do not return any values except where explicitly declared as functions.
- All the C procedures are declared as void and do not return any values except where explicitly otherwise declared.
An example of how to read the subroutine definitions.