Commit 6ee9223b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Replaced gridDefXname()/gridDefYname() by cdiDefKeyString() with CDI_KEY_NAME.

parent da5acbec
...@@ -31,8 +31,9 @@ int main(void) ...@@ -31,8 +31,9 @@ int main(void)
gridDefYsize(gridID, nlat); gridDefYsize(gridID, nlat);
gridDefXvals(gridID, lons2D); gridDefXvals(gridID, lons2D);
gridDefYvals(gridID, lats2D); gridDefYvals(gridID, lats2D);
gridDefXname(gridID, "lon");
gridDefYname(gridID, "lat"); cdiDefKeyString(gridID, CDI_XAXIS, CDI_KEY_NAME, "lon");
cdiDefKeyString(gridID, CDI_YAXIS, CDI_KEY_NAME, "lat");
} }
// Create a rotated lon/lat grid // Create a rotated lon/lat grid
...@@ -45,8 +46,10 @@ int main(void) ...@@ -45,8 +46,10 @@ int main(void)
gridDefYsize(projID, nlat); gridDefYsize(projID, nlat);
gridDefXvals(projID, rlons); gridDefXvals(projID, rlons);
gridDefYvals(projID, rlats); gridDefYvals(projID, rlats);
gridDefXname(projID, "rlon");
gridDefYname(projID, "rlat"); cdiDefKeyString(projID, CDI_XAXIS, CDI_KEY_NAME, "rlon");
cdiDefKeyString(projID, CDI_YAXIS, CDI_KEY_NAME, "rlat");
gridDefParamRLL(projID, -162., 39.25, 0); gridDefParamRLL(projID, -162., 39.25, 0);
gridDefProj(gridID, projID); gridDefProj(gridID, projID);
......
...@@ -22,8 +22,9 @@ int main(void) ...@@ -22,8 +22,9 @@ int main(void)
gridDefYsize(gridID, nlat); gridDefYsize(gridID, nlat);
gridDefXvals(gridID, lons); gridDefXvals(gridID, lons);
gridDefYvals(gridID, lats); gridDefYvals(gridID, lats);
gridDefXname(gridID, "rlon");
gridDefYname(gridID, "rlat"); cdiDefKeyString(gridID, CDI_XAXIS, CDI_KEY_NAME, "rlon");
cdiDefKeyString(gridID, CDI_YAXIS, CDI_KEY_NAME, "rlat");
// Create a surface level Z-axis // Create a surface level Z-axis
int zaxisID1 = zaxisCreate(ZAXIS_SURFACE, 1); int zaxisID1 = zaxisCreate(ZAXIS_SURFACE, 1);
......
...@@ -36,7 +36,7 @@ static int defineGrid() ...@@ -36,7 +36,7 @@ static int defineGrid()
double area_vec[nlon*nlat]; double area_vec[nlon*nlat];
const double * ap = &area_vec[0]; const double * ap = &area_vec[0];
int i; int i;
gridID = gridCreate(GRID_LONLAT, nlon*nlat); gridID = gridCreate(GRID_LONLAT, nlon*nlat);
gridDefXsize(gridID, nlon); gridDefXsize(gridID, nlon);
gridDefYsize(gridID, nlat); gridDefYsize(gridID, nlat);
...@@ -51,12 +51,14 @@ static int defineGrid() ...@@ -51,12 +51,14 @@ static int defineGrid()
for ( i = 0; i < nlon*nlat; i++ ) for ( i = 0; i < nlon*nlat; i++ )
mask_vec[i] = 1; mask_vec[i] = 1;
gridDefMask ( gridID, mp ); gridDefMask ( gridID, mp );
gridDefXname ( gridID, "myXname" );
gridDefXlongname ( gridID, "myXlongname" ); cdiDefKeyString(gridID, CDI_XAXIS, CDI_KEY_NAME, "myXname");
gridDefXunits ( gridID, "myXunits" ); cdiDefKeyString(gridID, CDI_YAXIS, CDI_KEY_NAME, "myYname");
gridDefYname ( gridID, "myYname" ); cdiDefKeyString(gridID, CDI_XAXIS, CDI_KEY_LONGNAME, "myXlongname");
gridDefYlongname ( gridID, "myYlongname" ); cdiDefKeyString(gridID, CDI_YAXIS, CDI_KEY_LONGNAME, "myYlongname");
gridDefYunits ( gridID, "myYunits" ); cdiDefKeyString(gridID, CDI_XAXIS, CDI_KEY_UNITS, "myXunits");
cdiDefKeyString(gridID, CDI_YAXIS, CDI_KEY_UNITS, "myYunits");
gridDefDatatype ( gridID, DOUBLE_PRECISION ); gridDefDatatype ( gridID, DOUBLE_PRECISION );
gridDefTrunc ( gridID, 1 ); gridDefTrunc ( gridID, 1 );
gridDefNumber ( gridID, 6 ); gridDefNumber ( gridID, 6 );
......
...@@ -54,12 +54,14 @@ static int defineGrid (void) ...@@ -54,12 +54,14 @@ static int defineGrid (void)
for ( i = 0; i < nlon*nlat; i++ ) for ( i = 0; i < nlon*nlat; i++ )
mask_vec[i] = 1; mask_vec[i] = 1;
gridDefMask ( gridID, mp ); gridDefMask ( gridID, mp );
gridDefXname ( gridID, "myXname" );
gridDefXlongname ( gridID, "myXlongname" ); cdiDefKeyString(gridID, CDI_XAXIS, CDI_KEY_NAME, "myXname");
gridDefXunits ( gridID, "myXunits" ); cdiDefKeyString(gridID, CDI_YAXIS, CDI_KEY_NAME, "myYname");
gridDefYname ( gridID, "myYname" ); cdiDefKeyString(gridID, CDI_XAXIS, CDI_KEY_LONGNAME, "myXlongname");
gridDefYlongname ( gridID, "myYlongname" ); cdiDefKeyString(gridID, CDI_YAXIS, CDI_KEY_LONGNAME, "myYlongname");
gridDefYunits ( gridID, "myYunits" ); cdiDefKeyString(gridID, CDI_XAXIS, CDI_KEY_UNITS, "myXunits");
cdiDefKeyString(gridID, CDI_YAXIS, CDI_KEY_UNITS, "myYunits");
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 );
......
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