Natgrid error handling


The error handling functions

Natgrid contains a set of procedures that implement a centralized error handling capability. The package invokes the C function ErrorHnd to produce all of its error messages. ErrorHnd simply invokes the ErrorLog function with the arguments specified in ErrorHnd. This allows a user to replace the error handling functionality by replacing or modifying the ErrorHnd function with one that handles errors in an application-dependent manner. All of the error handling functions are written in C; there is no way to replace the error handler using Fortran code.

Detailed description of the error functions

The error functions are:

ErrorHnd - Primary error handler

ErrorHnd simply invokes the ErrorLog function with the arguments specified in ErrorHnd. This allows a user to replace the error handling functionality by replacing or modifying the ErrorHnd function with one that handles errors in an application-dependent manner.

Function prototype:

  void ErrorHnd (int, char *, FILE *, char *);
Argument description:
---------------------------------
              Argument | Type   
---------------------------------
void ErrorHnd (error,  | int    
               func,   | char * 
               efile,  | FILE * 
               smsg);  | char * 
---------------------------------
error
The error number, as described in the error table.
func
A string specifying the function that is invoking the error call.
efile
Specifies the file where the error message will be written. By default, error messages are written to stderr.
smsg
The error message; this will usually be ErrMsg(i) where i is an error number.

ErrorLog - error logger

Function prototype:
  void ErrorLog (int, char *, FILE *, char *);
Argument description:
--------------------------------
              Argument | Type   
--------------------------------
void ErrorLog (error,  | int    
               func,   | char * 
               efile,  | FILE * 
               smsg);  | char * 
--------------------------------
error
The error number, as described in the error table.
func
A string specifying the function that is invoking the error call.
efile
Specifies the file where the error message will be written. By default error messages are written to stderr.
smsg
The error message; this will usually be ErrMsg(i) where i is an error number.

ErrMsg - retrieves error messages

Function prototype:
  char *ErrMsg(int i)
Return value:

ErrMsg returns the error message associated with its integer argument.

Argument description:

-----------------------------------
                  Argument | Type  
-----------------------------------
char *ErrMsg (error_num    | int
                       );  | 
-----------------------------------
error_num
An error number.

ErrMax - retrieves the number of possible error messages

Function prototype:
   int ErrMax()
Return value:

The value returned is the total number of possible error messages.

Error table

The following table lists all of the error numbers and the associated error messages:
----------------------------------------------------------------------------
 Error  |                     Error message
 number |    
----------------------------------------------------------------------------
    1   |  Insufficient data in gridded region to triangulate.
    2   |  Duplicate input data coordinates are not allowed.
    3   |  Unable to open file for writing algorithmic data.
    4   |  WARNING:  The ratio of vertical to horizontal scales is too 
        |    large for meaningful gradient estimation.  Rescale the data if 
        |    gradients are required.
    5   |  WARNING:  The ratio of vertical to horizontal scales is too small 
        |    for meaningful gradient estimation.  Rescale the data if gradients 
        |    are required.
    6   |  WARNING:  The ratio of x-axis breadth to y-axis breadth of this 
        |    gridded region may be too extreme for good interpolation.  
        |    Changing the block proportions, or rescaling the x or y 
        |    coordinate may be indicated.  Gradient calculations have been 
        |    disabled.
    7   |  Unable to allocate storage for ivector.
    8   |  Unable to allocate storage for dvector.
    9   |  Unable to allocate storage for **imatrix.
   10   |  Unable to allocate storage for imatrix[].
   11   |  Unable to allocate storage for **fmatrix.
   12   |  Unable to allocate storage for fmatrix[].
   13   |  Unable to allocate storage for **dmatrix.
   14   |  Unable to allocate storage for dmatrix[].
   15   |  Unable to allocate storage for raw data.
   16   |  Unable to allocate storage for a simplex.
   17   |  Unable to allocate storage for temp.
   18   |  Unable to allocate storage for neig.
   19   |  Slopes have not been computed, set sdip.
   20   |  Row argument out of range.
   21   |  Column argument out of range.
   22   |  Aspects have not been computed, set sdip.
   23   |  Parameter name not known.
   24   |  Cannot open error file.
   25   |  Automatic scaling has been done - aspects will be distorted and 
        |    consequently are not returned.  Rescale your data manually, or 
        |    by setting magx, magy, and magz appropriately.
   26   |  Automatic scaling has been done - slopes will be distorted and 
        |    consequently are not returned.  Rescale your data manually, or 
        |    by setting magx, magy, and magz appropriately.
   27   |  Coordinate is outside of the gridded region for a single 
        |    point interpolation.
   28   |  Cannot compute aspects and slopes in conjunction with single 
        |    point interpolation mode.
   29   |  Fortran DOUBLE PRECISION entries are not supported on UNICOS.
   30   |  Error number out of range.
----------------------------------------------------------------------------

home | contents | defs | params | procedures | exmpls | index