Commit 0a0bebda authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Moved declaration of zaxisInqLevelsPtr to zaxis.h.

parent f235cce1
......@@ -1031,7 +1031,6 @@ int zaxisInqScalar(int zaxisID);
void zaxisDefLtype(int zaxisID, int ltype);
int zaxisInqLtype(int zaxisID);
const double *zaxisInqLevelsPtr(int zaxisID);
void zaxisDefVct(int zaxisID, int size, const double vct[]);
void zaxisInqVct(int zaxisID, double vct[]);
int zaxisInqVctSize(int zaxisID);
......
......@@ -1473,8 +1473,8 @@ void gridDefMaskGME(int gridID, const int *mask)
}
static int
gridInqXValsSerial(grid_t *gridptr, double *xvals)
static
int gridInqXValsSerial(grid_t *gridptr, double *xvals)
{
long size;
if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
......@@ -1528,8 +1528,8 @@ int gridInqXvals(int gridID, double *xvals)
}
static void
gridDefXValsSerial(grid_t *gridptr, const double *xvals)
static
void gridDefXValsSerial(grid_t *gridptr, const double *xvals)
{
int gridtype = gridptr->type;
......@@ -1572,13 +1572,12 @@ void gridDefXvals(int gridID, const double *xvals)
gridMark4Update(gridID);
}
static int
gridInqYValsSerial(grid_t *gridptr, double *yvals)
static
int gridInqYValsSerial(grid_t *gridptr, double *yvals)
{
int gridtype = gridptr->type;
long size
= (gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED)
? gridptr->size : gridptr->y.size;
long size = (gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED)
? gridptr->size : gridptr->y.size;
if ( CDI_Debug && size == 0 )
Warning("size undefined for gridID = %d!", gridptr->self);
......@@ -1623,18 +1622,17 @@ int gridInqYvals(int gridID, double *yvals)
return gridptr->vtable->inqYVals(gridptr, yvals);
}
static void
gridDefYValsSerial(grid_t *gridptr, const double *yvals)
static
void gridDefYValsSerial(grid_t *gridptr, const double *yvals)
{
int gridtype = gridptr->type;
long size
= (gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED)
? gridptr->size : gridptr->y.size;
long size = (gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED)
? gridptr->size : gridptr->y.size;
if ( size == 0 )
Error("Size undefined for gridID = %d!", gridptr->self);
if (gridptr->y.vals && CDI_Debug)
if ( gridptr->y.vals && CDI_Debug )
Warning("Values already defined!");
gridptr->y.vals = (double *)Realloc(gridptr->y.vals, (size_t)size * sizeof (double));
......
......@@ -864,29 +864,31 @@ void varDefZAxisReference(int nhlev, int nvgrid, unsigned char uuid[CDI_UUID_SIZ
int zaxisCompare(int zaxisID, int zaxistype, int nlevels, int lbounds, const double *levels, const char *longname, const char *units, int ltype1)
{
int differ = 1;
int levelID;
int zlbounds = 0;
int ltype_is_equal = FALSE;
bool ltype_is_equal = false;
if ( ltype1 == zaxisInqLtype(zaxisID) ) ltype_is_equal = TRUE;
if ( ltype1 == zaxisInqLtype(zaxisID) ) ltype_is_equal = true;
if ( ltype_is_equal && (zaxistype == zaxisInqType(zaxisID) || zaxistype == ZAXIS_GENERIC) )
{
if ( zaxisInqLbounds(zaxisID, NULL) > 0 ) zlbounds = 1;
if ( nlevels == zaxisInqSize(zaxisID) && zlbounds == lbounds )
{
const double *dlevels;
char zlongname[CDI_MAX_NAME];
char zunits[CDI_MAX_NAME];
dlevels = zaxisInqLevelsPtr(zaxisID);
for ( levelID = 0; levelID < nlevels; levelID++ )
{
if ( fabs(dlevels[levelID] - levels[levelID]) > 1.e-9 )
break;
}
const double *dlevels = zaxisInqLevelsPtr(zaxisID);
if ( dlevels )
{
int levelID;
for ( levelID = 0; levelID < nlevels; levelID++ )
{
if ( fabs(dlevels[levelID] - levels[levelID]) > 1.e-9 )
break;
}
if ( levelID == nlevels ) differ = 0;
if ( levelID == nlevels ) differ = 0;
}
if ( ! differ )
{
......
......@@ -1300,13 +1300,12 @@ int zaxisDuplicate(int zaxisID)
}
static void zaxisPrintKernel ( zaxis_t * zaxisptr, int index, FILE * fp )
static
void zaxisPrintKernel(zaxis_t *zaxisptr, int index, FILE *fp)
{
unsigned char uuid[CDI_UUID_SIZE];
int levelID;
int nbyte;
xassert ( zaxisptr );
xassert(zaxisptr);
int zaxisID = zaxisptr->self;
......@@ -1332,8 +1331,8 @@ static void zaxisPrintKernel ( zaxis_t * zaxisptr, int index, FILE * fp )
if ( zaxisptr->units[0] ) fprintf(fp, "units = %s\n", zaxisptr->units);
nbyte0 = fprintf(fp, "levels = ");
nbyte = nbyte0;
for ( levelID = 0; levelID < nlevels; levelID++ )
int nbyte = nbyte0;
for ( int levelID = 0; levelID < nlevels; levelID++ )
{
if ( nbyte > 80 )
{
......@@ -1349,7 +1348,7 @@ static void zaxisPrintKernel ( zaxis_t * zaxisptr, int index, FILE * fp )
{
nbyte0 = fprintf(fp, "lbounds = ");
nbyte = nbyte0;
for ( levelID = 0; levelID < nlevels; levelID++ )
for ( int levelID = 0; levelID < nlevels; levelID++ )
{
if ( nbyte > 80 )
{
......@@ -1363,7 +1362,7 @@ static void zaxisPrintKernel ( zaxis_t * zaxisptr, int index, FILE * fp )
nbyte0 = fprintf(fp, "ubounds = ");
nbyte = nbyte0;
for ( levelID = 0; levelID < nlevels; levelID++ )
for ( int levelID = 0; levelID < nlevels; levelID++ )
{
if ( nbyte > 80 )
{
......
......@@ -18,6 +18,8 @@ const resOps *getZaxisOps(void);
const char *zaxisInqNamePtr(int zaxisID);
const double *zaxisInqLevelsPtr(int zaxisID);
#endif
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment