Commit 8b573756 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdfScanVarAttr: fix problem with standard_name attribute.

parent d51c5435
...@@ -2869,7 +2869,7 @@ static ...@@ -2869,7 +2869,7 @@ static
int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nvars, ncvar_t *ncvars, int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nvars, ncvar_t *ncvars,
size_t vctsize_echam, double *vct_echam, unsigned char *uuidOfVGrid) size_t vctsize_echam, double *vct_echam, unsigned char *uuidOfVGrid)
{ {
char *pname, *plongname, *punits; char *pname, *plongname, *punits, *pstdname;
size_t vctsize = vctsize_echam; size_t vctsize = vctsize_echam;
double *vct = vct_echam; double *vct = vct_echam;
...@@ -2930,6 +2930,7 @@ int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int ...@@ -2930,6 +2930,7 @@ int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
pname = ncvars[zvarid].name; pname = ncvars[zvarid].name;
plongname = ncvars[zvarid].longname; plongname = ncvars[zvarid].longname;
punits = ncvars[zvarid].units; punits = ncvars[zvarid].units;
pstdname = ncvars[zvarid].stdname;
if ( ncvars[zvarid].xtype == NC_FLOAT ) zdatatype = CDI_DATATYPE_FLT32; if ( ncvars[zvarid].xtype == NC_FLOAT ) zdatatype = CDI_DATATYPE_FLT32;
/* don't change the name !!! */ /* don't change the name !!! */
/* /*
...@@ -2992,6 +2993,7 @@ int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int ...@@ -2992,6 +2993,7 @@ int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
pname = (zdimid != CDI_UNDEFID) ? ncdims[zdimid].name : NULL; pname = (zdimid != CDI_UNDEFID) ? ncdims[zdimid].name : NULL;
plongname = NULL; plongname = NULL;
punits = NULL; punits = NULL;
pstdname = NULL;
if ( zsize == 1 && zdimid == CDI_UNDEFID ) if ( zsize == 1 && zdimid == CDI_UNDEFID )
{ {
...@@ -3017,8 +3019,8 @@ int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int ...@@ -3017,8 +3019,8 @@ int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
if ( CDI_cmor_mode && zsize == 1 && zaxisType != ZAXIS_HYBRID ) zaxisDefScalar(zaxisID); if ( CDI_cmor_mode && zsize == 1 && zaxisType != ZAXIS_HYBRID ) zaxisDefScalar(zaxisID);
if (ncvar->stdname[0]) if (pstdname && *pstdname)
cdiDefKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_STDNAME, (const unsigned char*)ncvar->stdname, (int)strlen(ncvar->stdname)+1); cdiDefKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_STDNAME, (const unsigned char*)pstdname, (int)strlen(pstdname)+1);
if ( uuidOfVGrid[0] != 0 ) if ( uuidOfVGrid[0] != 0 )
cdiDefKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuidOfVGrid, CDI_UUID_SIZE); cdiDefKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuidOfVGrid, CDI_UUID_SIZE);
......
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