Commit 909844fc authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

selindexbox: added support for LCC grid.

parent 89d1f9e1
......@@ -3,6 +3,10 @@
* Using CDI library version 1.8.1
* Version 1.8.1 release
2017-03-13 Uwe Schulzweida
* selindexbox: added support for LCC grid
2017-03-09 Uwe Schulzweida
* New operator delgridcell - Delete grid cells by indexes
......
......@@ -45,7 +45,6 @@ void cropData(double *array1, int gridID1, double *array2, int gridID2, int subI
long array2Idx = 0;
for ( long ilat1 = subJ0; ilat1 <= subJ1; ilat1++ ) // copy the last row as well..
{
//if ( cdoDebugExt>20 ) cdoPrint("cropData(): ilat1=%d; subJ0=%d; subJ1=%d; rowLen=%d ", ilat1, subJ0, subJ1, rowLen );
memcpy((void*)&array2[array2Idx], (void*)&array1[ilat1*nlon1 + subI0], rowLen*sizeof(double));
array2Idx += rowLen;
}
......@@ -68,8 +67,8 @@ void *Samplegrid(void *argument)
cdoInitialize(argument);
int SAMPLEGRID = cdoOperatorAdd("samplegrid", 0, 0, "resample factor, typically 2 (which will half the resolution)");
int SUBGRID = cdoOperatorAdd("subgrid", 0, 0, " sub-grid indices: i0,i1,j0,j1");
int SAMPLEGRID = cdoOperatorAdd("samplegrid", 0, 0, "resample factor, typically 2 (which will half the resolution)");
int SUBGRID = cdoOperatorAdd("subgrid", 0, 0, " sub-grid indices: i0,i1,j0,j1");
int operatorID = cdoOperatorID();
......@@ -202,7 +201,7 @@ void *Samplegrid(void *argument)
}
else if (operatorID == SUBGRID)
{
cropData(array1, gridSrcID, array2, gridIDsampled, subI0,subI1, subJ0, subJ1);
cropData(array1, gridSrcID, array2, gridIDsampled, subI0, subI1, subJ0, subJ1);
}
if ( nmiss )
......
......@@ -762,7 +762,11 @@ int genindexgrid(int gridID1, int *lat1, int *lat2, int *lon11, int *lon12, int
{
genindexbox(0, gridID1, lat1, lat2, lon11, lon12, lon21, lon22);
int gridID2 = gengrid(gridID1, *lat1, *lat2, *lon11, *lon12, *lon21, *lon22);
int gridID2 = -1;
if ( gridInqType(gridID1) == GRID_LCC )
gridID2 = cdo_define_subgrid_grid(gridID1, *lon11, *lon12, *lat1, *lat2);
else
gridID2 = gengrid(gridID1, *lat1, *lat2, *lon11, *lon12, *lon21, *lon22);
return gridID2;
}
......@@ -865,7 +869,7 @@ void *Selbox(void *argument)
gridID1 = vlistGrid(vlistID1, index);
gridtype = gridInqType(gridID1);
if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN || gridtype == GRID_CURVILINEAR ||
if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN || gridtype == GRID_CURVILINEAR || gridtype == GRID_LCC ||
(gridtype == GRID_PROJECTION && gridInqProjType(gridID1) == CDI_PROJ_RLL) ||
(operatorID == SELINDEXBOX && gridtype == GRID_GENERIC &&
gridInqXsize(gridID1) > 0 && gridInqYsize(gridID1) > 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