Commit 1420aab3 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Removed unneeded function gridInqXnamePtr()/gridInqYnamePtr().

parent 0e736ff3
......@@ -849,12 +849,6 @@ void gridInqXname(int gridID, char *xname)
(void)cdiGridInqKeyStr(gridID, CDI_KEY_XNAME, CDI_MAX_NAME, xname);
}
const char *gridInqXnamePtr(int gridID)
{
grid_t *gridptr = gridID2Ptr(gridID);
return gridptr->x.name;
}
/*
@Function gridInqXlongname
@Title Get the longname of a X-axis
......@@ -937,12 +931,6 @@ void gridInqYname(int gridID, char *yname)
(void)cdiGridInqKeyStr(gridID, CDI_KEY_YNAME, CDI_MAX_NAME, yname);
}
const char *gridInqYnamePtr(int gridID)
{
grid_t *gridptr = gridID2Ptr(gridID);
return gridptr->y.name;
}
/*
@Function gridInqYlongname
@Title Get the longname of a Y-axis
......
......@@ -152,9 +152,6 @@ const double *gridInqXboundsPtr(int gridID);
const double *gridInqYboundsPtr(int gridID);
const double *gridInqAreaPtr(int gridID);
const char *gridInqXnamePtr(int gridID);
const char *gridInqYnamePtr(int gridID);
const char *gridInqReferencePtr(int gridID);
int gridGenerate(const grid_t *grid);
......
......@@ -463,7 +463,6 @@ void cdfDefFC(stream_t *streamptr, int gridID, int gridindex)
static const struct cdfDefGridAxisInqs {
int (*axisSize)(int gridID);
void (*axisName)(int gridID, char *dimname);
const char *(*axisNamePtr)(int gridID);
void (*axisStdname)(int gridID, char *dimstdname);
void (*axisLongname)(int gridID, char *dimlongname);
void (*axisUnits)(int gridID, char *dimunits);
......@@ -473,7 +472,6 @@ static const struct cdfDefGridAxisInqs {
} gridInqsX = {
.axisSize = gridInqXsize,
.axisName = gridInqXname,
.axisNamePtr = gridInqXnamePtr,
.axisStdname = gridInqXstdname,
.axisLongname = gridInqXlongname,
.axisUnits = gridInqXunits,
......@@ -483,7 +481,6 @@ static const struct cdfDefGridAxisInqs {
}, gridInqsY = {
.axisSize = gridInqYsize,
.axisName = gridInqYname,
.axisNamePtr = gridInqYnamePtr,
.axisStdname = gridInqYstdname,
.axisLongname = gridInqYlongname,
.axisUnits = gridInqYunits,
......@@ -544,7 +541,8 @@ cdfDefTrajLatLon(stream_t *streamptr, int gridID, int gridindex,
int fileID = streamptr->fileID;
if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
const char *axisname = inqs->axisNamePtr(gridID);
char axisname[CDI_MAX_NAME];
inqs->axisName(gridID, axisname);
cdf_def_var(fileID, axisname, xtype, 1, &dimNcID, &ncvarid);
cdfPutGridStdAtts(fileID, ncvarid, gridID, inqs);
cdf_enddef(fileID);
......@@ -688,11 +686,6 @@ cdfDefAxisCommon(stream_t *streamptr, int gridID, int gridindex, int ndims,
nc_type xtype = (gridInqPrec(gridID) == DATATYPE_FLT32) ? NC_FLOAT : NC_DOUBLE;
ncgrid_t *ncgrid = streamptr->ncgrid;
const char *axisname = gridAxisInq->axisNamePtr(gridID);
size_t axisnameLen = strlen(axisname);
if ( axisname[0] == 0 ) Error("axis name undefined!");
for ( int index = 0; index < gridindex; ++index )
{
int gridID0 = ncgrid[index].gridID;
......@@ -725,6 +718,11 @@ cdfDefAxisCommon(stream_t *streamptr, int gridID, int gridindex, int ndims,
{
const double *pvals = gridAxisInq->axisValsPtr(gridID);
char axisname[CDI_MAX_NAME];
gridAxisInq->axisName(gridID, axisname);
if ( axisname[0] == 0 ) Error("axis name undefined!");
size_t axisnameLen = strlen(axisname);
/* enough to append _ plus up to 100 decimal and trailing \0 */
char extendedAxisname[axisnameLen + 4 + 1];
memcpy(extendedAxisname, axisname, axisnameLen + 1);
......
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