Commit 55a8f990 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

switch name of CDI_KEY_MAPNAME and CDI_KEY_MAPPING.

parent 5a7aaaa5
......@@ -282,7 +282,7 @@ void cdf_get_gmapvarname(int gridID, char *gmapvarname)
{
int pgridID = gridID;
char mapping[CDI_MAX_NAME]; mapping[0] = 0;
cdiGridInqKeyStr(pgridID, CDI_KEY_MAPPING, CDI_MAX_NAME, mapping);
cdiGridInqKeyStr(pgridID, CDI_KEY_MAPNAME, CDI_MAX_NAME, mapping);
if ( !mapping[0] )
{
......@@ -290,12 +290,12 @@ void cdf_get_gmapvarname(int gridID, char *gmapvarname)
if ( projID != CDI_UNDEFID )
{
pgridID = projID;
cdiGridInqKeyStr(pgridID, CDI_KEY_MAPPING, CDI_MAX_NAME, mapping);
cdiGridInqKeyStr(pgridID, CDI_KEY_MAPNAME, CDI_MAX_NAME, mapping);
}
}
if ( mapping[0] )
cdiGridInqKeyStr(pgridID, CDI_KEY_MAPNAME, CDI_MAX_NAME, gmapvarname);
cdiGridInqKeyStr(pgridID, CDI_KEY_MAPPING, CDI_MAX_NAME, gmapvarname);
}
static
......
......@@ -801,8 +801,8 @@ int gridInqYvals(int gridID, double yvals[]);
#define CDI_KEY_YLONGNAME 913 // Y-axis longname
#define CDI_KEY_YUNITS 914 // Y-axis units
#define CDI_KEY_VDIMNAME 920 // Vertex dimension name
#define CDI_KEY_MAPNAME 921 // Grid mapping var name
#define CDI_KEY_MAPPING 922 // Grid mapping name
#define CDI_KEY_MAPPING 921 // Grid mapping var name
#define CDI_KEY_MAPNAME 922 // Grid mapping name
/* CDI zaxis string key values */
#define CDI_KEY_NAME 941 // Z-axis name
......
......@@ -574,8 +574,8 @@ void *grid_key_to_ptr(grid_t *gridptr, int key)
case CDI_KEY_XDIMNAME: keyptr = (void*)gridptr->x.dimname; break;
case CDI_KEY_YDIMNAME: keyptr = (void*)gridptr->y.dimname; break;
case CDI_KEY_VDIMNAME: keyptr = (void*)gridptr->vdimname; break;
case CDI_KEY_MAPNAME: keyptr = (void*)gridptr->mapname; break;
case CDI_KEY_MAPPING: keyptr = (void*)gridptr->mapping; break;
case CDI_KEY_MAPPING: keyptr = (void*)gridptr->mapname; break;
case CDI_KEY_MAPNAME: keyptr = (void*)gridptr->mapping; break;
}
return keyptr;
......@@ -969,7 +969,7 @@ int gridInqProjType(int gridID)
if ( projtype == -1 )
{
char mapping[CDI_MAX_NAME]; mapping[0] = 0;
cdiGridInqKeyStr(gridID, CDI_KEY_MAPPING, CDI_MAX_NAME, mapping);
cdiGridInqKeyStr(gridID, CDI_KEY_MAPNAME, CDI_MAX_NAME, mapping);
if ( mapping[0] )
{
if ( strcmp(mapping, "rotated_latitude_longitude") == 0 ) projtype = CDI_PROJ_RLL;
......@@ -1782,7 +1782,7 @@ void gridInqParamRLL(int gridID, double *xpole, double *ypole, double *angle)
const char *projection = "rotated_latitude_longitude";
char mapping[CDI_MAX_NAME]; mapping[0] = 0;
cdiGridInqKeyStr(gridID, CDI_KEY_MAPPING, CDI_MAX_NAME, mapping);
cdiGridInqKeyStr(gridID, CDI_KEY_MAPNAME, CDI_MAX_NAME, mapping);
if ( mapping[0] && strcmp(mapping, projection) == 0 )
{
int atttype, attlen;
......@@ -1823,10 +1823,10 @@ void gridInqParamRLL(int gridID, double *xpole, double *ypole, double *angle)
*/
void gridDefParamRLL(int gridID, double xpole, double ypole, double angle)
{
cdiGridDefKeyStr(gridID, CDI_KEY_MAPNAME, CDI_MAX_NAME, "rotated_pole");
cdiGridDefKeyStr(gridID, CDI_KEY_MAPPING, CDI_MAX_NAME, "rotated_pole");
const char *mapping = "rotated_latitude_longitude";
cdiGridDefKeyStr(gridID, CDI_KEY_MAPPING, CDI_MAX_NAME, mapping);
cdiGridDefKeyStr(gridID, CDI_KEY_MAPNAME, CDI_MAX_NAME, mapping);
cdiDefAttTxt(gridID, CDI_GLOBAL, "grid_mapping_name", strlen(mapping), mapping);
cdiDefAttFlt(gridID, CDI_GLOBAL, "grid_north_pole_longitude", CDI_DATATYPE_FLT64, 1, &xpole);
cdiDefAttFlt(gridID, CDI_GLOBAL, "grid_north_pole_latitude", CDI_DATATYPE_FLT64, 1, &ypole);
......
......@@ -2456,7 +2456,7 @@ void cdf_read_mapping_atts(int ncid, int gmapvarid, int projID, const char *varn
{
char attstring[CDI_MAX_NAME];
cdfGetAttText(ncid, gmapvarid, "grid_mapping_name", CDI_MAX_NAME, attstring);
cdiGridDefKeyStr(projID, CDI_KEY_MAPPING, (int)(strlen(attstring)+1), attstring);
cdiGridDefKeyStr(projID, CDI_KEY_MAPNAME, (int)(strlen(attstring)+1), attstring);
}
else
{
......@@ -2643,7 +2643,7 @@ void cdf_define_all_grids(ncgrid_t *ncgrid, int vlistID, ncdim_t *ncdims, int nv
int ncid = ncvars[gmapvarid].ncid;
const char *gmapname = ncvars[gmapvarid].name;
cdf_read_mapping_atts(ncid, gmapvarid, projID, gmapname);
cdiGridDefKeyStr(projID, CDI_KEY_MAPNAME, (int)(strlen(gmapname)+1), gmapname);
cdiGridDefKeyStr(projID, CDI_KEY_MAPPING, (int)(strlen(gmapname)+1), gmapname);
gridVerifyProj(projID);
}
......
......@@ -1924,11 +1924,11 @@ static
void cdf_def_mapping(stream_t *streamptr, int gridID)
{
char mapping[CDI_MAX_NAME]; mapping[0] = 0;
cdiGridInqKeyStr(gridID, CDI_KEY_MAPPING, CDI_MAX_NAME, mapping);
cdiGridInqKeyStr(gridID, CDI_KEY_MAPNAME, CDI_MAX_NAME, mapping);
if ( mapping[0] )
{
char gmapvarname[CDI_MAX_NAME]; gmapvarname[0] = 0;
cdiGridInqKeyStr(gridID, CDI_KEY_MAPNAME, CDI_MAX_NAME, gmapvarname);
cdiGridInqKeyStr(gridID, CDI_KEY_MAPPING, CDI_MAX_NAME, gmapvarname);
int fileID = streamptr->fileID;
cdf_redef(fileID);
......
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