Commit 67bf3f09 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Removed obsolete CDI grid functions gridXXXXpole(), gridXXXYpole(),...

Removed obsolete CDI grid functions gridXXXXpole(), gridXXXYpole(), gridXXXAngle() and gridIsRotated().
parent 935f770f
2016-08-11 Uwe Schulzweida
* Removed obsolete CDI grid functions gridXXXXpole(), gridXXXYpole(), gridXXXAngle() and gridIsRotated()
2016-08-01 Uwe Schulzweida
* grb, grb2 write: added support for projection CDI_PROJ_RLL
......
......@@ -656,7 +656,8 @@ void setDefaultFileType(char *filetypestr)
else if ( memcmp(filetypestr, "nc2", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC2; }
else if ( memcmp(filetypestr, "nc4c", 4) == 0 ) { ftstr += 4; DefaultFileType = FILETYPE_NC4C;}
else if ( memcmp(filetypestr, "nc4", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC4; }
else if ( memcmp(filetypestr, "nc", 2) == 0 ) { ftstr += 2; DefaultFileType = FILETYPE_NC; }
else if ( memcmp(filetypestr, "nc1", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC; }
else if ( memcmp(filetypestr, "nc", 2) == 0 ) { ftstr += 2; DefaultFileType = FILETYPE_NC2; }
else if ( memcmp(filetypestr, "srv", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_SRV; }
else if ( memcmp(filetypestr, "ext", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_EXT; }
else if ( memcmp(filetypestr, "ieg", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_IEG; }
......
......@@ -348,16 +348,6 @@ void printGridInfoKernel(int gridID, int index, bool lproj)
print_xvals(gridID, dig);
print_yvals(gridID, dig);
if ( gridtype == GRID_LONLAT && gridIsRotated(gridID) )
{
double lonpole = gridInqXpole(gridID);
double latpole = gridInqYpole(gridID);
double angle = gridInqAngle(gridID);
fprintf(stdout, "%33s : lon=%.*g lat=%.*g", "northpole", dig, lonpole, dig, latpole);
if ( IS_NOT_EQUAL(angle, 0) ) fprintf(stdout, " angle=%.*g", dig, angle);
fprintf(stdout, "\n");
}
if ( gridInqXbounds(gridID, NULL) || gridInqYbounds(gridID, NULL) )
{
fprintf(stdout, "%33s :", "available");
......
......@@ -627,7 +627,6 @@ int cdfDefVar(stream_t *streamptr, int varID)
if ( gridtype == GRID_SINUSOIDAL ) strcpy(gmapvarname, "Sinusoidal");
else if ( gridtype == GRID_LAEA ) strcpy(gmapvarname, "Lambert_AEA");
else if ( gridtype == GRID_LCC2 ) strcpy(gmapvarname, "Lambert_CC");
else if ( gridtype == GRID_LONLAT && gridIsRotated(gridID) ) strcpy(gmapvarname, "rotated_pole");
else cdf_get_gmapvarname(gridID, gmapvarname);
if ( gmapvarname[0] ) cdf_put_att_text(fileID, ncvarid, "grid_mapping", strlen(gmapvarname), gmapvarname);
......
......@@ -850,17 +850,10 @@ double gridInqXinc(int gridID);
double gridInqYinc(int gridID);
int gridIsCircular(int gridID);
int gridIsRotated(int gridID);
void gridInqParamRLL(int gridID, double *xpole, double *ypole, double *angle);
void gridDefParamRLL(int gridID, double xpole, double ypole, double angle);
void gridDefXpole(int gridID, double xpole);
double gridInqXpole(int gridID);
void gridDefYpole(int gridID, double ypole);
double gridInqYpole(int gridID);
void gridDefAngle(int gridID, double angle);
double gridInqAngle(int gridID);
int gridInqTrunc(int gridID);
void gridDefTrunc(int gridID, int trunc);
/* Hexagonal GME grid */
......
......@@ -289,6 +289,7 @@ static int getAvailabilityOfRelativeTimes(grib_handle* gh, bool* outHaveForecast
}
}
char* gribMakeTimeString(grib_handle* gh, CdiTimeType timeType)
{
//Get the parts of the reference date.
......@@ -336,9 +337,10 @@ char* gribMakeTimeString(grib_handle* gh, CdiTimeType timeType)
return makeDateString(&date);
}
int gribapiTimeIsFC(grib_handle *gh)
{
if(gribEditionNumber(gh) <= 1) return true;
if (gribEditionNumber(gh) <= 1) return true;
long sigofrtime;
FAIL_ON_GRIB_ERROR(grib_get_long, gh, "significanceOfReferenceTime", &sigofrtime);
......@@ -380,9 +382,10 @@ int gribapiGetTsteptype(grib_handle *gh)
}
}
return (tsteptype);
return tsteptype;
}
int gribGetDatatype(grib_handle* gribHandle)
{
int datatype;
......@@ -398,6 +401,7 @@ int gribGetDatatype(grib_handle* gribHandle)
return datatype;
}
int gribapiGetParam(grib_handle *gh)
{
long pdis, pcat, pnum;
......@@ -416,6 +420,7 @@ int gribapiGetParam(grib_handle *gh)
return cdiEncodeParam((int)pnum, (int)pcat, (int)pdis);
}
int gribapiGetGridType(grib_handle *gh)
{
int gridtype = GRID_GENERIC;
......@@ -424,16 +429,10 @@ int gribapiGetGridType(grib_handle *gh)
case GRIB2_GTYPE_LATLON:
gridtype = ( gribGetLong(gh, "Ni") == (long) GRIB_MISSING_LONG ) ? GRID_GENERIC : GRID_LONLAT;
break;
case GRIB2_GTYPE_GAUSSIAN:
gridtype = ( gribGetLong(gh, "Ni") == (long) GRIB_MISSING_LONG ) ? GRID_GAUSSIAN_REDUCED : GRID_GAUSSIAN;
break;
#ifdef TEST_PROJECTION
case GRIB2_GTYPE_LATLON_ROT: gridtype = GRID_PROJECTION; break;
#else
case GRIB2_GTYPE_LATLON_ROT: gridtype = GRID_LONLAT; break;
#endif
case GRIB2_GTYPE_LCC: gridtype = GRID_LCC; break;
case GRIB2_GTYPE_SPECTRAL: gridtype = GRID_SPECTRAL; break;
case GRIB2_GTYPE_GME: gridtype = GRID_GME; break;
......@@ -714,22 +713,6 @@ void gribapiGetGrid(grib_handle *gh, grid_t *grid)
Error("Unsupported grid type: %s", gridNamePtr(gridtype));
}
grid->isRotated = FALSE;
if ( gribapiGetIsRotated(gh) )
{
double xpole = 0, ypole = 0, angle = 0;
grid->isRotated = TRUE;
FAIL_ON_GRIB_ERROR(grib_get_double, gh, "latitudeOfSouthernPoleInDegrees", &ypole);
FAIL_ON_GRIB_ERROR(grib_get_double, gh, "longitudeOfSouthernPoleInDegrees", &xpole);
FAIL_ON_GRIB_ERROR(grib_get_double, gh, "angleOfRotation", &angle);
xpole = xpole - 180;
if ( fabs(ypole) > 0 ) ypole = -ypole; // change from south to north pole
if ( fabs(angle) > 0 ) angle = -angle;
grid->rll.xpole = xpole;
grid->rll.ypole = ypole;
grid->rll.angle = angle;
}
grid->type = gridtype;
grid->projtype = projtype;
}
......
......@@ -139,11 +139,6 @@ void grid_init(grid_t *gridptr)
gridptr->gme.ni2 = 0;
gridptr->gme.ni3 = 0;
gridptr->isRotated = FALSE;
gridptr->rll.xpole = 0.0;
gridptr->rll.ypole = 0.0;
gridptr->rll.angle = 0.0;
gridptr->trunc = 0;
gridptr->nvertex = 0;
gridptr->number = 0;
......@@ -1797,7 +1792,16 @@ double gridInqYinc(int gridID)
return yinc;
}
/*
@Function
@Title
@Prototype
@Parameter
@Item Grid identifier
@EndFunction
*/
void gridInqParamRLL(int gridID, double *xpole, double *ypole, double *angle)
{
*xpole = 0; *ypole = 0; *angle = 0;
......@@ -1833,7 +1837,16 @@ void gridInqParamRLL(int gridID, double *xpole, double *ypole, double *angle)
Warning("%s mapping parameter missing!", projection);
}
/*
@Function
@Title
@Prototype
@Parameter
@Item Grid identifier
@EndFunction
*/
void gridDefParamRLL(int gridID, double xpole, double ypole, double angle)
{
cdiGridDefKeyStr(gridID, CDI_KEY_MAPNAME, CDI_MAX_NAME, "rotated_pole");
......@@ -1855,135 +1868,6 @@ void gridDefParamRLL(int gridID, double xpole, double ypole, double angle)
@Function
@Title
@Prototype
@Parameter
@Item Grid identifier
@EndFunction
*/
double gridInqXpole(int gridID)
{
// Xpole -> grid_north_pole_longitude
grid_t *gridptr = gridID2Ptr(gridID);
return gridptr->rll.xpole;
}
/*
@Function
@Title
@Prototype
@Parameter
@Item Grid identifier
@EndFunction
*/
void gridDefXpole(int gridID, double xpole)
{
// Xpole -> grid_north_pole_longitude
grid_t *gridptr = gridID2Ptr(gridID);
if ( gridptr->x.stdname && memcmp(gridptr->x.stdname, "grid", 4) != 0 )
gridptr->x.stdname = xystdname_tab[grid_xystdname_grid_latlon][0];
if ( gridptr->isRotated != TRUE || IS_NOT_EQUAL(gridptr->rll.xpole, xpole) )
{
gridptr->isRotated = TRUE;
gridptr->rll.xpole = xpole;
gridMark4Update(gridID);
}
}
/*
@Function
@Title
@Prototype
@Parameter
@Item Grid identifier
@EndFunction
*/
double gridInqYpole(int gridID)
{
// Ypole -> grid_north_pole_latitude
grid_t *gridptr = gridID2Ptr(gridID);
return gridptr->rll.ypole;
}
/*
@Function
@Title
@Prototype
@Parameter
@Item Grid identifier
@EndFunction
*/
void gridDefYpole(int gridID, double ypole)
{
// Ypole -> grid_north_pole_latitude
grid_t *gridptr = gridID2Ptr(gridID);
if ( gridptr->y.stdname && memcmp(gridptr->y.stdname, "grid", 4) != 0 )
gridptr->y.stdname = xystdname_tab[grid_xystdname_grid_latlon][1];
if ( gridptr->isRotated != TRUE || IS_NOT_EQUAL(gridptr->rll.ypole, ypole) )
{
gridptr->isRotated = TRUE;
gridptr->rll.ypole = ypole;
gridMark4Update(gridID);
}
}
/*
@Function
@Title
@Prototype
@Parameter
@Item Grid identifier
@EndFunction
*/
double gridInqAngle(int gridID)
{
// Angle -> north_pole_grid_longitude
grid_t *gridptr = gridID2Ptr(gridID);
return gridptr->rll.angle;
}
/*
@Function
@Title
@Prototype
@Parameter
@Item Grid identifier
@EndFunction<
*/
void gridDefAngle(int gridID, double angle)
{
// Angle -> north_pole_grid_longitude
grid_t *gridptr = gridID2Ptr(gridID);
if ( gridptr->isRotated != TRUE || IS_NOT_EQUAL(gridptr->rll.angle, angle) )
{
gridptr->isRotated = TRUE;
gridptr->rll.angle = angle;
gridMark4Update(gridID);
}
}
/*
@Function
@Title
@Prototype
@Parameter
@Item Grid identifier
......@@ -2245,14 +2129,6 @@ int gridIsCircular(int gridID)
return gridptr->isCyclic;
}
int gridIsRotated(int gridID)
{
grid_t *gridptr = gridID2Ptr(gridID);
return gridptr->isRotated;
}
static
bool compareXYvals(grid_t *gridRef, grid_t *gridTest)
{
......@@ -2482,7 +2358,6 @@ int gridCompareP ( void * gridptr1, void * gridptr2 )
if ( g1->lcc2.defined != g2->lcc2.defined ) return differ;
if ( g1->laea.defined != g2->laea.defined ) return differ;
if ( g1->isCyclic != g2->isCyclic ) return differ;
if ( g1->isRotated != g2->isRotated ) return differ;
if ( g1->x.flag != g2->x.flag ) return differ;
if ( g1->y.flag != g2->y.flag ) return differ;
if ( g1->gme.nd != g2->gme.nd ) return differ;
......@@ -2520,9 +2395,6 @@ int gridCompareP ( void * gridptr1, void * gridptr2 )
if ( IS_NOT_EQUAL(g1->laea.lon_0 , g2->laea.lon_0) ) return differ;
if ( IS_NOT_EQUAL(g1->laea.lat_0 , g2->laea.lat_0) ) return differ;
if ( IS_NOT_EQUAL(g1->laea.a , g2->laea.a) ) return differ;
if ( IS_NOT_EQUAL(g1->rll.xpole , g2->rll.xpole) ) return differ;
if ( IS_NOT_EQUAL(g1->rll.ypole , g2->rll.ypole) ) return differ;
if ( IS_NOT_EQUAL(g1->rll.angle , g2->rll.angle) ) return differ;
const double *restrict g1_xvals = g1->vtable->inqXValsPtr(g1),
*restrict g2_xvals = g2->vtable->inqXValsPtr(g2);
......@@ -2707,7 +2579,7 @@ void gridComplete(grid_t *grid)
*/
}
if ( grid->isRotated || grid->projtype == CDI_PROJ_RLL )
if ( grid->projtype == CDI_PROJ_RLL )
{
if ( grid->x.name[0] == 0 || grid->x.name[0] == 'x' ) gridDefXname(gridID, "rlon");
if ( grid->y.name[0] == 0 || grid->y.name[0] == 'y' ) gridDefYname(gridID, "rlat");
......@@ -2717,13 +2589,6 @@ void gridComplete(grid_t *grid)
grid->y.stdname = xystdname_tab[grid_xystdname_grid_latlon][1];
if ( grid->x.units[0] == 0 ) gridDefXunits(gridID, "degrees");
if ( grid->y.units[0] == 0 ) gridDefYunits(gridID, "degrees");
if ( grid->isRotated )
{
gridDefXpole(gridID, grid->rll.xpole);
gridDefYpole(gridID, grid->rll.ypole);
gridDefAngle(gridID, grid->rll.angle);
}
}
switch (gridtype)
......@@ -2868,10 +2733,6 @@ int gridGenerate(const grid_t *grid)
gridptr->y.first = grid->y.first;
gridptr->y.last = grid->y.last;
gridptr->y.inc = grid->y.inc;
gridptr->isRotated = grid->isRotated;
gridptr->rll.xpole = grid->rll.xpole;
gridptr->rll.ypole = grid->rll.ypole;
gridptr->rll.angle = grid->rll.angle;
if ( valdef_group1 && grid->area)
gridDefArea(gridID, grid->area);
gridptr->laea.a = grid->laea.a;
......@@ -3653,13 +3514,6 @@ void gridPrintKernel(grid_t *gridptr, int index, int opt, FILE *fp)
dig, a, dig, lon_0, dig, lat_0, dig, lat_1, dig, lat_2);
}
if ( gridptr->isRotated )
{
if ( xsize > 0 ) fprintf(fp, "xnpole = %.*g\n", dig, gridptr->rll.xpole);
if ( ysize > 0 ) fprintf(fp, "ynpole = %.*g\n", dig, gridptr->rll.ypole);
if ( IS_NOT_EQUAL(gridptr->rll.angle, 0) ) fprintf(fp, "angle = %.*g\n", dig, gridptr->rll.angle);
}
if ( xvals )
{
double xfirst = 0.0, xinc = 0.0;
......@@ -4492,7 +4346,6 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
gridP->lcc2.defined = (short)intBuffer[6];
gridP->laea.defined = intBuffer[7];
gridP->isCyclic = (short)intBuffer[8];
gridP->isRotated = (short)intBuffer[9];
gridP->x.flag = (short)intBuffer[10];
gridP->y.flag = (short)intBuffer[11];
gridP->gme.nd = intBuffer[12];
......@@ -4553,9 +4406,6 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
gridP->laea.lon_0 = doubleBuffer[18];
gridP->laea.lat_0 = doubleBuffer[19];
gridP->laea.a = doubleBuffer[20];
gridP->rll.xpole = doubleBuffer[21];
gridP->rll.ypole = doubleBuffer[22];
gridP->rll.angle = doubleBuffer[23];
}
int irregular = gridP->type == GRID_UNSTRUCTURED
......@@ -4695,7 +4545,6 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
intBuffer[6] = gridP->lcc2.defined;
intBuffer[7] = gridP->laea.defined;
intBuffer[8] = gridP->isCyclic;
intBuffer[9] = gridP->isRotated;
intBuffer[10] = gridP->x.flag;
intBuffer[11] = gridP->y.flag;
intBuffer[12] = gridP->gme.nd;
......@@ -4759,9 +4608,6 @@ gridPack(void * voidP, void * packBuffer, int packBufferSize,
doubleBuffer[18] = gridP->laea.lon_0;
doubleBuffer[19] = gridP->laea.lat_0;
doubleBuffer[20] = gridP->laea.a;
doubleBuffer[21] = gridP->rll.xpole;
doubleBuffer[22] = gridP->rll.ypole;
doubleBuffer[23] = gridP->rll.angle;
serializePack(doubleBuffer, gridNdouble, DATATYPE_FLT64,
packBuffer, packBufferSize, packBufferPos, context);
......
......@@ -95,11 +95,6 @@ struct grid_gme_t {
int nd, ni, ni2, ni3; /* parameter for GRID_GME */
};
// Rotated LonLat
struct grid_rll_t {
double xpole, ypole, angle; /* rotated north pole */
};
struct grid_t {
int self;
int type; /* grid type */
......@@ -113,9 +108,7 @@ struct grid_t {
struct grid_lcc2_t lcc2;
struct grid_laea_t laea;
struct grid_gme_t gme;
struct grid_rll_t rll;
short isCyclic; /* TRUE for global cyclic grids */
short isRotated; /* TRUE for rotated grids */
int number, position; /* parameter for GRID_REFERENCE */
int trunc; /* parameter for GRID_SPECTEAL */
int nvertex;
......
......@@ -2502,9 +2502,7 @@ void cdf_set_proj_atts(int ncid, int gmapvarid, grid_t *grid)
cdfGetAttText(ncid, gmapvarid, attname, attstringlen, attstring);
str_tolower(attstring);
if ( strcmp(attstring, "rotated_latitude_longitude") == 0 )
grid->isRotated = TRUE;
else if ( strcmp(attstring, "sinusoidal") == 0 )
if ( strcmp(attstring, "sinusoidal") == 0 )
grid->type = GRID_SINUSOIDAL;
else if ( strcmp(attstring, "lambert_azimuthal_equal_area") == 0 )
grid->type = GRID_LAEA;
......@@ -2550,18 +2548,6 @@ void cdf_set_proj_atts(int ncid, int gmapvarid, grid_t *grid)
grid->lcc2.lat_2 = datt2[1];
}
}
else if ( strcmp(attname, "grid_north_pole_latitude") == 0 )
{
cdfGetAttDouble(ncid, gmapvarid, attname, 1, &grid->rll.ypole);
}
else if ( strcmp(attname, "grid_north_pole_longitude") == 0 )
{
cdfGetAttDouble(ncid, gmapvarid, attname, 1, &grid->rll.xpole);
}
else if ( strcmp(attname, "north_pole_grid_longitude") == 0 )
{
cdfGetAttDouble(ncid, gmapvarid, attname, 1, &grid->rll.angle);
}
}
}
......
......@@ -1902,34 +1902,6 @@ void cdfDefZaxis(stream_t *streamptr, int zaxisID)
streamptr->zaxisID[zaxisindex] = dimID;
}
static
void cdfDefPole(stream_t *streamptr, int gridID)
{
int ncvarid = UNDEFID;
static const char varname[] = "rotated_pole";
static const char mapname[] = "rotated_latitude_longitude";
int fileID = streamptr->fileID;
double ypole = gridInqYpole(gridID);
double xpole = gridInqXpole(gridID);
double angle = gridInqAngle(gridID);
cdf_redef(fileID);
int ncerrcode = nc_def_var(fileID, varname, (nc_type) NC_CHAR, 0, NULL, &ncvarid);
if ( ncerrcode == NC_NOERR )
{
cdf_put_att_text(fileID, ncvarid, "grid_mapping_name", sizeof (mapname) - 1, mapname);
cdf_put_att_double(fileID, ncvarid, "grid_north_pole_latitude", NC_DOUBLE, 1, &ypole);
cdf_put_att_double(fileID, ncvarid, "grid_north_pole_longitude", NC_DOUBLE, 1, &xpole);
if ( IS_NOT_EQUAL(angle, 0) )
cdf_put_att_double(fileID, ncvarid, "north_pole_grid_longitude", NC_DOUBLE, 1, &angle);
}
cdf_enddef(fileID);
}
static
void cdf_def_mapping(stream_t *streamptr, int gridID)
{
......@@ -2091,8 +2063,6 @@ void cdfDefGrid(stream_t *streamptr, int gridID, int gridindex)
cdf_def_mapping(streamptr, gridID);
}
if ( gridIsRotated(gridID) ) cdfDefPole(streamptr, gridID);
}
else if ( gridtype == GRID_CURVILINEAR )
{
......
......@@ -37,11 +37,7 @@ int cgribexGetGridType(int *isec2)
switch (ISEC2_GridType)
{
case GRIB1_GTYPE_LATLON: { gridtype = GRID_LONLAT; break; }
#ifdef TEST_PROJECTION
case GRIB1_GTYPE_LATLON_ROT: { gridtype = GRID_PROJECTION; break; }
#else
case GRIB1_GTYPE_LATLON_ROT: { gridtype = GRID_LONLAT; break; }
#endif
case GRIB1_GTYPE_LCC: { gridtype = GRID_LCC; break; }
case GRIB1_GTYPE_GAUSSIAN: { if ( ISEC2_Reduced )
gridtype = GRID_GAUSSIAN_REDUCED;
......@@ -325,15 +321,6 @@ void cgribexGetGrid(stream_t *streamptr, int *isec2, double *fsec2, int *isec4,
Error("Unsupported grid type: %s", gridNamePtr(gridtype));
}
grid->isRotated = FALSE;
if ( cgribexGetIsRotated(isec2) )
{
grid->isRotated = TRUE;
grid->rll.xpole = ISEC2_LonSP*0.001 - 180;
grid->rll.ypole = - ISEC2_LatSP*0.001;
grid->rll.angle = - FSEC2_RotAngle;
}
grid->type = gridtype;
grid->projtype = projtype;
}
......@@ -1679,11 +1666,10 @@ void cgribexDefGrid(int *isec1, int *isec2, double *fsec2, int *isec4, int gridI
{
double xfirst = 0, xlast = 0, xinc = 0;
double yfirst = 0, ylast = 0, yinc = 0;
bool isRotated = gridIsRotated(gridID);
if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
ISEC2_GridType = GRIB1_GTYPE_GAUSSIAN;
else if ( gridtype == GRID_LONLAT && (isRotated || lrotated) )
else if ( gridtype == GRID_LONLAT && lrotated )
ISEC2_GridType = GRIB1_GTYPE_LATLON_ROT;
else
ISEC2_GridType = GRIB1_GTYPE_LATLON;
......@@ -1753,17 +1739,10 @@ void cgribexDefGrid(int *isec1, int *isec2, double *fsec2, int *isec4, int gridI
ISEC2_ResFlag = ( ISEC2_LatIncr == 0 || ISEC2_LonIncr == 0 ) ? 0 : 128;
if ( isRotated || lrotated )
if ( lrotated )
{
double xpole = 0, ypole = 0, angle = 0;
if ( isRotated )
{
xpole = gridInqXpole(gridID);
ypole = gridInqYpole(gridID);
angle = gridInqAngle(gridID);
}
else
gridInqParamRLL(gridID, &xpole, &ypole, &angle);
gridInqParamRLL(gridID, &xpole, &ypole, &angle);
ISEC2_LatSP = - (int)lround(ypole * 1000);
ISEC2_LonSP = (int)lround((xpole + 180) * 1000);
......
......@@ -1975,7 +1975,7 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
len = sizeof(mesg_gaussian_reduced) - 1;
mesg = mesg_gaussian_reduced;
}
else if ( gridtype == GRID_LONLAT && (gridIsRotated(gridID) || lrotated) )
else if ( lrotated )
{
static const char mesg_rot_lonlat[] = "rotated_ll";
len = sizeof(mesg_rot_lonlat) - 1;
......@@ -2057,17 +2057,10 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
GRIB_CHECK(my_grib_set_double(gh, "jDirectionIncrementInDegrees", latIncr), 0);
}