Commit 78f222c9 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

add support for GRID type LAEA

parent 4e02e382
......@@ -267,6 +267,7 @@ static void printGridInfo(int vlistID)
gridID+1, gridNamePtr(gridtype));
if ( gridtype == GRID_LONLAT ||
gridtype == GRID_LAEA ||
gridtype == GRID_SINUSOIDAL ||
gridtype == GRID_GAUSSIAN ||
gridtype == GRID_GAUSSIAN_REDUCED )
......@@ -301,7 +302,8 @@ static void printGridInfo(int vlistID)
}
fprintf(stdout, "%*s", nbyte0, "");
fprintf(stdout, "%-9s : first = %.9g last = %.9g", yname, yfirst, ylast);
if ( !DBL_IS_EQUAL(yinc, 0) && (gridtype == GRID_LONLAT || gridtype == GRID_SINUSOIDAL) )
if ( !DBL_IS_EQUAL(yinc, 0) &&
(gridtype == GRID_LONLAT || gridtype == GRID_SINUSOIDAL || gridtype == GRID_LAEA) )
fprintf(stdout, " inc = %.9g", yinc);
fprintf(stdout, " %s", yunits);
fprintf(stdout, "\n");
......@@ -323,6 +325,14 @@ static void printGridInfo(int vlistID)
if ( gridInqYbounds(gridID, NULL) ) fprintf(stdout, " ybounds");
fprintf(stdout, "\n");
}
if ( gridtype == GRID_LAEA )
{
double a, lon_0, lat_0;
gridInqLaea(gridID, &a, &lon_0, &lat_0);
fprintf(stdout, "%*s", nbyte0, "");
fprintf(stdout, "projpar : a = %g lon_0 = %g lat_0 = %g\n", a, lon_0, lat_0);
}
}
else if ( gridtype == GRID_SPECTRAL )
{
......
......@@ -2430,6 +2430,9 @@ int gridGenerate(grid_t grid)
gridDefArea(gridID, grid.area);
}
if ( grid.type == GRID_LAEA )
gridDefLaea(gridID, grid.laea_a, grid.laea_lon_0, grid.laea_lat_0);
if ( grid.type == GRID_LCC )
gridDefLCC(gridID, grid.lcc_originLon, grid.lcc_originLat, grid.lcc_lonParY,
grid.lcc_lat1, grid.lcc_lat2, grid.lcc_xinc, grid.lcc_yinc,
......
......@@ -4956,6 +4956,18 @@ int cdfInqContents(int streamID)
else if ( strcmp(attstring, "lambert_azimuthal_equal_area") == 0 )
grid.type = GRID_LAEA;
}
else if ( strcmp(attname, "earth_radius") == 0 )
{
cdfGetAttDouble(fileID, ncvars[ncvarid].gmapid, attname, 1, &grid.laea_a);
}
else if ( strcmp(attname, "longitude_of_projection_origin") == 0 )
{
cdfGetAttDouble(fileID, ncvars[ncvarid].gmapid, attname, 1, &grid.laea_lon_0);
}
else if ( strcmp(attname, "latitude_of_projection_origin") == 0 )
{
cdfGetAttDouble(fileID, ncvars[ncvarid].gmapid, attname, 1, &grid.laea_lat_0);
}
else if ( strcmp(attname, "grid_north_pole_latitude") == 0 )
{
cdfGetAttDouble(fileID, ncvars[ncvarid].gmapid, attname, 1, &grid.ypole);
......
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