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