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

No commit message

No commit message
parent 5e05b455
......@@ -374,11 +374,11 @@ static void printGridInfo(int vlistID)
free(yvals);
}
}
else if ( gridtype == GRID_LAMBERT )
else if ( gridtype == GRID_LCC )
{
double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
gridInqLambert(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm);
gridInqLCC(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, "");
......@@ -404,7 +404,7 @@ static void printGridInfo(int vlistID)
}
if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_CELL ||
gridtype == GRID_GENERIC || gridtype == GRID_LAMBERT )
gridtype == GRID_GENERIC || gridtype == GRID_LCC )
{
if ( gridInqXvals(gridID, NULL) || gridInqYvals(gridID, NULL) || gridHasArea(gridID) ||
gridInqXbounds(gridID, NULL) || gridInqYbounds(gridID, NULL) )
......
......@@ -107,7 +107,8 @@ extern "C" {
#define GRID_TRAJECTORY 8
#define GRID_CELL 9
#define GRID_CURVILINEAR 10
#define GRID_LAMBERT 11
#define GRID_LCC 11 /* Lambert Conformal Conic */
#define GRID_LAEA 12 /* Lambert Azimuthal Equal Area */
/* ZAXIS types */
......@@ -539,8 +540,8 @@ int gridInqGMEni3(int gridID);
void gridDefGMEni3(int gridID, int ni3);
/* Lambert grid */
void gridDefLambert(int gridID, double originLon, double originLat, double lonParY, double lat1, double lat2, double xinc, double yinc);
void gridInqLambert(int gridID, double *originLon, double *originLat, double *lonParY, double *lat1, double *lat2, double *xinc, double *yinc);
void gridDefLCC(int gridID, double originLon, double originLat, double lonParY, double lat1, double lat2, double xinc, double yinc);
void gridInqLCC(int gridID, double *originLon, double *originLat, double *lonParY, double *lat1, double *lat2, double *xinc, double *yinc);
void gridDefArea(int gridID, double *area);
void gridInqArea(int gridID, double *area);
......
......@@ -179,8 +179,10 @@
PARAMETER (GRID_CELL = 9)
INTEGER GRID_CURVILINEAR
PARAMETER (GRID_CURVILINEAR = 10)
INTEGER GRID_LAMBERT
PARAMETER (GRID_LAMBERT = 11)
INTEGER GRID_LCC
PARAMETER (GRID_LCC = 11)
INTEGER GRID_LAEA
PARAMETER (GRID_LAEA = 12)
!
! ZAXIS types
!
......@@ -1210,7 +1212,7 @@
!
! Lambert grid
!
! gridDefLambert
! gridDefLCC
! (INTEGER gridID,
! DOUBLEPRECISION originLon,
! DOUBLEPRECISION originLat,
......@@ -1219,9 +1221,9 @@
! DOUBLEPRECISION lat2,
! DOUBLEPRECISION xinc,
! DOUBLEPRECISION yinc)
EXTERNAL gridDefLambert
EXTERNAL gridDefLCC
! gridInqLambert
! gridInqLCC
! (INTEGER gridID,
! DOUBLEPRECISION originLon,
! DOUBLEPRECISION originLat,
......@@ -1230,7 +1232,7 @@
! DOUBLEPRECISION lat2,
! DOUBLEPRECISION xinc,
! DOUBLEPRECISION yinc)
EXTERNAL gridInqLambert
EXTERNAL gridInqLCC
! gridDefArea
! (INTEGER gridID,
......
......@@ -260,8 +260,8 @@ FCALLSCSUB2 (gridDefGMEni3, GRIDDEFGMENI3, griddefgmeni3, INT, INT)
/* Lambert grid */
FCALLSCSUB8 (gridDefLambert, GRIDDEFLAMBERT, griddeflambert, INT, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE)
FCALLSCSUB8 (gridInqLambert, GRIDINQLAMBERT, gridinqlambert, INT, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE)
FCALLSCSUB8 (gridDefLCC, GRIDDEFLCC, griddeflcc, INT, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE)
FCALLSCSUB8 (gridInqLCC, GRIDINQLCC, gridinqlcc, INT, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE)
FCALLSCSUB2 (gridDefArea, GRIDDEFAREA, griddefarea, INT, PDOUBLE)
FCALLSCSUB2 (gridInqArea, GRIDINQAREA, gridinqarea, INT, PDOUBLE)
FCALLSCFUN1 (INT, gridHasArea, GRIDHASAREA, gridhasarea, INT)
......
......@@ -33,7 +33,7 @@
#define GTYPE_GAUSSIAN_ROT 14 /* rotated gaussian grid */
#define GTYPE_GAUSSIAN_STR 24 /* stretched gaussian grid */
#define GTYPE_GAUSSIAN_ROTSTR 34 /* rotated and stretched gaussian grid */
#define GTYPE_LAMBERT 3 /* Lambert conformal */
#define GTYPE_LCC 3 /* Lambert conformal */
#define GTYPE_SPECTRAL 50 /* spherical harmonics */
#define GTYPE_GME 192 /* hexagonal GME grid */
......
/* Generated automatically from m214003 on Wed May 21 18:03:42 CEST 2008 */
/* Generated automatically from m214003 on Wed Jul 23 15:50:19 CEST 2008 */
/* GRIBLIB_VERSION="1.2.0" */
......@@ -3023,7 +3023,7 @@ void encodeGDS(GRIBPACK *lGrib, int *gribLen, int *isec2, double *fsec2)
int gdslen = 32;
unsigned lonIncr, latIncr;
if ( ISEC2_GridType == GTYPE_LAMBERT ) gdslen += 10;
if ( ISEC2_GridType == GTYPE_LCC ) gdslen += 10;
if ( ISEC2_GridType == GTYPE_LATLON_ROT ) gdslen += 10;
......@@ -3060,7 +3060,7 @@ void encodeGDS(GRIBPACK *lGrib, int *gribLen, int *isec2, double *fsec2)
Put1Byte(ISEC2_GME_BFlag);
PutnZero(5);
}
else if ( ISEC2_GridType == GTYPE_LAMBERT )
else if ( ISEC2_GridType == GTYPE_LCC )
{
Put2Byte(ISEC2_NumLon); /* 6- 7 Longitudes */
......@@ -4189,7 +4189,7 @@ static int decodeGDS(unsigned char *gds, int *isec0, int *isec2, double *fsec2,
iret = decodeGDS_LL(gds, gdspos, isec0, isec2, imisng);
*/
}
else if ( ISEC2_GridType == GTYPE_LAMBERT )
else if ( ISEC2_GridType == GTYPE_LCC )
{
ISEC2_NumLon = GDS_NumLon;
ISEC2_NumLat = GDS_NumLat;
......@@ -8289,7 +8289,10 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
else
Warning(func, "SZ ERROR: %d code %3d level %3d", status, PDS_Parameter, PDS_Level2);
}
/*
fprintf(stderr, "gribUnzip: sl = %ld dl = %ld tl = %ld\n",
(long)sourceLen, (long)destLen,(long) tmpLen);
*/
if ( tmpLen != destLen )
Warning(func, "unzip size differ: code %3d level %3d ibuflen %ld ubuflen %ld\n",
PDS_Parameter, PDS_Level2, (long) destLen, (long) tmpLen);
......@@ -8351,7 +8354,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return (gribLen);
}
static const char grb_libvers[] = "1.2.0" " of ""May 21 2008"" ""18:03:42";
static const char grb_libvers[] = "1.2.0" " of ""Jul 23 2008"" ""15:50:19";
const char *
gribLibraryVersion(void)
{
......
......@@ -32,7 +32,8 @@ char *Grids[] = {
"trajectory",
"cell",
"curvilinear",
"lambert",
"lcc",
"laea",
};
......@@ -182,14 +183,14 @@ static void grid_init_entry(GRID *gridptr)
gridptr->nrowlon = 0;
gridptr->xinc = 0.0;
gridptr->yinc = 0.0;
gridptr->lam_originLon = 0.0;
gridptr->lam_originLat = 0.0;
gridptr->lam_lonParY = 0.0;
gridptr->lam_lat1 = 0.0;
gridptr->lam_lat2 = 0.0;
gridptr->lam_xinc = 0.0;
gridptr->lam_yinc = 0.0;
gridptr->lam_defined = FALSE;
gridptr->lcc_originLon = 0.0;
gridptr->lcc_originLat = 0.0;
gridptr->lcc_lonParY = 0.0;
gridptr->lcc_lat1 = 0.0;
gridptr->lcc_lat2 = 0.0;
gridptr->lcc_xinc = 0.0;
gridptr->lcc_yinc = 0.0;
gridptr->lcc_defined = FALSE;
gridptr->trunc = 0;
gridptr->nvertex = 0;
gridptr->nd = 0;
......@@ -579,7 +580,7 @@ static void defineYvals(int gridID)
@Parameter
@Item gridtype The type of the grid, one of the set of predefined CDI grid types.
The valid CDI grid types are @func{GRID_GENERIC}, @func{GRID_GAUSSIAN},
@func{GRID_LONLAT}, @func{GRID_LAMBERT}, @func{GRID_SPECTRAL},
@func{GRID_LONLAT}, @func{GRID_LCC}, @func{GRID_SPECTRAL},
@func{GRID_GME}, @func{GRID_CURVILINEAR} and @func{GRID_CELL}.
@Item size Number of gridpoints.
......@@ -1072,7 +1073,7 @@ The function @func{gridInqType} returns the type of a Grid.
@func{gridInqType} returns the type of the grid,
one of the set of predefined CDI grid types.
The valid CDI grid types are @func{GRID_GENERIC}, @func{GRID_GAUSSIAN},
@func{GRID_LONLAT}, @func{GRID_LAMBERT}, @func{GRID_SPECTRAL}, @func{GRID_GME},
@func{GRID_LONLAT}, @func{GRID_LCC}, @func{GRID_SPECTRAL}, @func{GRID_GME},
@func{GRID_CURVILINEAR} and @func{GRID_CELL}.
@EndFunction
......@@ -2311,7 +2312,7 @@ int gridGenerate(GRID grid)
case GRID_CELL:
case GRID_CURVILINEAR:
case GRID_GENERIC:
case GRID_LAMBERT:
case GRID_LCC:
{
if ( grid.xsize > 0 ) gridDefXsize(gridID, grid.xsize);
if ( grid.ysize > 0 ) gridDefYsize(gridID, grid.ysize);
......@@ -2374,9 +2375,9 @@ int gridGenerate(GRID grid)
gridDefArea(gridID, grid.area);
}
if ( grid.type == GRID_LAMBERT )
gridDefLambert(gridID, grid.lam_originLon, grid.lam_originLat, grid.lam_lonParY,
grid.lam_lat1, grid.lam_lat2, grid.lam_xinc, grid.lam_yinc);
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);
break;
}
......@@ -3148,10 +3149,10 @@ void gridPrint(int gridID, int opt)
free(rowlon);
break;
}
case GRID_LAMBERT:
case GRID_LCC:
{
double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
gridInqLambert(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm);
gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm);
fprintf(fp, "xsize : %d\n", xsize);
fprintf(fp, "ysize : %d\n", ysize);
......@@ -3416,7 +3417,7 @@ int gridToCurvilinear(int gridID1)
{
case GRID_LONLAT:
case GRID_GAUSSIAN:
case GRID_LAMBERT:
case GRID_LCC:
{
int i, j, nx, ny;
double *xvals = NULL, *yvals = NULL;
......@@ -3434,23 +3435,23 @@ int gridToCurvilinear(int gridID1)
yvals2D = (double *) malloc(gridsize*sizeof(double));
if ( gridtype == GRID_LAMBERT )
if ( gridtype == GRID_LCC )
{
double xi, xj;
double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
double zlat, zlon;
int status;
gridInqLambert(gridID1, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm);
gridInqLCC(gridID1, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm);
/*
while ( originLon < 0 ) originLon += 360;
while ( lonParY < 0 ) lonParY += 360;
*/
if ( ! DBL_IS_EQUAL(xincm, yincm) )
Warning(func, "X and Y increment must be equal on Lambert grid (Xinc = %g, Yinc = %g)\n",
Warning(func, "X and Y increment must be equal on Lambert Conformal grid (Xinc = %g, Yinc = %g)\n",
xincm, yincm);
if ( ! DBL_IS_EQUAL(lat1, lat2) )
Warning(func, "Lat1 and Lat2 must be equal on Lambert grid (Lat1 = %g, Lat2 = %g)\n",
Warning(func, "Lat1 and Lat2 must be equal on Lambert Conformal grid (Lat1 = %g, Lat2 = %g)\n",
lat1, lat2);
for ( j = 0; j < ny; j++ )
......@@ -3505,7 +3506,7 @@ int gridToCurvilinear(int gridID1)
free(xvals2D);
free(yvals2D);
if ( gridtype == GRID_LAMBERT )
if ( gridtype == GRID_LCC )
{
double xi, xj;
double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
......@@ -3513,7 +3514,7 @@ int gridToCurvilinear(int gridID1)
int status;
int index;
gridInqLambert(gridID1, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm);
gridInqLCC(gridID1, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm);
xbounds2D = (double *) malloc(4*gridsize*sizeof(double));
ybounds2D = (double *) malloc(4*gridsize*sizeof(double));
......@@ -3825,10 +3826,10 @@ const double *gridInqYvalsPtr(int gridID)
/*
@Function gridDefLambert
@Title Define the parameter of a Lambert grid
@Function gridDefLCC
@Title Define the parameter of a Lambert Conformal Conic grid
@Prototype void gridDefLambert(int gridID, double originLon, double originLat, double lonParY, double lat1, double lat2, double xinc, double yinc)
@Prototype void gridDefLCC(int gridID, double originLon, double originLat, double lonParY, double lat1, double lat2, double xinc, double yinc)
@Parameter
@Item gridID Grid ID, from a previous call to @fref{gridCreate}
@Item originLon Longitude of the first grid point
......@@ -3840,39 +3841,39 @@ const double *gridInqYvalsPtr(int gridID)
@Item yinc Y-direction grid lenght in meter
@Description
The function @func{gridDefLambert} defines the parameter of a Lambert grid.
The function @func{gridDefLCC} defines the parameter of a Lambert Conformal Conic grid.
@EndFunction
*/
void gridDefLambert(int gridID, double originLon, double originLat, double lonParY,
void gridDefLCC(int gridID, double originLon, double originLat, double lonParY,
double lat1, double lat2, double xinc, double yinc)
{
static char func[] = "gridDefLambert";
static char func[] = "gridDefLCC";
GRID *gridptr;
gridptr = grid_to_pointer(gridID);
if ( gridptr->type != GRID_LAMBERT )
Warning(func, "Lambert grid definition for %s grid not allowed!", gridNamePtr(gridptr->type));
if ( gridptr->type != GRID_LCC )
Warning(func, "Lambert Conformal grid definition for %s grid not allowed!", gridNamePtr(gridptr->type));
else
{
gridptr->lam_originLon = originLon;
gridptr->lam_originLat = originLat;
gridptr->lam_lonParY = lonParY;
gridptr->lam_lat1 = lat1;
gridptr->lam_lat2 = lat2;
gridptr->lam_xinc = xinc;
gridptr->lam_yinc = yinc;
gridptr->lam_defined = TRUE;
gridptr->lcc_originLon = originLon;
gridptr->lcc_originLat = originLat;
gridptr->lcc_lonParY = lonParY;
gridptr->lcc_lat1 = lat1;
gridptr->lcc_lat2 = lat2;
gridptr->lcc_xinc = xinc;
gridptr->lcc_yinc = yinc;
gridptr->lcc_defined = TRUE;
}
}
/*
@Function gridInqLambert
@Title Get the parameter of a Lambert grid
@Function gridInqLCC
@Title Get the parameter of a Lambert Conformal Conic grid
@Prototype void gridInqLambert(int gridID, double *originLon, double *originLat, double *lonParY, double *lat1, double *lat2, double *xinc, double *yinc)
@Prototype void gridInqLCC(int gridID, double *originLon, double *originLat, double *lonParY, double *lat1, double *lat2, double *xinc, double *yinc)
@Parameter
@Item gridID Grid ID, from a previous call to @fref{gridCreate}
@Item originLon Longitude of the first grid point
......@@ -3884,34 +3885,34 @@ void gridDefLambert(int gridID, double originLon, double originLat, double lonPa
@Item yinc Y-direction grid lenght in meter
@Description
The function @func{gridInqLambert} returns the parameter of a Lambert grid.
The function @func{gridInqLCC} returns the parameter of a Lambert Conformal Conic grid.
@EndFunction
*/
void gridInqLambert(int gridID, double *originLon, double *originLat, double *lonParY,
void gridInqLCC(int gridID, double *originLon, double *originLat, double *lonParY,
double *lat1, double *lat2, double *xinc, double *yinc)
{
static char func[] = "gridDefLambert";
static char func[] = "gridDefLCC";
GRID *gridptr;
gridptr = grid_to_pointer(gridID);
if ( gridptr->type != GRID_LAMBERT )
Warning(func, "Lambert grid definition for %s grid not available!", gridNamePtr(gridptr->type));
if ( gridptr->type != GRID_LCC )
Warning(func, "Lambert Conformal grid definition for %s grid not available!", gridNamePtr(gridptr->type));
else
{
if ( gridptr->lam_defined )
if ( gridptr->lcc_defined )
{
*originLon = gridptr->lam_originLon;
*originLat = gridptr->lam_originLat;
*lonParY = gridptr->lam_lonParY;
*lat1 = gridptr->lam_lat1;
*lat2 = gridptr->lam_lat2;
*xinc = gridptr->lam_xinc;
*yinc = gridptr->lam_yinc;
*originLon = gridptr->lcc_originLon;
*originLat = gridptr->lcc_originLat;
*lonParY = gridptr->lcc_lonParY;
*lat1 = gridptr->lcc_lat1;
*lat2 = gridptr->lcc_lat2;
*xinc = gridptr->lcc_xinc;
*yinc = gridptr->lcc_yinc;
}
else
Warning(func, "Lambert grid undefined (gridID = %d)", gridID);
Warning(func, "Lambert Conformal grid undefined (gridID = %d)", gridID);
}
}
......@@ -15,14 +15,14 @@ typedef struct {
double xfirst, yfirst;
double xlast, ylast;
double xinc, yinc;
double lam_originLon; /* lambert */
double lam_originLat;
double lam_lonParY;
double lam_lat1;
double lam_lat2;
double lam_xinc;
double lam_yinc;
int lam_defined;
double lcc_originLon; /* lambert conformal conic */
double lcc_originLat;
double lcc_lonParY;
double lcc_lat1;
double lcc_lat2;
double lcc_xinc;
double lcc_yinc;
int lcc_defined;
double xpole, ypole, angle; /* rotated north pole */
int isCyclic; /* TRUE for global cyclic grids */
int isRotated; /* TRUE for rotated grids */
......@@ -70,7 +70,7 @@ double phs_to_ph(double phis, double rlas, double polphi);
double rl_to_rls(double phi, double rla, double polphi, double pollam);
double ph_to_phs(double phi, double rla, double polphi, double pollam);
/* Lambert grid */
/* Lambert Conformal grid */
int W3FB12(double xi, double xj, double alat1, double elon1, double dx,
double elonv, double alatan, double *alat, double *elon);
#endif
......@@ -48,9 +48,9 @@ int gribGetGridType(int *isec2)
gridtype = GRID_LONLAT;
break;
}
case GTYPE_LAMBERT:
case GTYPE_LCC:
{
gridtype = GRID_LAMBERT;
gridtype = GRID_LCC;
break;
}
case GTYPE_GAUSSIAN:
......@@ -172,7 +172,7 @@ int grbInqRecord(int streamID, int *varID, int *levelID)
}
case GRID_SPECTRAL:
case GRID_GME:
case GRID_LAMBERT:
case GRID_LCC:
{
break;
}
......@@ -838,7 +838,7 @@ void grbAddRecord(int streamID, int code, int *isec1, int *isec2, double *fsec2,
}
break;
}
case GRID_LAMBERT:
case GRID_LCC:
{
if ( ISEC4_NumValues != ISEC2_NumLon*ISEC2_NumLat )
Error(func, "wrong datasize! isec4len = %d isec2len = %d",
......@@ -848,13 +848,13 @@ void grbAddRecord(int streamID, int code, int *isec1, int *isec2, double *fsec2,
grid.xsize = ISEC2_NumLon;
grid.ysize = ISEC2_NumLat;
grid.lam_xinc = ISEC2_Xinc;
grid.lam_yinc = ISEC2_Yinc;
grid.lam_originLon = ISEC2_FirstLon * 0.001;
grid.lam_originLat = ISEC2_FirstLat * 0.001;
grid.lam_lonParY = ISEC2_LoV * 0.001;
grid.lam_lat1 = ISEC2_LatS1 * 0.001;
grid.lam_lat2 = ISEC2_LatS2 * 0.001;
grid.lcc_xinc = ISEC2_Xinc;
grid.lcc_yinc = ISEC2_Yinc;
grid.lcc_originLon = ISEC2_FirstLon * 0.001;
grid.lcc_originLat = ISEC2_FirstLat * 0.001;
grid.lcc_lonParY = ISEC2_LoV * 0.001;
grid.lcc_lat1 = ISEC2_LatS1 * 0.001;
grid.lcc_lat2 = ISEC2_LatS2 * 0.001;
grid.xdef = 0;
grid.ydef = 0;
......@@ -1940,7 +1940,7 @@ void grbDefGrid(int *isec1, int *isec2, int gridID)
break;
}
case GRID_LAMBERT:
case GRID_LCC:
{
double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
int xsize, ysize;
......@@ -1948,9 +1948,9 @@ void grbDefGrid(int *isec1, int *isec2, int gridID)
xsize = gridInqXsize(gridID);
ysize = gridInqYsize(gridID);
gridInqLambert(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm);
gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm);
ISEC2_GridType = GTYPE_LAMBERT;
ISEC2_GridType = GTYPE_LCC;
ISEC2_NumLon = xsize;
ISEC2_NumLat = ysize;
ISEC2_FirstLon = NINT(originLon * 1000);
......
Markdown is supported
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