Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
0675f171
Commit
0675f171
authored
Jan 14, 2010
by
Uwe Schulzweida
Browse files
cdfDefVar: define add_offset and scale_factor always together
parent
a8e0e58e
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
0675f171
2010-01-14 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfDefVar: define add_offset and scale_factor always together
2010-01-13 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* added optional sorting of parameters
...
...
src/stream_cdf.c
View file @
0675f171
...
...
@@ -2858,7 +2858,7 @@ int cdfDefVar(int streamID, int varID)
if
(
laddoffset
||
lscalefactor
)
{
if
(
IS_EQUAL
(
addoffset
,
(
double
)
((
float
)
addoffset
))
&&
if
(
IS_EQUAL
(
addoffset
,
(
double
)
((
float
)
addoffset
))
&&
IS_EQUAL
(
scalefactor
,
(
double
)
((
float
)
scalefactor
))
)
{
astype
=
NC_FLOAT
;
...
...
@@ -2867,11 +2867,11 @@ int cdfDefVar(int streamID, int varID)
if
(
xtype
==
(
int
)
NC_FLOAT
)
astype
=
NC_FLOAT
;
}
if
(
laddoffset
)
cdf_put_att_double
(
fileID
,
ncvarid
,
"add_offset"
,
(
nc_type
)
astype
,
1L
,
&
addoffset
);
if
(
l
scalefactor
)
cdf_put_att_double
(
fileID
,
ncvarid
,
"scale_factor"
,
(
nc_type
)
astype
,
1L
,
&
scalefactor
);
if
(
laddoffset
||
lscalefactor
)
{
cdf_put_att_double
(
fileID
,
ncvarid
,
"add_offset"
,
(
nc_type
)
astype
,
1L
,
&
addoffset
);
cdf_put_att_double
(
fileID
,
ncvarid
,
"scale_factor"
,
(
nc_type
)
astype
,
1L
,
&
scalefactor
)
;
}
}
streamptr
->
vars
[
varID
].
ncvarid
=
ncvarid
;
...
...
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