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

gridarea: added support for CDI_PROJ_LAEA.

parent bb10202d
......@@ -41,8 +41,11 @@ double orthodrome(double px1, double py1, double px2, double py2)
void grid_cell_area(int gridID, double *array)
{
int gridtype = gridInqType(gridID);
int projtype = (gridtype == GRID_PROJECTION) ? gridInqProjType(gridID) : -1;
if ( gridtype == GRID_LONLAT ||
gridtype == GRID_GAUSSIAN ||
gridtype == GRID_LAEA || projtype == CDI_PROJ_LAEA ||
gridtype == GRID_LCC ||
gridtype == GRID_GME ||
gridtype == GRID_CURVILINEAR ||
......@@ -178,8 +181,7 @@ void *Gridcell(void *argument)
else if ( operatorID == GRIDWGTS )
{
status = gridWeights(gridID, array);
if ( status != 0 )
cdoWarning("Using constant grid cell area weights!");
if ( status != 0 ) cdoWarning("Using constant grid cell area weights!");
}
else if ( operatorID == GRIDMASK )
{
......
......@@ -1761,8 +1761,9 @@ int gridWeights(int gridID, double *grid_wgts)
int w_status = 1;
int a_status = 0;
int gridtype = gridInqType(gridID);
int gridsize = gridInqSize(gridID);
int gridtype = gridInqType(gridID);
int projtype = (gridtype == GRID_PROJECTION) ? gridInqProjType(gridID) : -1;
double *grid_area = (double*) Malloc(gridsize*sizeof(double));
......@@ -1778,6 +1779,7 @@ int gridWeights(int gridID, double *grid_wgts)
gridtype == GRID_LCC ||
gridtype == GRID_LCC2 ||
gridtype == GRID_LAEA ||
projtype == CDI_PROJ_LAEA ||
gridtype == GRID_SINUSOIDAL ||
gridtype == GRID_GME ||
gridtype == GRID_CURVILINEAR ||
......
......@@ -292,12 +292,14 @@ int gridGenArea(int gridID, double* area)
long gridsize = gridInqSize(gridID);
int gridtype = gridInqType(gridID);
int projtype = (gridtype == GRID_PROJECTION) ? gridInqProjType(gridID) : -1;
if ( gridtype != GRID_LONLAT &&
gridtype != GRID_GAUSSIAN &&
gridtype != GRID_LCC &&
gridtype != GRID_LCC2 &&
gridtype != GRID_LAEA &&
projtype != CDI_PROJ_LAEA &&
gridtype != GRID_SINUSOIDAL &&
gridtype != GRID_GME &&
gridtype != GRID_CURVILINEAR &&
......
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