Commit 8ec02337 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added element proj to grid structure

parent d3e35563
......@@ -171,6 +171,7 @@ void grid_init(grid_t *gridptr)
{
gridptr->self = CDI_UNDEFID;
gridptr->type = CDI_UNDEFID;
gridptr->proj = CDI_UNDEFID;
gridptr->mask = NULL;
gridptr->mask_gme = NULL;
gridptr->xvals = NULL;
......@@ -2507,6 +2508,7 @@ int gridGenerate(grid_t grid)
case GRID_LCC2:
case GRID_SINUSOIDAL:
case GRID_LAEA:
case GRID_PROJECTION:
{
if ( grid.xsize > 0 ) gridDefXsize(gridID, grid.xsize);
if ( grid.ysize > 0 ) gridDefYsize(gridID, grid.ysize);
......@@ -2580,6 +2582,11 @@ int gridGenerate(grid_t grid)
grid.lcc_lat1, grid.lcc_lat2, grid.lcc_xinc, grid.lcc_yinc,
grid.lcc_projflag, grid.lcc_scanflag);
if ( grid.type == GRID_PROJECTION )
{
gridptr->name = strdup(grid.name);
}
break;
}
case GRID_GAUSSIAN_REDUCED:
......
......@@ -7,6 +7,7 @@ typedef struct {
int self;
int type; /* grid type */
int prec; /* grid precision */
int proj; /* grid projection */
mask_t *mask;
mask_t *mask_gme;
double *xvals;
......
......@@ -5375,7 +5375,24 @@ void define_all_grids(stream_t *streamptr, int fileID, int vlistID, ncdim_t *ncd
}
}
}
/*
if ( proj.type == GRID_PROJECTION )
{
if ( grid.type == GRID_GENERIC )
{
grid.type = GRID_CURVILINEAR;
}
if ( grid.type == GRID_CURVILINEAR )
{
proj.size = grid.size;
proj.xsize = grid.xsize;
proj.ysize = grid.ysize;
}
grid.proj = gridGenerate(proj);
}
*/
if ( CDI_Debug )
{
Message("grid: type = %d, size = %d, nx = %d, ny %d",
......
......@@ -640,7 +640,7 @@ int varDefGrid(int vlistID, grid_t grid, int mode)
{
gridID = vlistptr->gridIDs[index];
if ( gridID == UNDEFID )
Error("undefined gridID %d", gridID);
Error("Internal problem: undefined gridID %d!", gridID);
if ( gridCompare(gridID, grid) == 0 )
{
......
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