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

Replace gridDefReference() by cdiDefKeyString() with CDI_KEY_REFERENCEURI.

parent 6ee9223b
...@@ -15,7 +15,7 @@ gridInqYstdname(gridID, ylongname) -> cdiInqKeyString(gridID, CDI_YAXIS, CDI_ ...@@ -15,7 +15,7 @@ gridInqYstdname(gridID, ylongname) -> cdiInqKeyString(gridID, CDI_YAXIS, CDI_
gridDefNumber(zaxisID, number) -> cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDUSED, number) gridDefNumber(zaxisID, number) -> cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDUSED, number)
gridInqNumber(zaxisID) -> cdiInqKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDUSED, &number) gridInqNumber(zaxisID) -> cdiInqKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDUSED, &number)
gridDefPosition(zaxisID, positio) > cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDINREFERENCE, position) gridDefPosition(zaxisID, position) > cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDINREFERENCE, position)
gridInqPosition(zaxisID) -> cdiInqKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDINREFERENCE, &position) gridInqPosition(zaxisID) -> cdiInqKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDINREFERENCE, &position)
gridDefUUID(zaxisID, uuidOfHGrid) -> cdiDefKeyBytes(gridID, CDI_GLOBAL, CDI_KEY_UUID, uuidOfHGrid, length) gridDefUUID(zaxisID, uuidOfHGrid) -> cdiDefKeyBytes(gridID, CDI_GLOBAL, CDI_KEY_UUID, uuidOfHGrid, length)
gridInqUUID(zaxisID) -> cdiInqKeyBytes(gridID, CDI_GLOBAL, CDI_KEY_UUID, uuidOfHGrid, &length) gridInqUUID(zaxisID) -> cdiInqKeyBytes(gridID, CDI_GLOBAL, CDI_KEY_UUID, uuidOfHGrid, &length)
......
...@@ -18,10 +18,10 @@ int main(void) ...@@ -18,10 +18,10 @@ int main(void)
// Create a grid reference // Create a grid reference
gridID = gridCreate(GRID_UNSTRUCTURED, nlon*nlat); gridID = gridCreate(GRID_UNSTRUCTURED, nlon*nlat);
gridDefNumber(gridID, 123); cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDUSED, 123);
gridDefPosition(gridID, 3); cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDINREFERENCE, 3);
gridDefReference(gridID, "http://www.x.y/gridfile.nc"); cdiDefKeyString(gridID, CDI_GLOBAL, CDI_KEY_REFERENCEURI, "http://www.x.y/gridfile.nc");
gridDefUUID(gridID, "1234569887654321"); cdiDefKeyBytes(gridID, CDI_GLOBAL, CDI_KEY_UUID, "1234569887654321", CDI_UUID_SIZE);
// Create a surface level Z-axis // Create a surface level Z-axis
zaxisID1 = zaxisCreate(ZAXIS_SURFACE, 1); zaxisID1 = zaxisCreate(ZAXIS_SURFACE, 1);
......
...@@ -18,10 +18,10 @@ int main(void) ...@@ -18,10 +18,10 @@ int main(void)
// Create a grid reference // Create a grid reference
gridID = gridCreate(GRID_UNSTRUCTURED, nlon*nlat); gridID = gridCreate(GRID_UNSTRUCTURED, nlon*nlat);
gridDefNumber(gridID, 123); cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDUSED, 123);
gridDefPosition(gridID, 3); cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDINREFERENCE, 3);
gridDefReference(gridID, "http://www.x.y/gridfile.nc"); cdiDefKeyString(gridID, CDI_GLOBAL, CDI_KEY_REFERENCEURI, "http://www.x.y/gridfile.nc");
gridDefUUID(gridID, "1234569887654321"); cdiDefKeyBytes(gridID, CDI_GLOBAL, CDI_KEY_UUID, "1234569887654321", CDI_UUID_SIZE);
// Create a surface level Z-axis // Create a surface level Z-axis
zaxisID1 = zaxisCreate(ZAXIS_SURFACE, 1); zaxisID1 = zaxisCreate(ZAXIS_SURFACE, 1);
......
...@@ -61,9 +61,11 @@ static int defineGrid() ...@@ -61,9 +61,11 @@ static int defineGrid()
gridDefDatatype ( gridID, DOUBLE_PRECISION ); gridDefDatatype ( gridID, DOUBLE_PRECISION );
gridDefTrunc ( gridID, 1 ); gridDefTrunc ( gridID, 1 );
gridDefNumber ( gridID, 6 );
gridDefPosition ( gridID, 7 ); cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDUSED, 6);
gridDefReference ( gridID, "myReference" ); cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDINREFERENCE, 7);
cdiDefKeyString(gridID, CDI_GLOBAL, CDI_KEY_REFERENCEURI, "myReference");
/* gridDefLCC ( gridID, double originLon, double originLat, */ /* gridDefLCC ( gridID, double originLon, double originLat, */
/* double lonParY, double lat1, double lat2, double xinc, double yinc, int projflag, int scanflag); */ /* double lonParY, double lat1, double lat2, double xinc, double yinc, int projflag, int scanflag); */
/* gridDefLcc2 ( gridID, double earth_radius, double lon_0, */ /* gridDefLcc2 ( gridID, double earth_radius, double lon_0, */
...@@ -103,10 +105,8 @@ static int defineZaxis () ...@@ -103,10 +105,8 @@ static int defineZaxis ()
static int defineTaxis () static int defineTaxis ()
{ {
int taxisID = CDI_UNDEFID; int taxisID = taxisCreate(TAXIS_ABSOLUTE);
taxisID = taxisCreate(TAXIS_ABSOLUTE);
taxisDefType ( taxisID, 0 ); taxisDefType ( taxisID, 0 );
taxisDefVdate ( taxisID, 1 ); taxisDefVdate ( taxisID, 1 );
taxisDefVtime ( taxisID, 2 ); taxisDefVtime ( taxisID, 2 );
...@@ -200,8 +200,7 @@ static void modelRun ( MPI_Comm comm ) ...@@ -200,8 +200,7 @@ static void modelRun ( MPI_Comm comm )
reshPackBufferCreate(&sendBuffer, &bufferSize, &comm); reshPackBufferCreate(&sendBuffer, &bufferSize, &comm);
xmpi ( MPI_Send ( sendBuffer, bufferSize, MPI_PACKED, 0, 0, comm )); xmpi ( MPI_Send ( sendBuffer, bufferSize, MPI_PACKED, 0, 0, comm ));
recvBuffer = Malloc((size_t)bufferSize); recvBuffer = Malloc((size_t)bufferSize);
xmpi ( MPI_Recv ( recvBuffer, bufferSize, MPI_PACKED, 0, xmpi ( MPI_Recv ( recvBuffer, bufferSize, MPI_PACKED, 0, 0, comm, &status ));
0, comm, &status ));
namespaceSetActive ( 1 ); namespaceSetActive ( 1 );
reshUnpackResources(recvBuffer, bufferSize, &comm); reshUnpackResources(recvBuffer, bufferSize, &comm);
......
...@@ -65,9 +65,11 @@ static int defineGrid (void) ...@@ -65,9 +65,11 @@ static int defineGrid (void)
gridDefDatatype ( gridID, DOUBLE_PRECISION ); gridDefDatatype ( gridID, DOUBLE_PRECISION );
gridDefTrunc ( gridID, 1 ); gridDefTrunc ( gridID, 1 );
gridDefParamGME ( gridID, 2, 3, 4, 5 ); gridDefParamGME ( gridID, 2, 3, 4, 5 );
gridDefNumber ( gridID, 6 );
gridDefPosition ( gridID, 7 ); cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDUSED, 6);
gridDefReference ( gridID, "myReference" ); cdiDefKeyInt(gridID, CDI_GLOBAL, CDI_KEY_NUMBEROFGRIDINREFERENCE, 7);
cdiDefKeyString(gridID, CDI_GLOBAL, CDI_KEY_REFERENCEURI, "myReference");
for ( i = 0; i < nlon*nlat; i++ ) for ( i = 0; i < nlon*nlat; i++ )
area_vec[i] = 0.1 * i; area_vec[i] = 0.1 * i;
gridDefArea ( gridID, ap ); gridDefArea ( gridID, ap );
......
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