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

grbDefGrid: add Lambert support

parent 61deacdd
......@@ -352,7 +352,9 @@ static void printGridInfo(int vlistID)
else if ( gridtype == GRID_LAMBERT )
{
double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
gridInqLambert(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm);
fprintf(stdout, "size : dim = %d nx = %d ny = %d\n", gridsize, xsize, ysize);
fprintf(stdout, "%*s", nbyte0, "");
fprintf(stdout, " originLon = %g originLat = %g lonParY = %g\n",
......
......@@ -1778,6 +1778,8 @@ void grbDefGrid(int *isec1, int *isec2, int gridID)
static char func[] = "grbDefGrid";
int gridtype;
memset(isec2, 0, 16*sizeof(int));
ISEC1_Sec2Or3Flag = 128;
gridtype = gridInqType(gridID);
......@@ -1840,11 +1842,11 @@ void grbDefGrid(int *isec1, int *isec2, int gridID)
nlat = gridInqYsize(gridID);
if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
ISEC2_GridType = 4;
ISEC2_GridType = GTYPE_GAUSSIAN;
else if ( gridtype == GRID_LONLAT && gridIsRotated(gridID) )
ISEC2_GridType = 10;
ISEC2_GridType = GTYPE_LATLON_ROT;
else
ISEC2_GridType = 0;
ISEC2_GridType = GTYPE_LATLON;
ISEC2_NumLon = nlon;
ISEC2_NumLat = nlat;
......@@ -1884,11 +1886,34 @@ void grbDefGrid(int *isec1, int *isec2, int gridID)
/* South -> North */
if ( ISEC2_LastLat > ISEC2_FirstLat ) ISEC2_ScanFlag += 64;
break;
}
case GRID_LAMBERT:
{
double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
int xsize, ysize;
xsize = gridInqXsize(gridID);
ysize = gridInqYsize(gridID);
gridInqLambert(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm);
ISEC2_GridType = GTYPE_LAMBERT;
ISEC2_NumLon = xsize;
ISEC2_NumLat = ysize;
ISEC2_FirstLon = NINT(originLon * 1000);
ISEC2_FirstLat = NINT(originLat * 1000);
ISEC2_LoV = NINT(lonParY * 1000);
ISEC2_LatS1 = NINT(lat1 * 1000);
ISEC2_LatS2 = NINT(lat2 * 1000);
ISEC2_Xinc = NINT(xincm);
ISEC2_Yinc = NINT(yincm);
break;
}
case GRID_SPECTRAL:
{
ISEC2_GridType = 50;
ISEC2_GridType = GTYPE_SPECTRAL;
ISEC2_PentaJ = gridInqTrunc(gridID);
ISEC2_PentaK = ISEC2_PentaJ;
ISEC2_PentaM = ISEC2_PentaJ;
......@@ -1898,7 +1923,7 @@ void grbDefGrid(int *isec1, int *isec2, int gridID)
}
case GRID_GME:
{
ISEC2_GridType = 192;
ISEC2_GridType = GTYPE_GME;
ISEC2_GME_ND = gridInqGMEnd(gridID);
ISEC2_GME_NI = gridInqGMEni(gridID);
ISEC2_GME_NI2 = gridInqGMEni2(gridID);
......
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