Commit 1eb05d1e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Remove CDI function zaxisInqPsName().

parent 9479c21d
......@@ -575,9 +575,8 @@ void printZaxisInfo(int vlistID)
if ( zaxistype == ZAXIS_HYBRID )
{
char psname[CDI_MAX_NAME];
psname[0] = 0;
zaxisInqPsName(zaxisID, psname);
char psname[CDI_MAX_NAME]; psname[0] = 0;
cdiZaxisInqKeyStr(zaxisID, CDI_KEY_PSNAME, CDI_MAX_NAME, psname);
int vctsize = zaxisInqVctSize(zaxisID);
if ( vctsize || psname[0] )
{
......
......@@ -1013,9 +1013,6 @@ void zaxisInqUnits(int zaxisID, char *units);
/* zaxisInqStdname: Get the standard name of a Z-axis */
void zaxisInqStdname(int zaxisID, char *stdname);
/* zaxisInqPsName: Get the name of the surface pressure variable of a hybrid sigma pressure Z-axis */
void zaxisInqPsName(int zaxisID, char *psname);
void zaxisDefPrec(int zaxisID, int prec);
int zaxisInqPrec(int zaxisID);
......
......@@ -2841,7 +2841,7 @@ void cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
}
if ( zaxisType == ZAXIS_HYBRID && psvarid != -1 )
cdiZaxisDefKeyStr(ncvar->zaxisID, CDI_KEY_PSNAME, strlen(ncvars[psvarid].name), ncvars[psvarid].name);
cdiZaxisDefKeyStr(ncvar->zaxisID, CDI_KEY_PSNAME, strlen(ncvars[psvarid].name)+1, ncvars[psvarid].name);
if ( positive > 0 ) zaxisDefPositive(ncvar->zaxisID, positive);
if ( is_scalar ) zaxisDefScalar(ncvar->zaxisID);
......
......@@ -1586,9 +1586,8 @@ void cdf_def_zaxis_hybrid_echam(stream_t *streamptr, int type, int ncvarid, int
static
void cdf_def_zaxis_hybrid_cf(stream_t *streamptr, int type, int ncvarid, int zaxisID, int zaxisindex, int xtype, size_t dimlen, int *dimID, char *axisname)
{
char psname[CDI_MAX_NAME];
psname[0] = 0;
zaxisInqPsName(zaxisID, psname);
char psname[CDI_MAX_NAME]; psname[0] = 0;
cdiZaxisInqKeyStr(zaxisID, CDI_KEY_PSNAME, CDI_MAX_NAME, psname);
if ( psname[0] == 0 ) strcpy(psname, "ps");
int fileID = streamptr->fileID;
......
......@@ -355,17 +355,19 @@ 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-1;
if ( len > CDI_MAX_NAME ) len = CDI_MAX_NAME;
strncpy(zaxisstrname, name, len);
zaxisstrname[len] = 0;
zaxisstrname[len-1] = 0;
}
static inline
void zaxisGetString(char *name, const char *zaxisstrname, size_t len)
{
if ( len >= CDI_MAX_NAME ) len = CDI_MAX_NAME-1;
strncpy(name, zaxisstrname, len);
name[len] = 0;
size_t slen = strlen(zaxisstrname)+1;
if ( slen > len ) slen = len;
if ( slen > CDI_MAX_NAME ) slen = CDI_MAX_NAME;
strncpy(name, zaxisstrname, slen);
name[slen-1] = 0;
}
static
......@@ -606,13 +608,6 @@ void zaxisInqStdname(int zaxisID, char *stdname)
}
void zaxisInqPsName(int zaxisID, char *psname)
{
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID);
strcpy(psname, zaxisptr->psname);
}
void zaxisDefPrec(int zaxisID, int prec)
{
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID);
......
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