### G Calculating Globally Unique Error Codes

Starlink facility error codes will normally be generated by the Starlink MESSGEN utility on UNIX (see SUN/185).

This section presents an alternative method for calculating compatible error status codes for subroutine libraries. In order to be used effectively, it requires a Fortran compiler capable of four byte integer representation. If this is not the case, then the status values generated will not be globally unique.

The error codes are calculated using the equation:

 $CODE\phantom{\rule{0.3em}{0ex}}=\phantom{\rule{0.3em}{0ex}}134250498\phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}+\phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}65536×\phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}+\phantom{\rule{0.3em}{0ex}}\phantom{\rule{0.3em}{0ex}}8×$ (1)

Here, $$ is the message number (in the range 1 to 4095) assigned to the error condition by the author of the subroutine library, and $$ is the facility number (in the range 1 to 2047) allocated to this subroutine library. Developers wishing to have facility numbers allocated to subroutine libraries should contact the Starlink Software Librarian (i.e. ussc@star.bnsc.rl.ac.uk).