Commit 04f94c50 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Make area array mutable for netcdf-based grids.

parent e57f2195
...@@ -4490,6 +4490,20 @@ static void cdfLazyGridDestroyOnce(void) ...@@ -4490,6 +4490,20 @@ static void cdfLazyGridDestroyOnce(void)
*/ */
} }
static void
cdfLazyGridDefArea(grid_t *grid, const double *area)
{
struct cdfLazyGrid *cdfGrid = (struct cdfLazyGrid *)grid;
lock_lazy_load(cdfGrid);
if (grid->area == cdfPendingLoad)
grid->area = NULL;
cdfGrid->cellAreaGet.datasetNCId = -1;
cdfGrid->cellAreaGet.varNCId = -1;
cdfGrid->baseVtable->defArea(grid, area);
unlock_lazy_load(cdfGrid);
}
static const double * static const double *
cdfLazyGridInqAreaPtr(grid_t *grid) cdfLazyGridInqAreaPtr(grid_t *grid)
{ {
...@@ -4824,6 +4838,7 @@ cdfLazyGridInitOnce(void) ...@@ -4824,6 +4838,7 @@ cdfLazyGridInitOnce(void)
cdfLazyGridVtable.copy = cdfLazyGridCopy; cdfLazyGridVtable.copy = cdfLazyGridCopy;
cdfLazyGridVtable.copyScalarFields = cdfLazyGridCopyScalarFields; cdfLazyGridVtable.copyScalarFields = cdfLazyGridCopyScalarFields;
cdfLazyGridVtable.copyArrayFields = cdfLazyGridCopyArrayFields; cdfLazyGridVtable.copyArrayFields = cdfLazyGridCopyArrayFields;
cdfLazyGridVtable.defArea = cdfLazyGridDefArea;
cdfLazyGridVtable.inqAreaPtr = cdfLazyGridInqAreaPtr; cdfLazyGridVtable.inqAreaPtr = cdfLazyGridInqAreaPtr;
cdfLazyGridVtable.inqArea = cdfLazyGridInqArea; cdfLazyGridVtable.inqArea = cdfLazyGridInqArea;
cdfLazyGridVtable.inqXValsPtr = cdfLazyGridInqXValsPtr; cdfLazyGridVtable.inqXValsPtr = cdfLazyGridInqXValsPtr;
......
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