Skip to content
GitLab
Menu
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
5cf4696b
Commit
5cf4696b
authored
Dec 07, 2015
by
Thomas Jahns
🤸
Browse files
Make grid data comparison for netcdf simpler.
parent
07cfe631
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_cdf.c
View file @
5cf4696b
...
...
@@ -4619,6 +4619,44 @@ cdfLazyGridInqYVal(grid_t *grid, int index)
grid
->
yvals
,
grid
->
vtable
->
inqYValsPtr
);
}
static
int
cdfLazyXYValGetCompare
(
struct
cdfLazyGrid
*
lazyGridRef
,
struct
cdfLazyGrid
*
lazyGridTest
)
{
struct
xyValGet
*
valsGetXRef
=
&
lazyGridRef
->
xValsGet
,
*
valsGetYRef
=
&
lazyGridRef
->
yValsGet
,
*
valsGetXTest
=
&
lazyGridTest
->
xValsGet
,
*
valsGetYTest
=
&
lazyGridTest
->
yValsGet
;
return
valsGetXRef
->
datasetNCId
==
valsGetXTest
->
datasetNCId
&&
valsGetXRef
->
varNCId
==
valsGetXTest
->
varNCId
&&
valsGetYRef
->
datasetNCId
==
valsGetYTest
->
datasetNCId
&&
valsGetYRef
->
varNCId
==
valsGetYTest
->
varNCId
;
}
static
int
cdfLazyCompareXYFull
(
grid_t
*
gridRef
,
grid_t
*
gridTest
)
{
int
diff
;
struct
cdfLazyGrid
*
lazyGridRef
=
(
struct
cdfLazyGrid
*
)
gridRef
;
if
(
gridTest
->
vtable
==
&
cdfLazyGridVtable
)
diff
=
cdfLazyXYValGetCompare
(
lazyGridRef
,
(
struct
cdfLazyGrid
*
)
gridTest
);
else
diff
=
lazyGridRef
->
baseVtable
->
compareXYFull
(
gridRef
,
gridTest
);
return
diff
;
}
static
int
cdfLazyCompareXYAO
(
grid_t
*
gridRef
,
grid_t
*
gridTest
)
{
int
diff
;
struct
cdfLazyGrid
*
lazyGridRef
=
(
struct
cdfLazyGrid
*
)
gridRef
;
if
(
gridTest
->
vtable
==
&
cdfLazyGridVtable
)
diff
=
cdfLazyXYValGetCompare
(
lazyGridRef
,
(
struct
cdfLazyGrid
*
)
gridTest
);
else
diff
=
lazyGridRef
->
baseVtable
->
compareXYAO
(
gridRef
,
gridTest
);
return
diff
;
}
static
const
double
*
cdfLazyGridInqXBoundsPtr
(
grid_t
*
grid
)
...
...
@@ -4659,6 +4697,8 @@ cdfLazyGridInitOnce(void)
cdfLazyGridVtable
.
inqYValsPtr
=
cdfLazyGridInqYValsPtr
;
cdfLazyGridVtable
.
inqXVal
=
cdfLazyGridInqXVal
;
cdfLazyGridVtable
.
inqYVal
=
cdfLazyGridInqYVal
;
cdfLazyGridVtable
.
compareXYFull
=
cdfLazyCompareXYFull
;
cdfLazyGridVtable
.
compareXYAO
=
cdfLazyCompareXYAO
;
cdfLazyGridVtable
.
inqXBoundsPtr
=
cdfLazyGridInqXBoundsPtr
;
cdfLazyGridVtable
.
inqYBoundsPtr
=
cdfLazyGridInqYBoundsPtr
;
/* create inaccessible memory area, if possible, this serves as
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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