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
380ff943
Commit
380ff943
authored
Nov 15, 2012
by
Uwe Schulzweida
Browse files
cdfReadVarSliceDP: store DATATYPE_FLT32 in a float array andconvert it to double
parent
79d1ff49
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
380ff943
...
...
@@ -4,6 +4,7 @@
2012-11-15 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfReadVarSliceDP: store DATATYPE_FLT32 in a float array and convert it to double (speedup 2x)
* cdfInqTimestep: added check for timevalue = NC_FILL_DOUBLE
2012-11-14 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
...
...
src/stream_cdf.c
View file @
380ff943
...
...
@@ -3661,7 +3661,15 @@ int cdfReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *n
for
(
idim
=
0
;
idim
<
ndims
;
idim
++
)
Message
(
"dim = %d start = %d count = %d"
,
idim
,
start
[
idim
],
count
[
idim
]);
cdf_get_vara_double
(
fileID
,
ncvarid
,
start
,
count
,
data
);
if
(
vlistInqVarDatatype
(
vlistID
,
varID
)
==
DATATYPE_FLT32
)
{
float
*
data_fp
=
(
float
*
)
data
;
cdf_get_vara_float
(
fileID
,
ncvarid
,
start
,
count
,
data_fp
);
for
(
i
=
gridsize
-
1
;
i
>=
0
;
i
--
)
data
[
i
]
=
(
double
)
data_fp
[
i
];
}
else
cdf_get_vara_double
(
fileID
,
ncvarid
,
start
,
count
,
data
);
if
(
swapxy
)
{
...
...
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