Commit 1b0ebd86 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

gridFromName: define GRID with one point lon=<LON>_lat=<LAT>

parent 27a64932
......@@ -3,6 +3,7 @@
* using CDI library version 1.3.1
* add support for GRID type Lambert Conformal Conic
* Sinusoidal and Lambert Azimuthal Equal Area grids with units [km]
* gridFromName: define GRID with one point lon=<LON>_lat=<LAT>
* remap: read grid corners only if needed
* Version 1.3.1 released
......
......@@ -1509,6 +1509,7 @@ int compNlon(int nlat)
int gridFromName(const char *gridname)
{
static char func[] = "gridFromName";
const char *pline;
int gridID = UNDEFID;
GRID grid;
......@@ -1571,6 +1572,28 @@ int gridFromName(const char *gridname)
grid.def_yfirst = TRUE;
}
}
else if ( gridname[0] == 'l' && gridname[1] == 'o' && gridname[2] == 'n' ) /* lon=<LON>_lat=<LAT> */
{
/* only one gridpoint */
pline = &gridname[3];
if ( *pline == '=' ) pline++;
if ( isdigit((int) *pline) )
{
grid.type = GRID_LONLAT;
grid.xsize = 1;
grid.ysize = 1;
grid.xvals = (double *) malloc(sizeof(double));
grid.yvals = (double *) malloc(sizeof(double));
grid.xvals[0] = atof(pline);
while ( isdigit((int) *pline) || ispunct((int) *pline) || *pline == '-' ) pline++;
if ( *pline == '_' ) pline++;
if ( ! (pline[0] == 'l' && pline[1] == 'a' && pline[2] == 't') ) return(gridID);
pline += 3;
if ( *pline == '=' ) pline++;
if ( ! isdigit((int) *pline) ) return(gridID);
grid.yvals[0] = atof(pline);
}
}
else if ( gridname[0] == 'g' && gridname[1] == 'm' && gridname[2] == 'e' ) /* gme<NI> */
{
pline = &gridname[3];
......
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