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

Added support for grid flag uvRelativeToGrid.

parent 624fd9ca
......@@ -3,6 +3,10 @@
* Using CDI library version 1.8.1
* Version 1.8.1 release
2017-02-27 Uwe Schulzweida
* Added support for grid flag uvRelativeToGrid
2017-02-24 Uwe Schulzweida
* New operator usegridnumber (patch from Michal Koutek, KMNI)
......
......@@ -334,6 +334,11 @@ void grid_print_kernel(int gridID, int opt, FILE *fp)
Free(rowlon);
}
int uvRelativeToGrid = gridInqUvRelativeToGrid(gridID);
if ( uvRelativeToGrid > 0 )
fprintf(fp, "uvRelativeToGrid = %d\n", uvRelativeToGrid);
if ( type == GRID_PROJECTION )
{
attstr[0] = 0; cdiGridInqKeyStr(gridID, CDI_KEY_MAPPING, CDI_MAX_NAME, attstr);
......@@ -364,7 +369,13 @@ void grid_print_kernel(int gridID, int opt, FILE *fp)
dig, originLon, dig, originLat, dig, lonParY,
dig, lat1, dig, lat2, dig, xincm, dig, yincm,
(projflag & 128) == 0 ? "northpole" : "southpole");
break;
int uvRelativeToGrid = gridInqUvRelativeToGrid(gridID);
if ( uvRelativeToGrid > 0 )
fprintf(fp, "uvRelativeToGrid = %d\n", uvRelativeToGrid);
break;
}
case GRID_SPECTRAL:
{
......@@ -408,12 +419,7 @@ void grid_print_kernel(int gridID, int opt, FILE *fp)
static const char prefix[] = "mask = ";
printMask(fp, prefix, sizeof(prefix)-1, (size_t)(gridsize > 0 ? gridsize : 0), mask);
if ( mask ) Free(mask);
}
int uvRelativeToGrid = gridInqUvRelativeToGrid(gridID);
if ( uvRelativeToGrid > 0 )
fprintf(fp, "uvRelativeToGrid = %d\n", uvRelativeToGrid);
}
int projID = gridInqProj(gridID);
if ( projID != CDI_UNDEFID && gridInqType(projID) == GRID_PROJECTION )
......
......@@ -133,11 +133,12 @@ void grid_read_data(size_t ikv, size_t nkv, kvmap_t *kvmap, griddes_t *grid, siz
else if ( STR_IS_EQ(key, "lat_0") ) { grid->lat_0 = parameter2double(value); grid->def_lat_0 = true; }
else if ( STR_IS_EQ(key, "lat_1") ) { grid->lat_1 = parameter2double(value); grid->def_lat_1 = true; }
else if ( STR_IS_EQ(key, "lat_2") ) { grid->lat_2 = parameter2double(value); grid->def_lat_2 = true; }
else if ( STR_IS_EQ(key, "a") ) grid->a = parameter2double(value);
else if ( STR_IS_EQ(key, "a") ) grid->a = parameter2double(value);
else if ( STR_IS_EQ(key, "uvRelativeToGrid") ) grid->uvRelativeToGrid = parameter2bool(value);
else if ( STR_IS_EQ(key, "projection") )
{
if ( STR_IS_EQ(value, "north") ) { grid->projflag = 0; grid->scanflag = 64; }
else if ( STR_IS_EQ(value, "south") ) { grid->projflag = 128; grid->scanflag = 64; }
if ( STR_IS_EQ(value, "northpole") ) { grid->projflag = 0; grid->scanflag = 64; }
else if ( STR_IS_EQ(value, "southpole") ) { grid->projflag = 128; grid->scanflag = 64; }
else cdoAbort("Invalid projection : %s (grid description file: %s)", value, dname);
}
else if ( STR_IS_EQ(key, "xvals") )
......
......@@ -26,6 +26,7 @@ typedef struct {
bool def_lonParY;
bool def_lat1;
bool def_lat2;
bool uvRelativeToGrid;
double a;
double lon_0;
double lat_0;
......
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