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
0872d0aa
Commit
0872d0aa
authored
Apr 10, 2014
by
Uwe Schulzweida
Browse files
varscan::cmpparam: apply patch from Thomas Jahns
parent
7ea060d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
0872d0aa
...
...
@@ -3,6 +3,10 @@
* Version 1.6.4 released
* using CGRIBEX library version 1.6.4
2014-04-10 Uwe Schulzweida
* varscan::cmpparam: apply patch from Thomas Jahns
2014-03-24 Uwe Schulzweida
* configure --with-netCDF: set default=no
...
...
src/varscan.c
View file @
0872d0aa
...
...
@@ -422,31 +422,15 @@ param_t;
static
int
cmpparam
(
const
void
*
s1
,
const
void
*
s2
)
{
int
cmp
=
0
;
const
param_t
*
x
=
s1
;
const
param_t
*
y
=
s2
;
i
f
(
x
->
param
>
y
->
param
)
cmp
=
1
;
else
if
(
x
->
param
<
y
->
param
)
cmp
=
-
1
;
i
nt
cmp
=
(
(
x
->
param
>
y
->
param
)
-
(
x
->
param
<
y
->
param
))
*
2
+
(
x
->
ltype
>
y
->
ltype
)
-
(
x
->
ltype
<
y
->
ltype
)
;
return
(
cmp
);
}
static
int
cmpltype
(
const
void
*
s1
,
const
void
*
s2
)
{
int
cmp
=
0
;
const
param_t
*
x
=
s1
;
const
param_t
*
y
=
s2
;
if
(
x
->
ltype
>
y
->
ltype
)
cmp
=
1
;
else
if
(
x
->
ltype
<
y
->
ltype
)
cmp
=
-
1
;
return
(
cmp
);
}
void
cdi_generate_vars
(
stream_t
*
streamptr
)
{
int
varID
,
gridID
,
zaxisID
,
levelID
;
...
...
@@ -486,7 +470,6 @@ void cdi_generate_vars(stream_t *streamptr)
varInfo
[
varid
]
->
param
=
vartable
[
varid
].
param
;
varInfo
[
varid
]
->
ltype
=
vartable
[
varid
].
ltype
;
}
qsort
(
varInfo
[
0
],
nvars
,
sizeof
(
param_t
),
cmpltype
);
qsort
(
varInfo
[
0
],
nvars
,
sizeof
(
param_t
),
cmpparam
);
for
(
varid
=
0
;
varid
<
nvars
;
varid
++
)
{
...
...
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