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

remove function defineYvals

parent 40526e1a
......@@ -465,127 +465,6 @@ void gridGenYvals(int gridtype, int ysize, double yfirst, double ylast, double y
Error(func, "unable to calculate values for %s grid!", gridNamePtr(gridtype));
*/
}
/*
static void defineXvals(int gridID)
{
static char func[] = "defineXvals";
grid_t *gridptr;
gridptr = grid_to_pointer(gridID);
if ( gridptr->type == GRID_CELL ) return;
if ( gridptr->xvals == NULL )
{
double *xvals, xfirst, xlast, xinc;
int i, xsize;
xsize = gridptr->xsize;
if ( xsize == 0 )
Error(func, "xsize undefined for gridID = %d", gridID);
xvals = (double *) malloc(xsize*sizeof(double));
xfirst = gridptr->xfirst;
xlast = gridptr->xlast;
xinc = gridptr->xinc;
if ( ! fabs(xinc) )
{
if ( xfirst > xlast )
xinc = (xfirst-xlast)/xsize;
else
xinc = (xlast-xfirst)/xsize;
gridptr->xinc = xinc;
}
if ( xfirst > xlast && xinc > 0 ) xinc = -xinc;
for ( i = 0; i < xsize; i++ )
xvals[i] = xfirst + i*xinc;
gridptr->xvals = xvals;
}
}
*/
static void defineYvals(int gridID)
{
static char func[] = "defineYvals";
int gridtype;
grid_t *gridptr;
gridptr = grid_to_pointer(gridID);
gridtype = gridptr->type;
if ( gridtype == GRID_CELL ) return;
if ( gridptr->yvals == NULL )
{
double *yvals, yfirst, ylast, yinc;
int i, ysize;
ysize = gridptr->ysize;
if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
{
double *yw;
int yhsize;
yvals = (double *) malloc(ysize*sizeof(double));
yw = (double *) malloc(ysize*sizeof(double));
gaussaw(yvals, yw, ysize);
free(yw);
for ( i = 0; i < ysize; i++ )
yvals[i] = asin(yvals[i])/M_PI*180.0;
yfirst = gridptr->yfirst;
ylast = gridptr->ylast;
if ( yfirst < ylast && yfirst > -90.0 && ylast < 90.0 )
{
double ytmp;
yhsize = ysize/2;
for ( i = 0; i < yhsize; i++ )
{
ytmp = yvals[i];
yvals[i] = yvals[ysize-i-1];
yvals[ysize-i-1] = ytmp;
}
}
gridptr->yvals = yvals;
}
/* else if ( gridtype == GRID_LONLAT || gridtype == GRID_GENERIC ) */
else
{
if ( ysize == 0 )
Error(func, "ysize undefined for gridID = %d", gridID);
yvals = (double *) malloc(ysize*sizeof(double));
yfirst = gridptr->yfirst;
ylast = gridptr->ylast;
yinc = gridptr->yinc;
if ( ! (fabs(yinc) > 0) )
{
if ( ysize > 1 )
{
if ( yfirst > ylast )
yinc = (yfirst-ylast)/(ysize-1);
else
yinc = (ylast-yfirst)/(ysize-1);
}
gridptr->yinc = yinc;
}
if ( yfirst > ylast && yinc > 0 ) yinc = -yinc;
for ( i = 0; i < ysize; i++ )
yvals[i] = yfirst + i*yinc;
gridptr->yvals = yvals;
}
/*
else
Error(func, "unable to calculate values for %s grid!", gridNamePtr(gridtype));
*/
}
}
/*
......
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