Commit a1106bb2 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added function zaxisDefPsName()/zaxisInqPsName()

parent 32bd4ec9
......@@ -971,6 +971,12 @@ 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);
void zaxisDefPrec(int zaxisID, int prec);
int zaxisInqPrec(int zaxisID);
......
......@@ -7021,9 +7021,9 @@ void define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nva
int zdimid = UNDEFID;
int zvarid = UNDEFID;
int zsize = 1;
int zaxisType;
double *lbounds = NULL;
double *ubounds = NULL;
int zaxisType;
positive = 0;
......@@ -7137,7 +7137,7 @@ void define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nva
zaxisDefUUID(ncvars[ncvarid].zaxisID, uuidOfVGrid);
}
// if ( zaxisType == ZAXIS_HYBRID && psvarID != -1 ) zaxisDefPsname(ncvars[ncvarid].zaxisID, ncvars[psvarid].name);
if ( zaxisType == ZAXIS_HYBRID && psvarid != -1 ) zaxisDefPsName(ncvars[ncvarid].zaxisID, ncvars[psvarid].name);
if ( positive > 0 ) zaxisDefPositive(ncvars[ncvarid].zaxisID, positive);
......
......@@ -68,6 +68,7 @@ typedef struct {
char longname[CDI_MAX_NAME];
char stdname[CDI_MAX_NAME];
char units[CDI_MAX_NAME];
char psname[CDI_MAX_NAME];
double *vals;
double *lbounds;
double *ubounds;
......@@ -87,7 +88,7 @@ typedef struct {
}
zaxis_t;
static int zaxisCompareP(zaxis_t *z1, zaxis_t *z2);
static int zaxisCompareP (zaxis_t *z1, zaxis_t *z2);
static void zaxisDestroyP ( void * zaxisptr );
static void zaxisPrintP ( void * zaxisptr, FILE * fp );
static int zaxisGetPackSize ( void * zaxisptr, void *context);
......@@ -138,6 +139,7 @@ void zaxisDefaultValue(zaxis_t *zaxisptr)
zaxisptr->longname[0] = 0;
zaxisptr->stdname[0] = 0;
zaxisptr->units[0] = 0;
zaxisptr->psname[0] = 0;
zaxisptr->vals = NULL;
zaxisptr->ubounds = NULL;
zaxisptr->lbounds = NULL;
......@@ -428,6 +430,19 @@ void zaxisDefUnits(int zaxisID, const char *units)
}
}
void zaxisDefPsName(int zaxisID, const char *psname)
{
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID);
if ( psname )
{
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
......@@ -511,6 +526,13 @@ 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);
......
Supports Markdown
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