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
c891ebc8
Commit
c891ebc8
authored
Jun 01, 2011
by
Uwe Schulzweida
Browse files
CDI: changed compression level from Zlevel to CompLevel
parent
cab418f4
Changes
15
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
c891ebc8
2011-06-01 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* CDI: changed compression type from Ztype to CompType
* CDI: changed compression level from Zlevel to CompLevel [report: Thomas Jahns]
2011-05-13 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
...
...
app/cdi.c
View file @
c891ebc8
...
...
@@ -49,8 +49,8 @@ int DefaultFileType = CDI_UNDEFID;
int
DefaultDataType
=
CDI_UNDEFID
;
int
DefaultByteorder
=
CDI_UNDEFID
;
int
comptype
=
COMPRESS_NONE
;
int
Z
level
=
0
;
int
comptype
=
COMPRESS_NONE
;
// Compression type
int
comp
level
=
0
;
// Compression level
static
...
...
@@ -651,12 +651,12 @@ void defineCompress(const char *arg)
else
if
(
strncmp
(
arg
,
"gzip"
,
len
)
==
0
)
{
comptype
=
COMPRESS_GZIP
;
Z
level
=
6
;
comp
level
=
6
;
}
else
if
(
strncmp
(
arg
,
"zip"
,
len
)
==
0
)
{
comptype
=
COMPRESS_ZIP
;
Z
level
=
1
;
comp
level
=
1
;
}
else
fprintf
(
stderr
,
"%s compression unsupported!
\n
"
,
arg
);
...
...
@@ -845,7 +845,7 @@ int main(int argc, char *argv[])
if
(
comptype
!=
COMPRESS_NONE
)
{
streamDefCompType
(
streamID2
,
comptype
);
streamDef
Zl
evel
(
streamID2
,
Z
level
);
streamDef
CompL
evel
(
streamID2
,
comp
level
);
}
streamDefVlist
(
streamID2
,
vlistID2
);
...
...
doc/tex/c_quick_ref.tex
View file @
c891ebc8
...
...
@@ -355,6 +355,15 @@ Close an open dataset.
Define the byteorder.
\section*
{
\tt
\htmlref
{
streamDefCompLevel
}{
streamDefCompLevel
}}
\begin{verbatim}
void streamDefCompLevel (intstreamID, intcomplevel);
\end{verbatim}
Define compression level.
\section*
{
\tt
\htmlref
{
streamDefCompType
}{
streamDefCompType
}}
\begin{verbatim}
...
...
@@ -382,22 +391,22 @@ Define time step.
Define the Vlist for a stream.
\section*
{
\tt
\htmlref
{
stream
DefZlevel
}{
streamDefZlevel
}}
\section*
{
\tt
\htmlref
{
stream
InqByteorder
}{
streamInqByteorder
}}
\begin{verbatim}
void
stream
DefZlevel
(intstreamID
, intzlevel
);
int
stream
InqByteorder
(intstreamID);
\end{verbatim}
Define compression level
.
Get the byteorder
.
\section*
{
\tt
\htmlref
{
streamInq
Byteorder
}{
streamInq
Byteorder
}}
\section*
{
\tt
\htmlref
{
streamInq
CompLevel
}{
streamInq
CompLevel
}}
\begin{verbatim}
int streamInq
Byteorder
(intstreamID);
int streamInq
CompLevel
(intstreamID);
\end{verbatim}
Get
the byteorder
.
Get
compression level
.
\section*
{
\tt
\htmlref
{
streamInqCompType
}{
streamInqCompType
}}
...
...
@@ -436,15 +445,6 @@ Get time step.
Get the Vlist of a stream.
\section*
{
\tt
\htmlref
{
streamInqZlevel
}{
streamInqZlevel
}}
\begin{verbatim}
int streamInqZlevel (intstreamID);
\end{verbatim}
Get compression level.
\section*
{
\tt
\htmlref
{
streamOpenRead
}{
streamOpenRead
}}
\begin{verbatim}
...
...
doc/tex/f_quick_ref.tex
View file @
c891ebc8
...
...
@@ -355,6 +355,15 @@ Close an open dataset.
Define the byteorder.
\section*
{
\tt
\htmlref
{
streamDefCompLevel
}{
streamDefCompLevel
}}
\begin{verbatim}
SUBROUTINE streamDefCompLevel (INTEGER streamID, INTEGER complevel)
\end{verbatim}
Define compression level.
\section*
{
\tt
\htmlref
{
streamDefCompType
}{
streamDefCompType
}}
\begin{verbatim}
...
...
@@ -382,22 +391,22 @@ Define time step.
Define the Vlist for a stream.
\section*
{
\tt
\htmlref
{
stream
DefZlevel
}{
streamDefZlevel
}}
\section*
{
\tt
\htmlref
{
stream
InqByteorder
}{
streamInqByteorder
}}
\begin{verbatim}
SUBROUTINE streamDefZlevel
(INTEGER streamID
, INTEGER zlevel
)
INTEGER FUNCTION streamInqByteorder
(INTEGER streamID)
\end{verbatim}
Define compression level
.
Get the byteorder
.
\section*
{
\tt
\htmlref
{
streamInq
Byteorder
}{
streamInq
Byteorder
}}
\section*
{
\tt
\htmlref
{
streamInq
CompLevel
}{
streamInq
CompLevel
}}
\begin{verbatim}
INTEGER FUNCTION streamInq
Byteorder
(INTEGER streamID)
INTEGER FUNCTION streamInq
CompLevel
(INTEGER streamID)
\end{verbatim}
Get
the byteorder
.
Get
compression level
.
\section*
{
\tt
\htmlref
{
streamInqCompType
}{
streamInqCompType
}}
...
...
@@ -436,15 +445,6 @@ Get time step.
Get the Vlist of a stream.
\section*
{
\tt
\htmlref
{
streamInqZlevel
}{
streamInqZlevel
}}
\begin{verbatim}
INTEGER FUNCTION streamInqZlevel (INTEGER streamID)
\end{verbatim}
Get compression level.
\section*
{
\tt
\htmlref
{
streamOpenRead
}{
streamOpenRead
}}
\begin{verbatim}
...
...
src/cdi.h
View file @
c891ebc8
...
...
@@ -259,14 +259,14 @@ int streamInqByteorder(int streamID);
/* streamDefCompType: Define compression type */
void
streamDefCompType
(
int
streamID
,
int
comptype
);
/* streamDef
Zl
evel: Define compression level */
void
streamDef
Zl
evel
(
int
streamID
,
int
z
level
);
/* streamDef
CompL
evel: Define compression level */
void
streamDef
CompL
evel
(
int
streamID
,
int
comp
level
);
/* streamInqCompType: Get compression type */
int
streamInqCompType
(
int
streamID
);
/* streamInq
Zl
evel: Get compression level */
int
streamInq
Zl
evel
(
int
streamID
);
/* streamInq
CompL
evel: Get compression level */
int
streamInq
CompL
evel
(
int
streamID
);
/* streamDefTimestep: Define time step */
int
streamDefTimestep
(
int
streamID
,
int
tsID
);
...
...
@@ -386,8 +386,8 @@ int vlistInqVarTime(int vlistID, int varID);
void
vlistDefVarCompType
(
int
vlistID
,
int
varID
,
int
comptype
);
int
vlistInqVarCompType
(
int
vlistID
,
int
varID
);
void
vlistDefVar
Zl
evel
(
int
vlistID
,
int
varID
,
int
z
level
);
int
vlistInqVar
Zl
evel
(
int
vlistID
,
int
varID
);
void
vlistDefVar
CompL
evel
(
int
vlistID
,
int
varID
,
int
comp
level
);
int
vlistInqVar
CompL
evel
(
int
vlistID
,
int
varID
);
/* vlistDefVarParam: Define the parameter number of a Variable */
void
vlistDefVarParam
(
int
vlistID
,
int
varID
,
int
param
);
...
...
src/cdi.inc
View file @
c891ebc8
...
...
@@ -449,18 +449,18 @@
!
INTEGER
comptype
)
EXTERNAL
streamDefCompType
!
streamDef
Zl
evel
!
streamDef
CompL
evel
!
(
INTEGER
streamID
,
!
INTEGER
z
level
)
EXTERNAL
streamDef
Zl
evel
!
INTEGER
comp
level
)
EXTERNAL
streamDef
CompL
evel
INTEGER
streamInqCompType
!
(
INTEGER
streamID
)
EXTERNAL
streamInqCompType
INTEGER
streamInq
Zl
evel
INTEGER
streamInq
CompL
evel
!
(
INTEGER
streamID
)
EXTERNAL
streamInq
Zl
evel
EXTERNAL
streamInq
CompL
evel
INTEGER
streamDefTimestep
!
(
INTEGER
streamID
,
...
...
@@ -760,16 +760,16 @@
!
INTEGER
varID
)
EXTERNAL
vlistInqVarCompType
!
vlistDefVar
Zl
evel
!
vlistDefVar
CompL
evel
!
(
INTEGER
vlistID
,
!
INTEGER
varID
,
!
INTEGER
z
level
)
EXTERNAL
vlistDefVar
Zl
evel
!
INTEGER
comp
level
)
EXTERNAL
vlistDefVar
CompL
evel
INTEGER
vlistInqVar
Zl
evel
INTEGER
vlistInqVar
CompL
evel
!
(
INTEGER
vlistID
,
!
INTEGER
varID
)
EXTERNAL
vlistInqVar
Zl
evel
EXTERNAL
vlistInqVar
CompL
evel
!
vlistDefVarParam
!
(
INTEGER
vlistID
,
...
...
src/cdiFortran.c
View file @
c891ebc8
...
...
@@ -90,9 +90,9 @@ FCALLSCFUN1 (INT, streamInqFiletype, STREAMINQFILETYPE, streaminqfiletype, INT)
FCALLSCSUB2
(
streamDefByteorder
,
STREAMDEFBYTEORDER
,
streamdefbyteorder
,
INT
,
INT
)
FCALLSCFUN1
(
INT
,
streamInqByteorder
,
STREAMINQBYTEORDER
,
streaminqbyteorder
,
INT
)
FCALLSCSUB2
(
streamDefCompType
,
STREAMDEFCOMPTYPE
,
streamdefcomptype
,
INT
,
INT
)
FCALLSCSUB2
(
streamDef
Zl
evel
,
STREAMDEF
Z
LEVEL
,
streamdef
z
level
,
INT
,
INT
)
FCALLSCSUB2
(
streamDef
CompL
evel
,
STREAMDEF
COMP
LEVEL
,
streamdef
comp
level
,
INT
,
INT
)
FCALLSCFUN1
(
INT
,
streamInqCompType
,
STREAMINQCOMPTYPE
,
streaminqcomptype
,
INT
)
FCALLSCFUN1
(
INT
,
streamInq
Zl
evel
,
STREAMINQ
Z
LEVEL
,
streaminq
z
level
,
INT
)
FCALLSCFUN1
(
INT
,
streamInq
CompL
evel
,
STREAMINQ
COMP
LEVEL
,
streaminq
comp
level
,
INT
)
FCALLSCFUN2
(
INT
,
streamDefTimestep
,
STREAMDEFTIMESTEP
,
streamdeftimestep
,
INT
,
INT
)
FCALLSCFUN2
(
INT
,
streamInqTimestep
,
STREAMINQTIMESTEP
,
streaminqtimestep
,
INT
,
INT
)
FCALLSCFUN1
(
STRING
,
streamFilename
,
STREAMFILENAME
,
streamfilename
,
INT
)
...
...
@@ -161,8 +161,8 @@ FCALLSCFUN2 (INT, vlistInqVarZaxis, VLISTINQVARZAXIS, vlistinqvarzaxis, INT, INT
FCALLSCFUN2
(
INT
,
vlistInqVarTime
,
VLISTINQVARTIME
,
vlistinqvartime
,
INT
,
INT
)
FCALLSCSUB3
(
vlistDefVarCompType
,
VLISTDEFVARCOMPTYPE
,
vlistdefvarcomptype
,
INT
,
INT
,
INT
)
FCALLSCFUN2
(
INT
,
vlistInqVarCompType
,
VLISTINQVARCOMPTYPE
,
vlistinqvarcomptype
,
INT
,
INT
)
FCALLSCSUB3
(
vlistDefVar
Zl
evel
,
VLISTDEFVAR
Z
LEVEL
,
vlistdefvar
z
level
,
INT
,
INT
,
INT
)
FCALLSCFUN2
(
INT
,
vlistInqVar
Zl
evel
,
VLISTINQVAR
Z
LEVEL
,
vlistinqvar
z
level
,
INT
,
INT
)
FCALLSCSUB3
(
vlistDefVar
CompL
evel
,
VLISTDEFVAR
COMP
LEVEL
,
vlistdefvar
comp
level
,
INT
,
INT
,
INT
)
FCALLSCFUN2
(
INT
,
vlistInqVar
CompL
evel
,
VLISTINQVAR
COMP
LEVEL
,
vlistinqvar
comp
level
,
INT
,
INT
)
FCALLSCSUB3
(
vlistDefVarParam
,
VLISTDEFVARPARAM
,
vlistdefvarparam
,
INT
,
INT
,
INT
)
FCALLSCFUN2
(
INT
,
vlistInqVarParam
,
VLISTINQVARPARAM
,
vlistinqvarparam
,
INT
,
INT
)
FCALLSCSUB3
(
vlistDefVarCode
,
VLISTDEFVARCODE
,
vlistdefvarcode
,
INT
,
INT
,
INT
)
...
...
src/stream.c
View file @
c891ebc8
...
...
@@ -2064,7 +2064,7 @@ void streamDefCompType(int streamID, int comptype)
}
void
streamDef
Zl
evel
(
int
streamID
,
int
z
level
)
void
streamDef
CompL
evel
(
int
streamID
,
int
comp
level
)
{
stream_t
*
streamptr
;
...
...
@@ -2072,7 +2072,7 @@ void streamDefZlevel(int streamID, int zlevel)
stream_check_ptr
(
__func__
,
streamptr
);
streamptr
->
z
level
=
z
level
;
streamptr
->
comp
level
=
comp
level
;
}
...
...
@@ -2088,7 +2088,7 @@ int streamInqCompType(int streamID)
}
int
streamInq
Zl
evel
(
int
streamID
)
int
streamInq
CompL
evel
(
int
streamID
)
{
stream_t
*
streamptr
;
...
...
@@ -2096,5 +2096,5 @@ int streamInqZlevel(int streamID)
stream_check_ptr
(
__func__
,
streamptr
);
return
(
streamptr
->
z
level
);
return
(
streamptr
->
comp
level
);
}
src/stream_cdf.c
View file @
c891ebc8
...
...
@@ -2758,7 +2758,7 @@ int cdfDefVar(int streamID, int varID)
{
if
(
lchunk
&&
(
streamptr
->
filetype
==
FILETYPE_NC4
||
streamptr
->
filetype
==
FILETYPE_NC4C
)
)
{
cdfDefVarDeflate
(
fileID
,
ncvarid
,
streamptr
->
z
level
);
cdfDefVarDeflate
(
fileID
,
ncvarid
,
streamptr
->
comp
level
);
}
else
{
...
...
src/stream_int.c
View file @
c891ebc8
...
...
@@ -410,7 +410,7 @@ void stream_init_entry(stream_t *streamptr)
streamptr
->
sortname
=
cdiSortName
;
streamptr
->
have_missval
=
cdiHaveMissval
;
streamptr
->
comptype
=
COMPRESS_NONE
;
streamptr
->
z
level
=
0
;
streamptr
->
comp
level
=
0
;
basetimeInit
(
&
streamptr
->
basetime
);
...
...
src/stream_int.h
View file @
c891ebc8
...
...
@@ -238,8 +238,8 @@ typedef struct {
int
unreduced
;
int
sortname
;
int
have_missval
;
int
comptype
;
/
*
compression type
*/
int
z
level
;
int
comptype
;
/
/ compression type
int
comp
level
;
// compression level
int
curfile
;
int
nfiles
;
char
**
fnames
;
...
...
src/varscan.c
View file @
c891ebc8
...
...
@@ -44,8 +44,8 @@ typedef struct
int
instID
;
int
modelID
;
int
tableID
;
int
comptype
;
// compression type
int
z
level
;
int
comptype
;
// compression type
int
comp
level
;
// compression level
int
lmissval
;
double
missval
;
char
*
name
;
...
...
@@ -79,7 +79,7 @@ void paramInitEntry(int varID, int param)
vartable
[
varID
].
modelID
=
UNDEFID
;
vartable
[
varID
].
tableID
=
UNDEFID
;
vartable
[
varID
].
comptype
=
COMPRESS_NONE
;
vartable
[
varID
].
z
level
=
1
;
vartable
[
varID
].
comp
level
=
1
;
vartable
[
varID
].
lmissval
=
0
;
vartable
[
varID
].
missval
=
0
;
vartable
[
varID
].
name
=
NULL
;
...
...
@@ -834,9 +834,9 @@ void varDefCompType(int varID, int comptype)
}
void
varDef
Zl
evel
(
int
varID
,
int
z
level
)
void
varDef
CompL
evel
(
int
varID
,
int
comp
level
)
{
vartable
[
varID
].
z
level
=
z
level
;
vartable
[
varID
].
comp
level
=
comp
level
;
}
...
...
src/varscan.h
View file @
c891ebc8
...
...
@@ -19,8 +19,7 @@ int varDefZaxis(int vlistID, int zaxistype, int nlevels, double *levels, int lb
char
*
longname
,
char
*
units
,
int
prec
,
int
mode
,
int
ltype
);
void
varDefMissval
(
int
varID
,
double
missval
);
void
varDefZtype
(
int
varID
,
int
ztype
);
void
varDefZlevel
(
int
varID
,
int
zlevel
);
void
varDefCompType
(
int
varID
,
int
comptype
);
void
varDefInst
(
int
varID
,
int
instID
);
int
varInqInst
(
int
varID
);
void
varDefModel
(
int
varID
,
int
modelID
);
...
...
src/vlist.h
View file @
c891ebc8
...
...
@@ -71,7 +71,7 @@ typedef struct
double
addoffset
;
levinfo_t
*
levinfo
;
int
comptype
;
// compression type
int
z
level
;
int
comp
level
;
// compression level
cdi_atts_t
atts
;
}
var_t
;
...
...
src/vlist_var.c
View file @
c891ebc8
...
...
@@ -42,7 +42,7 @@ void vlistvarInitEntry(int vlistID, int varID)
vlistptr
->
vars
[
varID
].
nlevs
=
0
;
vlistptr
->
vars
[
varID
].
levinfo
=
NULL
;
vlistptr
->
vars
[
varID
].
comptype
=
COMPRESS_NONE
;
vlistptr
->
vars
[
varID
].
z
level
=
1
;
vlistptr
->
vars
[
varID
].
comp
level
=
1
;
vlistptr
->
vars
[
varID
].
atts
.
nalloc
=
MAX_ATTRIBUTES
;
vlistptr
->
vars
[
varID
].
atts
.
nelems
=
0
;
}
...
...
@@ -1507,7 +1507,7 @@ int vlistInqVarCompType(int vlistID, int varID)
}
void
vlistDefVar
Zl
evel
(
int
vlistID
,
int
varID
,
int
z
level
)
void
vlistDefVar
CompL
evel
(
int
vlistID
,
int
varID
,
int
comp
level
)
{
vlist_t
*
vlistptr
;
...
...
@@ -1515,11 +1515,11 @@ void vlistDefVarZlevel(int vlistID, int varID, int zlevel)
vlistCheckVarID
(
__func__
,
vlistID
,
varID
);
vlistptr
->
vars
[
varID
].
z
level
=
z
level
;
vlistptr
->
vars
[
varID
].
comp
level
=
comp
level
;
}
int
vlistInqVar
Zl
evel
(
int
vlistID
,
int
varID
)
int
vlistInqVar
CompL
evel
(
int
vlistID
,
int
varID
)
{
vlist_t
*
vlistptr
;
...
...
@@ -1527,5 +1527,5 @@ int vlistInqVarZlevel(int vlistID, int varID)
vlistCheckVarID
(
__func__
,
vlistID
,
varID
);
return
(
vlistptr
->
vars
[
varID
].
z
level
);
return
(
vlistptr
->
vars
[
varID
].
comp
level
);
}
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