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
bb59704d
Commit
bb59704d
authored
Aug 06, 2015
by
Uwe Schulzweida
Browse files
defineAttributes(): use cdf_put_att_float() for single precision float attributes
parent
4ba36f19
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_cdf.c
View file @
bb59704d
...
...
@@ -620,7 +620,14 @@ void defineAttributes(int vlistID, int varID, int fileID, int ncvarID)
double
*
attflt
=
(
double
*
)
resizeBuf
(
&
attBuf
,
&
attBufSize
,
attSize
);
vlistInqAttFlt
(
vlistID
,
varID
,
attname
,
attlen
,
attflt
);
len
=
(
size_t
)
attlen
;
cdf_put_att_double
(
fileID
,
ncvarID
,
attname
,
atttype
==
DATATYPE_FLT32
?
NC_FLOAT
:
NC_DOUBLE
,
len
,
attflt
);
if
(
atttype
==
DATATYPE_FLT32
)
{
float
attflt_sp
[
len
];
for
(
size_t
i
=
0
;
i
<
len
;
++
i
)
attflt_sp
[
i
]
=
attflt
[
i
];
cdf_put_att_float
(
fileID
,
ncvarID
,
attname
,
NC_FLOAT
,
len
,
attflt_sp
);
}
else
cdf_put_att_double
(
fileID
,
ncvarID
,
attname
,
atttype
==
DATATYPE_FLT32
?
NC_FLOAT
:
NC_DOUBLE
,
len
,
attflt
);
}
}
free
(
attBuf
);
...
...
Write
Preview
Markdown
is supported
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