Commit 5e0b6bb5 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added support for rotated grids on south pole

parent b7c47912
2009-??-?? Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* add env CDI_SORTNAME to sort netCDF names
* added env CDI_SORTNAME to sort netCDF names
* added support for rotated grids on south pole [request: Beate Geyer]
* timeval2vtime: bug fix for timeunit TUNIT_MONTH
* streamSync: extent to non netCDF files
* Version 1.3.2 released
2009-04-16 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* using GRIB library version 1.3.0
* add support for NaN in DBL_IS_EQUAL
* add support for GRID type LCC2 (LCC PROJ.4 version)
* add support for TUNIT_QUARTER (15 minutes)
* added support for NaN in DBL_IS_EQUAL
* added support for GRID type LCC2 (LCC PROJ.4 version)
* added support for TUNIT_QUARTER (15 minutes)
* use env GRIB_INVENTORY_MODE=timestep to skip double entries
* grbDefTime: define tunit also for absolute time [report: Pruek Pongprueksa]
* set default calendar with env CDI_DEFAULT_CALENDAR
......
......@@ -534,6 +534,8 @@ double gridInqYpole(int gridID);
void gridDefYpole(int gridID, double ypole);
double gridInqAngle(int gridID);
void gridDefAngle(int gridID, double angle);
double gridInqNpole(int gridID);
void gridDefNpole(int gridID, double npole);
void gridDefTrunc(int gridID, int trunc);
int gridInqTrunc(int gridID);
/* Hexagonal GME grid */
......
......@@ -3153,6 +3153,7 @@ void gridPrint(int gridID, int opt)
{
if ( xsize > 0 ) fprintf(fp, "xnpole = %g\n", gridptr->xpole);
if ( ysize > 0 ) fprintf(fp, "ynpole = %g\n", gridptr->ypole);
if ( gridptr->angle > 0 ) fprintf(fp, "angle = %g\n", gridptr->angle);
}
if ( xvals )
......
......@@ -2212,7 +2212,7 @@ void cdfDefPole(int streamID, int gridID)
int fileID;
int ncvarid = UNDEFID;
int ncerr;
double xpole, ypole;
double xpole, ypole, angle;
char varname[] = "rotated_pole";
char mapname[] = "rotated_latitude_longitude";
......@@ -2220,6 +2220,7 @@ void cdfDefPole(int streamID, int gridID)
ypole = gridInqYpole(gridID);
xpole = gridInqXpole(gridID);
angle = gridInqAngle(gridID);
cdf_redef(fileID);
......@@ -2229,6 +2230,8 @@ void cdfDefPole(int streamID, int gridID)
cdf_put_att_text(fileID, ncvarid, "grid_mapping_name", strlen(mapname), mapname);
cdf_put_att_double(fileID, ncvarid, "grid_north_pole_latitude", NC_DOUBLE, 1L, &ypole);
cdf_put_att_double(fileID, ncvarid, "grid_north_pole_longitude", NC_DOUBLE, 1L, &xpole);
if ( angle > 0 )
cdf_put_att_double(fileID, ncvarid, "north_pole_grid_longitude", NC_DOUBLE, 1L, &angle);
}
cdf_enddef(fileID);
......@@ -2421,7 +2424,7 @@ int cdfDefVar(int streamID, int varID)
char *stdname = NULL;
char *units = NULL;
int dims[4];
size_t chunks[4];
size_t chunks[4] = {0,0,0,0};
int tableID;
int ndims = 0;
int len;
......@@ -5129,9 +5132,11 @@ int cdfInqContents(int streamID)
{
cdfGetAttDouble(fileID, ncvars[ncvarid].gmapid, attname, 1, &grid.xpole);
}
else if ( strcmp(attname, "north_pole_grid_longitude") == 0 )
{
cdfGetAttDouble(fileID, ncvars[ncvarid].gmapid, attname, 1, &grid.angle);
}
}
grid.angle = 0.0;
}
if ( CDI_Debug )
......
......@@ -1021,15 +1021,19 @@ void timeval2vtime(double timevalue, TAXIS *taxis, int *vdate, int *vtime)
if ( timeunit == TUNIT_MONTH || timeunit == TUNIT_YEAR )
{
int nmon;
if ( timeunit == TUNIT_YEAR ) timevalue *= 12;
if ( (NINT(timevalue*10))%10 && lwarn )
{
Warning(func, "Possible wrong calculation of date/time!\nTime offset must be integer for time unit MONTH and YEAR!");
Warning(func, "Possible wrong calculation of date/time!\n"
"Time offset isn't integer for time unit MONTH and YEAR!");
lwarn = FALSE;
}
month += NINT(timevalue);
nmon = (int) (timevalue+0.001);
month += nmon;
while ( month > 12 ) { month -= 12; year++; }
while ( month < 1 ) { month += 12; year--; }
......
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