Commit 9479c21d authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Remove CDI function zaxisDefPsName().

parent d556e1ba
......@@ -788,6 +788,7 @@ int gridInqYvals(int gridID, double yvals[]);
#define CDI_KEY_DIMNAME 942 // Z-axis dimension name
#define CDI_KEY_LONGNAME 943 // Z-axis longname
#define CDI_KEY_UNITS 944 // Z-axis units
#define CDI_KEY_PSNAME 950 // Z-axis surface pressure name
// cdiGridDefKeyStr: Define a CDI grid string value from a key
int cdiGridDefKeyStr(int gridID, int key, int size, const char *mesg);
......@@ -1012,9 +1013,6 @@ void zaxisInqUnits(int zaxisID, char *units);
/* zaxisInqStdname: Get the standard name of a Z-axis */
void zaxisInqStdname(int zaxisID, char *stdname);
/* zaxisDefPsName: Define the name of the surface pressure variable of a hybrid sigma pressure Z-axis */
void zaxisDefPsName(int zaxisID, const char *psname_optional);
/* zaxisInqPsName: Get the name of the surface pressure variable of a hybrid sigma pressure Z-axis */
void zaxisInqPsName(int zaxisID, char *psname);
......
......@@ -2840,7 +2840,8 @@ void cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
zaxisDefUUID(ncvar->zaxisID, uuidOfVGrid);
}
if ( zaxisType == ZAXIS_HYBRID && psvarid != -1 ) zaxisDefPsName(ncvar->zaxisID, ncvars[psvarid].name);
if ( zaxisType == ZAXIS_HYBRID && psvarid != -1 )
cdiZaxisDefKeyStr(ncvar->zaxisID, CDI_KEY_PSNAME, strlen(ncvars[psvarid].name), ncvars[psvarid].name);
if ( positive > 0 ) zaxisDefPositive(ncvar->zaxisID, positive);
if ( is_scalar ) zaxisDefScalar(ncvar->zaxisID);
......
......@@ -355,17 +355,17 @@ void zaxisName(int zaxistype, char *zaxisname)
static inline
void zaxisSetString(char *zaxisstrname, const char *name, size_t len)
{
if ( len > CDI_MAX_NAME ) len = CDI_MAX_NAME;
if ( len >= CDI_MAX_NAME ) len = CDI_MAX_NAME-1;
strncpy(zaxisstrname, name, len);
zaxisstrname[len - 1] = 0;
zaxisstrname[len] = 0;
}
static inline
void zaxisGetString(char *name, const char *zaxisstrname, size_t len)
{
if ( len > CDI_MAX_NAME ) len = CDI_MAX_NAME;
if ( len >= CDI_MAX_NAME ) len = CDI_MAX_NAME-1;
strncpy(name, zaxisstrname, len);
name[len - 1] = 0;
name[len] = 0;
}
static
......@@ -380,6 +380,7 @@ void *zaxis_key_to_ptr(zaxis_t *zaxisptr, int key)
case CDI_KEY_UNITS: keyptr = (void*)zaxisptr->units; break;
case CDI_KEY_DIMNAME: keyptr = (void*)zaxisptr->dimname; break;
case CDI_KEY_VDIMNAME: keyptr = (void*)zaxisptr->vdimname; break;
case CDI_KEY_PSNAME: keyptr = (void*)zaxisptr->psname; break;
}
return keyptr;
......@@ -519,18 +520,6 @@ void zaxisDefUnits(int zaxisID, const char *units)
(void)cdiZaxisDefKeyStr(zaxisID, CDI_KEY_UNITS, CDI_MAX_NAME, units);
}
void zaxisDefPsName(int zaxisID, const char *psname)
{
if ( psname )
{
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID);
strncpy(zaxisptr->psname, psname, CDI_MAX_NAME - 1);
zaxisptr->name[CDI_MAX_NAME - 1] = '\0';
reshSetStatus(zaxisID, &zaxisOps, RESH_DESYNC_IN_USE);
}
}
/*
@Function zaxisInqName
@Title Get the name of a Z-axis
......
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