Dsgrid Error handling


The error handling functions

Dsgrid contains a set of procedures that implement a centralized error handling capability. The package invokes the C function DSErrorHnd to produce all of its error messages. DSErrorHnd simply invokes the DSErrorLog function with the same arguments as DSErrorHnd. This allows a user to replace the error handling functionality by replacing or modifying the DSErrorHnd 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:

DSErrorHnd - Primary error handler

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

Function prototype:

  void DSErrorHnd (int, char *, FILE *, char *);
Argument description:
-----------------------------------
                Argument | Type   
-----------------------------------
void DSErrorHnd (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 DSErrMsg(i) where i is an error number.

DSErrorLog - error logger

Function prototype:
  void DSErrorLog (int, char *, FILE *, char *);
Argument description:
----------------------------------
                Argument | Type   
----------------------------------
void DSErrorLog (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 DSErrMsg(i) where i is an error number.

DSErrMsg - retrieves error messages

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

DSErrMsg returns the error message associated with its integer argument.

Argument description:

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

DSErrMax - retrieves the number of possible error messages

Function prototype:
   int DSErrMax()
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   |  Error number out of range.
    2   |  Insufficient data in gridded region to triangulate.
    3   |  Array dimension out of range.
    4   |  Parameter name not known.
    5   |  Cannot open error file.
    6   |  Error allocating memory for input points.
    7   |  Fortran DOUBLE PRECISION entries are not supported on UNICOS.
    9   |  Error allocating memory for array of distances between input points.
   10   |  Error allocating memory for weights.
   11   |  Error allocating memory for distance ordering vector.
   12   |  Error allocating memory for output array.
   13   |  Number of input points must be greater than 2.
   14   |  No original data values within the specified distance -
        |     interpolated value set to missing value flag.
----------------------------------------------------------------------------

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