Commit 6afc69e9 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added interface functions gridDefNP/gridInqNP

parent bed05cd9
2012-01-06 Luis Kornblueh <Luis.Kornblueh@zmaw.de>
* added interface functions gridDefNP/gridInqNP (number of parallels between a pole and the equator)
2011-12-19 Luis Kornblueh <Luis.Kornblueh@zmaw.de>
* added suppport for GRIB2 level type 150
......
......@@ -543,6 +543,12 @@ void gridDefYsize(int gridID, int ysize);
/* gridInqYsize: Get the size of a Y-axis */
int gridInqYsize(int gridID);
/* gridDefNP: Define the number of parallels between a pole and the equator */
void gridDefNP(int gridID, int np);
/* gridInqNP: Get the number of parallels between a pole and the equator */
int gridInqNP(int gridID);
/* gridDefXvals: Define the values of a X-axis */
void gridDefXvals(int gridID, const double *xvals_vec);
......
......@@ -216,6 +216,7 @@ void grid_init(grid_t *gridptr)
gridptr->size = 0;
gridptr->xsize = 0;
gridptr->ysize = 0;
gridptr->np = 0;
gridptr->xdef = 0;
gridptr->ydef = 0;
gridptr->isCyclic = CDI_UNDEFID;
......@@ -1219,7 +1220,7 @@ void gridDefXsize(int gridID, int xsize)
gridptr->xsize = xsize;
if ( gridInqType(gridID) != GRID_UNSTRUCTURED &&
if ( gridInqType(gridID) != GRID_UNSTRUCTURED &&
gridptr->xsize*gridptr->ysize > gridInqSize(gridID) )
Error("inconsistent grid declaration! (xsize %d ysize %d gridsize %d)",
gridptr->xsize, gridptr->ysize, gridInqSize(gridID));
......@@ -1227,10 +1228,10 @@ void gridDefXsize(int gridID, int xsize)
/*
@Function
@Title
@Function
@Title
@Prototype
@Prototype
@Parameter
@Item Grid identifier
......@@ -1297,7 +1298,6 @@ int gridInqXsize(int gridID)
return (gridptr->xsize);
}
/*
@Function gridDefYsize
@Title Define the number of values of a Y-axis
......@@ -1334,7 +1334,6 @@ void gridDefYsize(int gridID, int ysize)
gridptr->xsize, gridptr->ysize, gridInqSize(gridID));
}
/*
@Function gridInqYsize
@Title Get the number of values of a Y-axis
......@@ -1362,6 +1361,59 @@ int gridInqYsize(int gridID)
return (gridptr->ysize);
}
/*
@Function gridDefNP
@Title Define the number of parallels between a pole and the equator
@Prototype void gridDefNP(int gridID, int np)
@Parameter
@Item gridID Grid ID, from a previous call to @fref{gridCreate}.
@Item np Number of parallels between a pole and the equator
@Description
The function @func{gridDefNP} defines the number of parallels between a pole and the equator.
@EndFunction
*/
void gridDefNP(int gridID, int np)
{
grid_t *gridptr;
gridptr = grid_to_pointer(gridID);
grid_check_ptr(gridID, gridptr);
gridptr->np = np;
}
/*
@Function gridInqNP
@Title Get the number of parallels between a pole and the equator
@Prototype void gridInqNP(int gridID)
@Parameter
@Item gridID Grid ID, from a previous call to @fref{gridCreate}.
@Description
The function @func{gridInqNP} returns the number of parallels between a pole and the equator
of a Gaussian grid.
@Result
@func{gridInqNP} returns the number of parallels between a pole and the equator.
@EndFunction
*/
int gridInqNP(int gridID)
{
grid_t *gridptr;
gridptr = grid_to_pointer(gridID);
grid_check_ptr(gridID, gridptr);
return (gridptr->np);
}
/*
@Function
......
......@@ -46,14 +46,15 @@ typedef struct {
int nd, ni, ni2, ni3; /* parameter for GRID_GME */
int number, position; /* parameter for GRID_REFERENCE */
char *reference;
char uuid[17]; /* uuid for grid reference */
char uuid[17]; /* uuid for grid reference */
int trunc; /* parameter for GRID_SPECTEAL */
int nvertex;
int *rowlon;
int nrowlon;
int size;
int xsize;
int ysize;
int xsize; /* number of values along X */
int ysize; /* number of values along Y */
int np; /* number of parallels between a pole and the equator */
int locked;
int lcomplex;
char xname[CDI_MAX_NAME];
......
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