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

Replaced zaxisDefUUID() by cdiDefKeyBytes().

parent 145465a2
......@@ -515,7 +515,8 @@ printZaxisReferenceInfo(const int zaxisID)
}
unsigned char uuidOfVGrid[CDI_UUID_SIZE];
zaxisInqUUID(zaxisID, uuidOfVGrid);
int length = CDI_UUID_SIZE;
cdiInqKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuidOfVGrid, &length);
if (!cdiUUIDIsNull(uuidOfVGrid))
{
char uuidOfVGridStr[37];
......
......@@ -15,7 +15,6 @@ int main(void)
double var1[nlon*nlat];
double var2[nlon*nlat*nlev];
// Create a grid reference
gridID = gridCreate(GRID_UNSTRUCTURED, nlon*nlat);
cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDUSED, 123);
......@@ -30,10 +29,11 @@ int main(void)
// zaxisID2 = zaxisCreate(ZAXIS_HEIGHT, nlev);
zaxisID2 = zaxisCreate(ZAXIS_REFERENCE, nlev);
zaxisDefLevels(zaxisID2, levs);
zaxisDefNlevRef(zaxisID2, nlev);
cdiDefKeyInt(zaxisID2, CDI_GLOBAL, CDI_KEY_NLEV, nlev);
cdiDefKeyInt(zaxisID2, CDI_GLOBAL, CDI_KEY_NUMBEROFVGRIDUSED, 71);
//zaxisDefReference(zaxisID2, "http://www.x.y/vgridfile.nc");
zaxisDefUUID(zaxisID2, "8765432112345678");
cdiDefKeyBytes(zaxisID2, CDI_GLOBAL, CDI_KEY_UUID, "8765432112345678", CDI_UUID_SIZE)
// Create a variable list
vlistID = vlistCreate();
......
......@@ -226,7 +226,7 @@ main(int argc, char *argv[])
/* add uuids to zaxis and grid */
{
unsigned char uuid[16];
unsigned char uuid[CDI_UUID_SIZE];
static char gridUUIDTxt[] = "107d7a5b-348c-4d1a-90a9-d745914f2fb6";
......@@ -241,7 +241,7 @@ main(int argc, char *argv[])
for (int i = 0; i < 2; ++i)
{
cdiStr2UUID(zaxisUUIDTxt[i], uuid);
zaxisDefUUID(zaxisID[i], uuid);
cdiDefKeyBytes(zaxisID[i], CDI_GLOBAL, CDI_KEY_UUID, uuid, CDI_UUID_SIZE)
}
}
......
......@@ -201,13 +201,13 @@ modelRun(struct model_config setup, MPI_Comm comm)
}
if (setup.create_uuid)
{
unsigned char uuid[16];
unsigned char uuid[CDI_UUID_SIZE];
if (rank == 0)
cdiCreateUUID(uuid);
#if USE_MPI
MPI_Bcast(uuid, CDI_UUID_SIZE, MPI_UNSIGNED_CHAR, 0, comm);
#endif
zaxisDefUUID(varDesc[varIdx].zaxisID, uuid);
cdiDefKeyBytes(varDesc[varIdx].zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuid, CDI_UUID_SIZE)
}
zaxisIDset:
varDesc[varIdx].id
......
......@@ -168,13 +168,13 @@ modelRun(struct model_config setup, MPI_Comm comm)
}
if (setup.create_uuid)
{
unsigned char uuid[16];
unsigned char uuid[CDI_UUID_SIZE];
if (rank == 0)
cdiCreateUUID(uuid);
#if USE_MPI
MPI_Bcast(uuid, CDI_UUID_SIZE, MPI_UNSIGNED_CHAR, 0, comm);
#endif
zaxisDefUUID(varDesc[varIdx].zaxisID, uuid);
cdiDefKeyBytes(varDesc[varIdx].zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuid, CDI_UUID_SIZE)
}
zaxisIDset:
varDesc[varIdx].id
......
......@@ -107,7 +107,7 @@ static int defineZaxis (void)
{
unsigned char uuid[CDI_UUID_SIZE];
cdiCreateUUID(uuid);
zaxisDefUUID(zaxisID, uuid);
cdiDefKeyBytes(zaxisID, CDI_GLOBAL, CDI_KEY_UUID, uuid, CDI_UUID_SIZE)
}
return 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