Commit 9fafe071 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Set CF convention string to CF-1.4

parent c3eaf188
......@@ -84,7 +84,7 @@ void cdfComment(int ncid)
}
cdf_put_att_text(ncid, NC_GLOBAL, "CDI", strlen(comment), comment);
cdf_put_att_text(ncid, NC_GLOBAL, "Conventions", 6, "CF-1.0");
cdf_put_att_text(ncid, NC_GLOBAL, "Conventions", 6, "CF-1.4");
#endif
}
......
......@@ -25,6 +25,8 @@
# include "netcdf.h"
#endif
//#define PROJECTION_TEST
#undef UNDEFID
#define UNDEFID CDI_UNDEFID
......@@ -4875,6 +4877,29 @@ void verify_coordinate_vars_2(int nvars, ncvar_t *ncvars)
}
#endif
#if defined (HAVE_LIBNETCDF)
static
void copy_numeric_projatts(int gridID, int ncvarID, int ncfileID)
{
int iatt, nvatts;
size_t attlen;
char attname[256];
nc_type xtype;
cdf_inq_varnatts(ncfileID, ncvarID, &nvatts);
for ( iatt = 0; iatt < nvatts; iatt++ )
{
cdf_inq_attname(ncfileID, ncvarID, iatt, attname);
cdf_inq_atttype(ncfileID, ncvarID, attname, &xtype);
cdf_inq_attlen(ncfileID, ncvarID, attname, &attlen);
printf("%s %d\n", attname, (int)attlen);
}
}
#endif
#if defined (HAVE_LIBNETCDF)
/* define all input grids */
static
......@@ -5375,7 +5400,8 @@ void define_all_grids(stream_t *streamptr, int fileID, int vlistID, ncdim_t *ncd
}
}
}
/*
#if defined (PROJECTION_TEST)
if ( proj.type == GRID_PROJECTION )
{
if ( grid.type == GRID_GENERIC )
......@@ -5390,9 +5416,10 @@ void define_all_grids(stream_t *streamptr, int fileID, int vlistID, ncdim_t *ncd
proj.ysize = grid.ysize;
}
grid.proj = gridGenerate(proj);
// grid.proj = gridGenerate(proj);
}
*/
#endif
if ( CDI_Debug )
{
Message("grid: type = %d, size = %d, nx = %d, ny %d",
......@@ -5401,7 +5428,15 @@ void define_all_grids(stream_t *streamptr, int fileID, int vlistID, ncdim_t *ncd
proj.type, proj.size, proj.xsize, proj.ysize);
}
ncvars[ncvarid].gridID = varDefGrid(vlistID, grid, 1);
#if defined (PROJECTION_TEST)
if ( proj.type == GRID_PROJECTION )
{
ncvars[ncvarid].gridID = varDefGrid(vlistID, proj, 1);
copy_numeric_projatts(ncvars[ncvarid].gridID, ncvars[ncvarid].gmapid, fileID);
}
else
#endif
ncvars[ncvarid].gridID = varDefGrid(vlistID, grid, 1);
gridindex = vlistGridIndex(vlistID, ncvars[ncvarid].gridID);
streamptr->xdimID[gridindex] = xdimid;
......
Supports Markdown
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