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

cgribex rotated grids: added support for parameter >angle< (bug fix)

parent 18850d93
......@@ -2,6 +2,11 @@
* Version 1.6.9 released
2015-04-22 Uwe Schulzweida
* cgribex rotated grids: added support for parameter >angle< (bug fix)
* netcdf rotated grids: bug fix for negative angles
2015-04-21 Uwe Schulzweida
* dmemory.c: merge changes from branches/cdi-tilesAndFileDrivenInput
......
......@@ -152,7 +152,7 @@ int cgribexGetTsteptype(int timerange)
}
static
void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, int iret)
void cgribexGetGrid(stream_t *streamptr, int *isec2, double *fsec2, int *isec4, grid_t *grid, int iret)
{
int compyinc = TRUE;
int gridtype = cgribexGetGridType(isec2);
......@@ -348,7 +348,7 @@ void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, i
grid->isRotated = TRUE;
grid->ypole = - ISEC2_LatSP*0.001;
grid->xpole = ISEC2_LonSP*0.001 - 180;
grid->angle = 0;
grid->angle = FSEC2_RotAngle;
}
grid->xvals = NULL;
......@@ -385,7 +385,7 @@ void cgribexAddRecord(stream_t * streamptr, int param, int *isec1, int *isec2, d
record->ltype = ISEC1_LevelType;
record->tsteptype = tsteptype;
cgribexGetGrid(streamptr, isec2, isec4, &grid, iret);
cgribexGetGrid(streamptr, isec2, fsec2, isec4, &grid, iret);
int gridID = varDefGrid(vlistID, &grid, 0);
......@@ -1602,7 +1602,7 @@ void cgribexDefTime(int *isec1, int vdate, int vtime, int tsteptype, int numavg,
}
static
void cgribexDefGrid(int *isec1, int *isec2, int *isec4, int gridID)
void cgribexDefGrid(int *isec1, int *isec2, double *fsec2, int *isec4, int gridID)
{
int gridtype;
bool lcurvi = false;
......@@ -1765,6 +1765,7 @@ void cgribexDefGrid(int *isec1, int *isec2, int *isec4, int gridID)
{
ISEC2_LatSP = - (int)lround(gridInqYpole(gridID) * 1000);
ISEC2_LonSP = (int)lround((gridInqXpole(gridID) + 180) * 1000);
FSEC2_RotAngle = gridInqAngle(gridID);
}
/* East -> West */
......@@ -2199,7 +2200,7 @@ size_t cgribexEncode(int memtype, int varID, int levelID, int vlistID, int gridI
cgribexDefParam(isec1, param);
cgribexDefTime(isec1, vdate, vtime, tsteptype, numavg, vlistInqTaxis(vlistID));
cgribexDefGrid(isec1, isec2, isec4, gridID);
cgribexDefGrid(isec1, isec2, fsec2, isec4, gridID);
cgribexDefLevel(isec1, isec2, fsec2, zaxisID, levelID);
cgribexDefEnsembleVar(isec1, vlistID, varID);
......
Markdown is supported
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