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
957fda44
Commit
957fda44
authored
May 16, 2008
by
Uwe Schulzweida
Browse files
No commit message
No commit message
parent
f2a10028
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/vlist.c
View file @
957fda44
...
...
@@ -807,7 +807,7 @@ void vlistCat(int vlistID2, int vlistID1)
@Item vlistID1 Source variable list ID
@Description
Merge the variable list vlistID1
and
the variable list vlistID2.
Merge the variable list vlistID1
to
the variable list vlistID2.
@EndFunction
*/
...
...
@@ -861,14 +861,14 @@ void vlistMerge(int vlistID2, int vlistID1)
nlevs
=
nlevs1
+
nlevs2
;
vlistptr2
->
vars
[
varID
].
nlevs
=
nlevs
;
/*
printf("var %d %d %d %d\n", varID, nlevs1, nlevs2, nlevs
); */
/*
f
printf(
stderr,
"var %d %d %d
%d
%d\n", varID, nlevs1, nlevs2, nlevs
, sizeof(LEVINFO));
*/
vlistptr2
->
vars
[
varID
].
levinfo
=
(
LEVINFO
*
)
realloc
(
vlistptr2
->
vars
[
varID
].
levinfo
,
nlevs
*
sizeof
(
LEVINFO
));
memcpy
(
vlistptr2
->
vars
[
varID
].
levinfo
+
nlevs
1
,
vlistptr1
->
vars
[
varID
].
levinfo
,
nlevs
2
*
sizeof
(
LEVINFO
));
memcpy
(
vlistptr2
->
vars
[
varID
].
levinfo
+
nlevs
2
,
vlistptr1
->
vars
[
varID
].
levinfo
,
nlevs
1
*
sizeof
(
LEVINFO
));
}
lvar
=
(
int
*
)
malloc
(
nvars2
*
sizeof
(
int
));
...
...
@@ -886,9 +886,9 @@ void vlistMerge(int vlistID2, int vlistID1)
*/
nlevs1
=
zaxisInqSize
(
zaxisID1
);
nlevs2
=
zaxisInqSize
(
zaxisID2
);
/*
printf("zaxis %d %d %d %d\n", zaxisID1, zaxisID2, nlevs1, nlevs2);
*/
/*
f
printf(
stderr,
"zaxis %d %d %d %d\n", zaxisID1, zaxisID2, nlevs1, nlevs2);
*/
nlevs
=
nlevs1
+
nlevs2
;
zaxisID
=
zaxisDuplicate
(
zaxisID2
);
...
...
@@ -898,7 +898,10 @@ void vlistMerge(int vlistID2, int vlistID1)
levels
=
(
double
*
)
malloc
(
nlevs1
*
sizeof
(
double
));
zaxisInqLevels
(
zaxisID1
,
levels
);
/*
for ( levID = 0; levID < nlevs1; levID++ )
fprintf(stderr, "%d %d %d %d %d %g\n", varID, levID, nlevs1, nlevs2, vlistptr2->vars[varID].nlevs, levels[levID]);
*/
for
(
levID
=
0
;
levID
<
nlevs1
;
levID
++
)
zaxisDefLevel
(
zaxisID
,
nlevs2
+
levID
,
levels
[
levID
]);
...
...
@@ -908,8 +911,8 @@ void vlistMerge(int vlistID2, int vlistID1)
if
(
vlistptr2
->
zaxisIDs
[
index
]
==
zaxisID2
)
vlistptr2
->
zaxisIDs
[
index
]
=
zaxisID
;
for
(
varID2
=
varID
+
1
;
varID2
<
nvars
1
;
varID2
++
)
if
(
vlistptr2
->
vars
[
varID2
].
zaxisID
==
zaxisID2
)
for
(
varID2
=
0
;
varID2
<
nvars
2
;
varID2
++
)
if
(
lvar
[
varID2
]
=
FALSE
&&
vlistptr2
->
vars
[
varID2
].
zaxisID
==
zaxisID2
)
{
vlistptr2
->
vars
[
varID2
].
zaxisID
=
zaxisID
;
lvar
[
varID2
]
=
TRUE
;
...
...
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