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
135aeda4
Commit
135aeda4
authored
Jan 30, 2019
by
Uwe Schulzweida
Browse files
Added function cdfDefVarCompression().
parent
bd9e06b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cdf_write.c
View file @
135aeda4
...
...
@@ -323,6 +323,30 @@ int nc_grid_index(stream_t *streamptr, int gridID)
return
index
;
}
static
void
cdfDefVarCompression
(
const
stream_t
*
streamptr
,
int
ncvarid
,
bool
lchunk
)
{
if
(
streamptr
->
comptype
==
CDI_COMPRESS_ZIP
)
{
if
(
lchunk
&&
(
streamptr
->
filetype
==
CDI_FILETYPE_NC4
||
streamptr
->
filetype
==
CDI_FILETYPE_NC4C
)
)
{
cdfDefVarDeflate
(
streamptr
->
fileID
,
ncvarid
,
streamptr
->
complevel
);
}
else
{
if
(
lchunk
)
{
static
bool
lwarn
=
true
;
if
(
lwarn
)
{
lwarn
=
false
;
Warning
(
"Deflate compression is only available for NetCDF4!"
);
}
}
}
}
}
static
int
cdfDefVar
(
stream_t
*
streamptr
,
int
varID
)
{
...
...
@@ -519,25 +543,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
cdf_def_var_chunking
(
fileID
,
ncvarid
,
NC_CHUNKED
,
chunks
);
#endif
if
(
streamptr
->
comptype
==
CDI_COMPRESS_ZIP
)
{
if
(
lchunk
&&
(
streamptr
->
filetype
==
CDI_FILETYPE_NC4
||
streamptr
->
filetype
==
CDI_FILETYPE_NC4C
)
)
{
cdfDefVarDeflate
(
fileID
,
ncvarid
,
streamptr
->
complevel
);
}
else
{
if
(
lchunk
)
{
static
bool
lwarn
=
true
;
if
(
lwarn
)
{
lwarn
=
false
;
Warning
(
"Deflate compression is only available for NetCDF4!"
);
}
}
}
}
cdfDefVarCompression
(
streamptr
,
ncvarid
,
lchunk
);
if
(
*
stdname
)
cdf_put_att_text
(
fileID
,
ncvarid
,
"standard_name"
,
strlen
(
stdname
),
stdname
);
if
(
*
longname
)
cdf_put_att_text
(
fileID
,
ncvarid
,
"long_name"
,
strlen
(
longname
),
longname
);
...
...
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