Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
fb6d013a
Commit
fb6d013a
authored
Feb 16, 2010
by
Uwe Schulzweida
Browse files
remove function defineYvals
parent
40526e1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/grid.c
View file @
fb6d013a
...
...
@@ -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));
*/
}
}
/*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment