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

changed grid name GRID_CELL to GRID_UNSTRUCTURED

parent 303d3870
2011-01-21 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* changed grid name GRID_CELL to GRID_UNSTRUCTURED
2011-01-18 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* spcut: only correct results with continuous wave numbers starting at 1 (bug fix)
......
......@@ -99,7 +99,7 @@ void *Arithlat(void *argument)
gridID = gridToCurvilinear(gridID);
}
else if ( gridtype == GRID_CURVILINEAR ||
gridtype == GRID_CELL )
gridtype == GRID_UNSTRUCTURED )
{
/* No conversion necessary */
}
......
......@@ -182,7 +182,7 @@ void *Fillmiss(void *argument)
gridID1 = vlistGrid(vlistID1, index);
if ( gridInqType(gridID1) == GRID_GME ||
gridInqType(gridID1) == GRID_CELL )
gridInqType(gridID1) == GRID_UNSTRUCTURED )
cdoAbort("Interpolation of %s data unsupported!", gridNamePtr(gridInqType(gridID1)) );
}
......
......@@ -157,7 +157,7 @@ void *Gridcell(void *argument)
gridtype == GRID_LCC ||
gridtype == GRID_GME ||
gridtype == GRID_CURVILINEAR ||
gridtype == GRID_CELL )
gridtype == GRID_UNSTRUCTURED )
{
if ( gridHasArea(gridID) )
{
......
......@@ -150,7 +150,7 @@ void *Output(void *argument)
{
if ( gridInqType(gridID) == GRID_GME ) gridID = gridToCell(gridID);
if ( gridInqType(gridID) != GRID_CELL && gridInqType(gridID) != GRID_CURVILINEAR )
if ( gridInqType(gridID) != GRID_UNSTRUCTURED && gridInqType(gridID) != GRID_CURVILINEAR )
gridID = gridToCurvilinear(gridID);
grid_center_lon = (double *) malloc(gridsize*sizeof(double));
......
......@@ -639,7 +639,7 @@ void *Outputgmt(void *argument)
if ( gridInqType(gridID) == GRID_GME ) gridID = gridToCell(gridID);
if ( gridInqType(gridID) != GRID_CELL && gridInqType(gridID) != GRID_CURVILINEAR )
if ( gridInqType(gridID) != GRID_UNSTRUCTURED && gridInqType(gridID) != GRID_CURVILINEAR )
{
gridID = gridToCurvilinear(gridID);
lgrid_gen_bounds = TRUE;
......@@ -656,7 +656,7 @@ void *Outputgmt(void *argument)
gridInqMaskGME(gridID, grid_mask);
}
if ( gridInqType(gridID) != GRID_CELL )
if ( gridInqType(gridID) != GRID_UNSTRUCTURED )
{
if ( nlon == 1 && nlat > 1 && nlev == 1 ) lhov = TRUE;
if ( nlon == 1 && nlat > 1 && nlev > 1 ) lzon = TRUE;
......@@ -683,7 +683,7 @@ void *Outputgmt(void *argument)
cdoAbort("Bounds not available hovmoeller data!");
}
if ( gridInqType(gridID) == GRID_CELL )
if ( gridInqType(gridID) == GRID_UNSTRUCTURED )
gridcorners = gridInqNvertex(gridID);
else
gridcorners = 4;
......
......@@ -428,7 +428,7 @@ void *Remap(void *argument)
gridInqType(gridID1) != GRID_SINUSOIDAL &&
gridInqType(gridID1) != GRID_GME &&
gridInqType(gridID1) != GRID_CURVILINEAR &&
gridInqType(gridID1) != GRID_CELL )
gridInqType(gridID1) != GRID_UNSTRUCTURED )
{
if ( gridInqType(gridID1) == GRID_GAUSSIAN_REDUCED )
cdoAbort("Unsupported grid type: %s, use CDO option -R to convert reduced to regular grid!",
......@@ -744,7 +744,7 @@ void *Remap(void *argument)
remaps[r].grid.luse_grid1_area = FALSE;
remaps[r].grid.luse_grid2_area = FALSE;
*/
if ( gridInqType(gridID1) != GRID_CELL && lremap_num_srch_bins == FALSE )
if ( gridInqType(gridID1) != GRID_UNSTRUCTURED && lremap_num_srch_bins == FALSE )
{
if ( !remap_extrapolate && (map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1) )
{
......
......@@ -587,7 +587,7 @@ int gencellgrid(int gridID1, int *gridsize2, int **cellidx)
gridsize1 = gridInqSize(gridID1);
if ( gridtype != GRID_CELL ) cdoAbort("Internal problem, wrong grid type!");
if ( gridtype != GRID_UNSTRUCTURED ) cdoAbort("Internal problem, wrong grid type!");
xvals1 = (double *) malloc(gridsize1*sizeof(double));
yvals1 = (double *) malloc(gridsize1*sizeof(double));
......@@ -805,11 +805,11 @@ void *Selbox(void *argument)
if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN || gridtype == GRID_CURVILINEAR ||
(operatorID == SELINDEXBOX && (gridtype == GRID_GENERIC || gridtype == GRID_SINUSOIDAL) &&
gridInqXsize(gridID1) > 0 && gridInqYsize(gridID1) > 0 ) ||
(operatorID == SELLONLATBOX && gridtype == GRID_CELL) )
(operatorID == SELLONLATBOX && gridtype == GRID_UNSTRUCTURED) )
{
if ( operatorID == SELLONLATBOX )
{
if ( gridtype == GRID_CELL )
if ( gridtype == GRID_UNSTRUCTURED )
gridID2 = gencellgrid(gridID1, &sbox[index].nvals, &sbox[index].cellidx);
else
gridID2 = genlonlatgrid(gridID1, &sbox[index].lat1, &sbox[index].lat2, &sbox[index].lon11,
......@@ -839,7 +839,7 @@ void *Selbox(void *argument)
if ( cdoVerbose )
{
if ( gridtype != GRID_CELL )
if ( gridtype != GRID_UNSTRUCTURED )
cdoPrint("idx1,idx2,idy1,idy2: %d,%d,%d,%d",
sbox[0].lon21+1, sbox[0].lon22+1, sbox[0].lat1+1, sbox[0].lat2+1);
}
......@@ -877,7 +877,7 @@ void *Selbox(void *argument)
gridsize2 = gridInqSize(sbox[index].gridID2);
if ( operatorID == SELLONLATBOX && gridtype == GRID_CELL )
if ( operatorID == SELLONLATBOX && gridtype == GRID_UNSTRUCTURED )
window_cell(array1, gridID1, array2, gridsize2, sbox[index].cellidx);
else
window(array1, gridID1, array2, sbox[index].lat1, sbox[index].lat2, sbox[index].lon11,
......@@ -907,7 +907,7 @@ void *Selbox(void *argument)
if ( sbox )
{
if ( operatorID == SELLONLATBOX && gridtype == GRID_CELL )
if ( operatorID == SELLONLATBOX && gridtype == GRID_UNSTRUCTURED )
{
for ( index = 0; index < ngrids; index++ )
if ( sbox[index].cellidx ) free(sbox[index].cellidx);
......
......@@ -75,11 +75,12 @@ void *Setgrid(void *argument)
{
gridname = operatorArgv()[0];
if ( strcmp(gridname, "curvilinear") == 0 ) gridtype = GRID_CURVILINEAR;
else if ( strcmp(gridname, "cell") == 0 ) gridtype = GRID_CELL;
else if ( strcmp(gridname, "lonlat") == 0 ) gridtype = GRID_LONLAT;
else if ( strcmp(gridname, "gaussian") == 0 ) gridtype = GRID_GAUSSIAN;
else if ( strcmp(gridname, "regular") == 0 ) {gridtype = GRID_GAUSSIAN; lregular = 1;}
if ( strcmp(gridname, "curvilinear") == 0 ) gridtype = GRID_CURVILINEAR;
else if ( strcmp(gridname, "cell") == 0 ) gridtype = GRID_UNSTRUCTURED;
else if ( strcmp(gridname, "unstructured") == 0 ) gridtype = GRID_UNSTRUCTURED;
else if ( strcmp(gridname, "lonlat") == 0 ) gridtype = GRID_LONLAT;
else if ( strcmp(gridname, "gaussian") == 0 ) gridtype = GRID_GAUSSIAN;
else if ( strcmp(gridname, "regular") == 0 ) {gridtype = GRID_GAUSSIAN; lregular = 1;}
else cdoAbort("Unsupported grid name: %s", gridname);
}
else if ( operatorID == SETGRIDAREA )
......@@ -193,7 +194,7 @@ void *Setgrid(void *argument)
else
{
if ( gridtype == GRID_CURVILINEAR ) gridID2 = gridToCurvilinear(gridID1);
else if ( gridtype == GRID_CELL ) gridID2 = gridToCell(gridID1);
else if ( gridtype == GRID_UNSTRUCTURED ) gridID2 = gridToCell(gridID1);
else cdoAbort("Unsupported grid name: %s", gridname);
}
......
......@@ -49,7 +49,7 @@ void *Writegrid(void *argument)
if ( gridtype == GRID_GME ) gridID = gridToCell(gridID);
if ( gridtype != GRID_CURVILINEAR && gridtype != GRID_CELL )
if ( gridtype != GRID_CURVILINEAR && gridtype != GRID_UNSTRUCTURED )
gridID = gridToCurvilinear(gridID);
if ( gridInqXbounds(gridID, NULL) == 0 || gridInqYbounds(gridID, NULL) == 0 )
......
......@@ -1056,7 +1056,7 @@ void eca4(const ECA_REQUEST_4 *request)
recLevelID = (int *) malloc(nrecords*sizeof(int));
gridtype = gridInqType(gridID);
if ( gridtype != GRID_CELL && gridtype != GRID_CURVILINEAR )
if ( gridtype != GRID_UNSTRUCTURED && gridtype != GRID_CURVILINEAR )
{
if ( gridtype == GRID_GME )
gridID = gridToCell(gridID);
......
......@@ -824,7 +824,7 @@ int gridToCell(int gridID1)
gridtype = gridInqType(gridID1);
gridsize = gridInqSize(gridID1);
gridID2 = gridCreate(GRID_CELL, gridsize);
gridID2 = gridCreate(GRID_UNSTRUCTURED, gridsize);
gridDefPrec(gridID2, DATATYPE_FLT32);
switch (gridtype)
......@@ -1172,12 +1172,12 @@ int gridGenArea(int gridID, double *area)
gridtype != GRID_SINUSOIDAL &&
gridtype != GRID_GME &&
gridtype != GRID_CURVILINEAR &&
gridtype != GRID_CELL )
gridtype != GRID_UNSTRUCTURED )
{
cdoAbort("Internal error! Unsupported gridtype: %s", gridNamePtr(gridtype));
}
if ( gridtype != GRID_CELL && gridtype != GRID_CURVILINEAR )
if ( gridtype != GRID_UNSTRUCTURED && gridtype != GRID_CURVILINEAR )
{
if ( gridtype == GRID_GME )
{
......@@ -1196,7 +1196,7 @@ int gridGenArea(int gridID, double *area)
gridtype = gridInqType(gridID);
if ( gridtype == GRID_CELL )
if ( gridtype == GRID_UNSTRUCTURED )
nv = gridInqNvertex(gridID);
else
nv = 4;
......@@ -1451,7 +1451,7 @@ int gridWeights(int gridID, double *grid_wgts)
gridtype == GRID_LCC ||
gridtype == GRID_GME ||
gridtype == GRID_CURVILINEAR ||
gridtype == GRID_CELL )
gridtype == GRID_UNSTRUCTURED )
{
a_status = gridGenArea(gridID, grid_area);
}
......
......@@ -280,7 +280,7 @@ int gridDefine(grid_t grid)
break;
}
case GRID_CURVILINEAR:
case GRID_CELL:
case GRID_UNSTRUCTURED:
{
if ( grid.size == 0 ) grid.size = grid.xsize*grid.ysize;
......@@ -675,8 +675,10 @@ int gridFromFile(FILE *gfp, const char *dname)
}
else if ( cmpstr(pline, "spectral", len) == 0 )
grid.type = GRID_SPECTRAL;
else if ( cmpstr(pline, "unstructured", len) == 0 )
grid.type = GRID_UNSTRUCTURED;
else if ( cmpstr(pline, "cell", len) == 0 )
grid.type = GRID_CELL;
grid.type = GRID_UNSTRUCTURED;
else if ( cmpstr(pline, "gme", len) == 0 )
grid.type = GRID_GME;
else if ( cmpstr(pline, "lcc2", len) == 0 )
......@@ -970,7 +972,7 @@ int gridFromFile(FILE *gfp, const char *dname)
double fval;
char *endptr;
if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_CELL )
if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_UNSTRUCTURED )
size = grid.size;
else
size = grid.xsize;
......@@ -1007,7 +1009,7 @@ int gridFromFile(FILE *gfp, const char *dname)
double fval;
char *endptr;
if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_CELL )
if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_UNSTRUCTURED )
size = grid.size;
else
size = grid.ysize;
......@@ -1049,7 +1051,7 @@ int gridFromFile(FILE *gfp, const char *dname)
if ( grid.type == GRID_CURVILINEAR ) grid.nvertex = 4;
}
if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_CELL )
if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_UNSTRUCTURED )
size = grid.size;
else
size = grid.xsize;
......@@ -1094,7 +1096,7 @@ int gridFromFile(FILE *gfp, const char *dname)
if ( grid.type == GRID_CURVILINEAR ) grid.nvertex = 4;
}
if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_CELL )
if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_UNSTRUCTURED )
size = grid.size;
else
size = grid.ysize;
......
......@@ -90,7 +90,7 @@ int gridFromNCfile(const char *gridfile)
if ( grid_rank == 1 )
{
grid.type = GRID_CELL;
grid.type = GRID_UNSTRUCTURED;
if ( (size_t)grid_dims[0] != grid_size ) return(gridID);
}
else
......@@ -191,7 +191,7 @@ void writeNCgrid(const char *gridfile, int gridID, int *grid_imask)
grid_dims[0] = gridInqXsize(gridID);
grid_dims[1] = gridInqYsize(gridID);
}
else if ( gridtype == GRID_CELL )
else if ( gridtype == GRID_UNSTRUCTURED )
{
grid_rank = 1;
grid_dims[0] = gridInqSize(gridID);
......
......@@ -260,7 +260,7 @@ void printGridInfo(int vlistID)
nd = gridInqGMEnd(gridID);
fprintf(stdout, "size : dim = %d nd = %d ni = %d\n", gridsize, nd, ni);
}
else if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_CELL )
else if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED )
{
if ( gridtype == GRID_CURVILINEAR )
fprintf(stdout, "size : dim = %d nx = %d ny = %d\n", gridsize, xsize, ysize);
......@@ -337,7 +337,7 @@ void printGridInfo(int vlistID)
}
}
if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_CELL ||
if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED ||
gridtype == GRID_GENERIC || gridtype == GRID_LCC )
{
if ( gridInqXvals(gridID, NULL) || gridInqYvals(gridID, NULL) || gridHasArea(gridID) ||
......
......@@ -795,19 +795,19 @@ void remapGridInit(int map_type, int lextrapolate, int gridID1, int gridID2, rem
if ( map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1 )
{
if ( gridInqType(rg->gridID1) == GRID_CELL )
if ( gridInqType(rg->gridID1) == GRID_UNSTRUCTURED )
{
rg->luse_grid1_corners = TRUE;
rg->lneed_grid1_corners = FALSE; /* full grid search */
}
if ( gridInqType(rg->gridID2) == GRID_CELL )
if ( gridInqType(rg->gridID2) == GRID_UNSTRUCTURED )
{
rg->luse_grid2_corners = TRUE;
rg->lneed_grid2_corners = FALSE; /* full grid search */
}
}
if ( gridInqType(rg->gridID1) != GRID_CELL && gridInqType(rg->gridID1) != GRID_CURVILINEAR )
if ( gridInqType(rg->gridID1) != GRID_UNSTRUCTURED && gridInqType(rg->gridID1) != GRID_CURVILINEAR )
{
if ( gridInqType(rg->gridID1) == GRID_GME )
{
......@@ -825,7 +825,7 @@ void remapGridInit(int map_type, int lextrapolate, int gridID1, int gridID2, rem
}
}
if ( gridInqType(rg->gridID2) != GRID_CELL && gridInqType(rg->gridID2) != GRID_CURVILINEAR )
if ( gridInqType(rg->gridID2) != GRID_UNSTRUCTURED && gridInqType(rg->gridID2) != GRID_CURVILINEAR )
{
if ( gridInqType(rg->gridID2) == GRID_GME )
{
......@@ -849,22 +849,22 @@ void remapGridInit(int map_type, int lextrapolate, int gridID1, int gridID2, rem
rg->grid1_is_cyclic = gridIsCircular(gridID1);
rg->grid2_is_cyclic = gridIsCircular(gridID2);
if ( gridInqType(gridID1) == GRID_CELL )
if ( gridInqType(gridID1) == GRID_UNSTRUCTURED )
rg->grid1_rank = 1;
else
rg->grid1_rank = 2;
if ( gridInqType(gridID2) == GRID_CELL )
if ( gridInqType(gridID2) == GRID_UNSTRUCTURED )
rg->grid2_rank = 1;
else
rg->grid2_rank = 2;
if ( gridInqType(gridID1) == GRID_CELL )
if ( gridInqType(gridID1) == GRID_UNSTRUCTURED )
rg->grid1_corners = gridInqNvertex(gridID1);
else
rg->grid1_corners = 4;
if ( gridInqType(gridID2) == GRID_CELL )
if ( gridInqType(gridID2) == GRID_UNSTRUCTURED )
rg->grid2_corners = gridInqNvertex(gridID2);
else
rg->grid2_corners = 4;
......
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