Commit 44e003ba authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Replaced zaxisDefUUID/zaxisInqUUID() by cdiDefKeyBytes()/cdiInqKeyBytes() with CDI_KEY_UUID.

parent 01fa2d30
......@@ -26,5 +26,7 @@ zaxisInqYunits(zaxisID, yunits) -> cdiInqKeyString(zaxisID, CDI_GLOBAL, CD
zaxisDefNumber(zaxisID, number) -> cdiDefKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_NUMBEROFVGRIDUSED, number)
zaxisInqNumber(zaxisID) -> cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_NUMBEROFVGRIDUSED, &number)
zaxisDefNlevRef(zaxisID, nlev) -> cdiDefKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_NLEV, nlev)
zaxisDefNlevRef(zaxisID, nlev) -> cdiDefKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_NLEV, nlev)
zaxisInqNlevRef(zaxisID) -> cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_NLEV, &nlev)
zaxisDefUUID(zaxisID, uuidOfVGrid) -> cdiDefKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuidOfVGrid, length)
zaxisInqUUID(zaxisID) -> cdiInqKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuidOfVGrid, &length)
......@@ -320,7 +320,12 @@ int cdiFallbackIterator_zaxisUuid(CdiIterator *super, int *outVgridNumber, int *
*outLevelCount = 0;
cdiInqKeyInt(zaxisId, CDI_GLOBAL, CDI_KEY_NLEV, outLevelCount);
}
if (outUuid) zaxisInqUUID(zaxisId, outUuid);
if (outUuid)
{
int length = CDI_UUID_SIZE;
memset(outUuid, 0, length);
cdiInqKeyBytes(zaxisId, CDI_GLOBAL, CDI_KEY_UUID, outUuid, &length);
}
return CDI_NOERR;
}
......
......@@ -2978,7 +2978,7 @@ 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 ( uuidOfVGrid[0] != 0 )
zaxisDefUUID(zaxisID, uuidOfVGrid);
cdiDefKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuidOfVGrid, CDI_UUID_SIZE);
if ( zaxisType == ZAXIS_HYBRID )
{
......
......@@ -1380,8 +1380,9 @@ static
void cdfDefZaxisUUID(stream_t *streamptr, int zaxisID)
{
unsigned char uuidOfVGrid[CDI_UUID_SIZE];
zaxisInqUUID(zaxisID, uuidOfVGrid);
int length = CDI_UUID_SIZE;
memset(uuidOfVGrid, 0, length);
cdiInqKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuidOfVGrid, &length);
if ( uuidOfVGrid[0] != 0 )
{
char uuidOfVGridStr[37];
......
......@@ -2596,8 +2596,10 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_NLEV, &nlev);
GRIB_CHECK(my_grib_set_long(gh, "nlev", nlev), 0);
unsigned char uuid[CDI_UUID_SIZE];
int length = CDI_UUID_SIZE;
memset(uuid, 0, length);
cdiInqKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuid, &length);
size_t len = CDI_UUID_SIZE;
zaxisInqUUID(zaxisID, uuid);
if ( grib_set_bytes(gh, "uuidOfVGrid", uuid, &len) != 0 ) Warning("Can't write UUID!");
}
......
......@@ -700,7 +700,7 @@ void cdi_generate_vars(stream_t *streamptr)
{
if ( numberOfVerticalLevels > 0 ) cdiDefKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_NLEV, numberOfVerticalLevels);
if ( numberOfVerticalGrid > 0 ) cdiDefKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_NUMBEROFVGRIDUSED, numberOfVerticalGrid);
if ( !cdiUUIDIsNull(uuidVGrid) ) zaxisDefUUID(zaxisID, uuidVGrid);
if ( !cdiUUIDIsNull(uuidVGrid) ) cdiDefKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuidVGrid, CDI_UUID_SIZE);
}
if ( lbounds ) Free(dlevels1);
......
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