Menu

[r7408]: / trunk / toolkits / natgrid / src / nnerror.c  Maximize  Restore  History

Download this file

145 lines (105 with data), 3.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#include <stdio.h>
#include <stdlib.h>
#define MAX_ERROR 31
void ErrorLog(int, char *, FILE *, char *);
char *ErrMsg(int);
extern int error_status;
void ErrorHnd(int error, char *func, FILE *efile, char *smsg)
{
ErrorLog(error, func, efile, smsg);
}
void ErrorLog(int error, char *func, FILE *efile, char *smsg)
{
if ( (error == 4) || (error == 5) || (error == 6 || error == 28) )
{
fprintf(efile, "natgrid - warning number %d from %s:\n %s",
error, func, ErrMsg(error));
error_status = 0;
}
else
{
fprintf(efile, "natgrid - error number %d from %s:\n %s",
error, func, ErrMsg(error));
error_status = error;
}
fprintf(efile,"%s",smsg);
}
char *ErrMsg(int i)
{
char *rlist;
const char *err_list[MAX_ERROR] = {
/* #001 */
"Insufficient data in gridded region to triangulate.",
/* #002 */
"Duplicate input data coordinates are not allowed.",
/* #003 */
"Unable to open file for writing algorithmic data.",
/* #004 */
"WARNING: The ratio of vertical to horizontal scales is too large for \n meaningful gradient estimation. Rescale the data if gradients are required.",
/* #005 */
"WARNING: The ratio of vertical to horizontal scales is too small for\n meaningful gradient estimation. Rescale the data if gradients are required.",
/* #006 */
"WARNING: The ratio of x-axis breadth to y-axis breadth of this gridded \n region may be too extreme for good interpolation. Changing the block \n proportions, or rescaling the x or y coordinate may be indicated.\n Gradient calculations have been disabled.",
/* #007 */
"Unable to allocate storage for ivector.",
/* #008 */
"Unable to allocate storage for dvector.",
/* #009 */
"Unable to allocate storage for **imatrix.",
/* #010 */
"Unable to allocate storage for imatrix[].",
/* #011 */
"Unable to allocate storage for **fmatrix.",
/* #012 */
"Unable to allocate storage for fmatrix[].",
/* #013 */
"Unable to allocate storage for **dmatrix.",
/* #014 */
"Unable to allocate storage for dmatrix[].",
/* #015 */
"Unable to allocate storage for raw data.",
/* #016 */
"Unable to allocate storage for a simplex.",
/* #017 */
"Unable to allocate storage for temp.",
/* #018 */
"Unable to allocate storage for neig.",
/* #019 */
"Slopes have not been computed, set sdi.",
/* #020 */
"Row argument out of range.",
/* #021 */
"Column argument out of range.",
/* #022 */
"Aspects have not been computed, set sdi.",
/* #023 */
"Parameter name not known.",
/* #024 */
"Cannot open error file.",
/* #025 */
"Automatic scaling has been done - aspects will be distorted and \n consequently are not returned. Rescale your data manually, or \n by setting magx, magy, and magz appropriately.",
/* #026 */
"Automatic scaling has been done - slopes will be distorted and \n consequently are not returned. Rescale your data manually, or \n by setting magx, magy, and magz appropriately.",
/* #027 */
"Coordinate is outside of the gridded region for a single point interpolation.",
/* #028 */
"Cannot compute aspects and slopes in conjunction with single point \n interpolation mode.",
/* #029 */
"Fortran DOUBLE PRECISION entries are not supported on UNICOS.",
/* #030 */
"Error number out of range."
/* #031 */
"Weights can be returned only for linear interpolation when in \n single point mode."
};
if (i >= MAX_ERROR) {
rlist = (char *) err_list[29];
}
else {
rlist = (char *) err_list[i-1];
}
return (rlist);
}
int ErrMax()
{
return(MAX_ERROR);
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.