Commit c891ebc8 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

CDI: changed compression level from Zlevel to CompLevel

parent cab418f4
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>
......
......@@ -49,8 +49,8 @@ int DefaultFileType = CDI_UNDEFID;
int DefaultDataType = CDI_UNDEFID;
int DefaultByteorder = CDI_UNDEFID;
int comptype = COMPRESS_NONE;
int Zlevel = 0;
int comptype = COMPRESS_NONE; // Compression type
int complevel = 0; // Compression level
static
......@@ -651,12 +651,12 @@ void defineCompress(const char *arg)
else if ( strncmp(arg, "gzip", len) == 0 )
{
comptype = COMPRESS_GZIP;
Zlevel = 6;
complevel = 6;
}
else if ( strncmp(arg, "zip", len) == 0 )
{
comptype = COMPRESS_ZIP;
Zlevel = 1;
complevel = 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);
streamDefZlevel(streamID2, Zlevel);
streamDefCompLevel(streamID2, complevel);
}
streamDefVlist(streamID2, vlistID2);
......
......@@ -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{streamDefZlevel}{streamDefZlevel}}
\section*{\tt \htmlref{streamInqByteorder}{streamInqByteorder}}
\begin{verbatim}
void streamDefZlevel (intstreamID, intzlevel);
int streamInqByteorder (intstreamID);
\end{verbatim}
Define compression level.
Get the byteorder.
\section*{\tt \htmlref{streamInqByteorder}{streamInqByteorder}}
\section*{\tt \htmlref{streamInqCompLevel}{streamInqCompLevel}}
\begin{verbatim}
int streamInqByteorder (intstreamID);
int streamInqCompLevel (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}
......
......@@ -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{streamDefZlevel}{streamDefZlevel}}
\section*{\tt \htmlref{streamInqByteorder}{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{streamInqByteorder}{streamInqByteorder}}
\section*{\tt \htmlref{streamInqCompLevel}{streamInqCompLevel}}
\begin{verbatim}
INTEGER FUNCTION streamInqByteorder (INTEGER streamID)
INTEGER FUNCTION streamInqCompLevel (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}
......
......@@ -259,14 +259,14 @@ int streamInqByteorder(int streamID);
/* streamDefCompType: Define compression type */
void streamDefCompType(int streamID, int comptype);
/* streamDefZlevel: Define compression level */
void streamDefZlevel(int streamID, int zlevel);
/* streamDefCompLevel: Define compression level */
void streamDefCompLevel(int streamID, int complevel);
/* streamInqCompType: Get compression type */
int streamInqCompType(int streamID);
/* streamInqZlevel: Get compression level */
int streamInqZlevel(int streamID);
/* streamInqCompLevel: Get compression level */
int streamInqCompLevel(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 vlistDefVarZlevel(int vlistID, int varID, int zlevel);
int vlistInqVarZlevel(int vlistID, int varID);
void vlistDefVarCompLevel(int vlistID, int varID, int complevel);
int vlistInqVarCompLevel(int vlistID, int varID);
/* vlistDefVarParam: Define the parameter number of a Variable */
void vlistDefVarParam(int vlistID, int varID, int param);
......
......@@ -449,18 +449,18 @@
! INTEGER comptype)
EXTERNAL streamDefCompType
! streamDefZlevel
! streamDefCompLevel
! (INTEGER streamID,
! INTEGER zlevel)
EXTERNAL streamDefZlevel
! INTEGER complevel)
EXTERNAL streamDefCompLevel
INTEGER streamInqCompType
! (INTEGER streamID)
EXTERNAL streamInqCompType
INTEGER streamInqZlevel
INTEGER streamInqCompLevel
! (INTEGER streamID)
EXTERNAL streamInqZlevel
EXTERNAL streamInqCompLevel
INTEGER streamDefTimestep
! (INTEGER streamID,
......@@ -760,16 +760,16 @@
! INTEGER varID)
EXTERNAL vlistInqVarCompType
! vlistDefVarZlevel
! vlistDefVarCompLevel
! (INTEGER vlistID,
! INTEGER varID,
! INTEGER zlevel)
EXTERNAL vlistDefVarZlevel
! INTEGER complevel)
EXTERNAL vlistDefVarCompLevel
INTEGER vlistInqVarZlevel
INTEGER vlistInqVarCompLevel
! (INTEGER vlistID,
! INTEGER varID)
EXTERNAL vlistInqVarZlevel
EXTERNAL vlistInqVarCompLevel
! vlistDefVarParam
! (INTEGER vlistID,
......
......@@ -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 (streamDefZlevel, STREAMDEFZLEVEL, streamdefzlevel, INT, INT)
FCALLSCSUB2 (streamDefCompLevel, STREAMDEFCOMPLEVEL, streamdefcomplevel, INT, INT)
FCALLSCFUN1 (INT, streamInqCompType, STREAMINQCOMPTYPE, streaminqcomptype, INT)
FCALLSCFUN1 (INT, streamInqZlevel, STREAMINQZLEVEL, streaminqzlevel, INT)
FCALLSCFUN1 (INT, streamInqCompLevel, STREAMINQCOMPLEVEL, streaminqcomplevel, 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 (vlistDefVarZlevel, VLISTDEFVARZLEVEL, vlistdefvarzlevel, INT, INT, INT)
FCALLSCFUN2 (INT, vlistInqVarZlevel, VLISTINQVARZLEVEL, vlistinqvarzlevel, INT, INT)
FCALLSCSUB3 (vlistDefVarCompLevel, VLISTDEFVARCOMPLEVEL, vlistdefvarcomplevel, INT, INT, INT)
FCALLSCFUN2 (INT, vlistInqVarCompLevel, VLISTINQVARCOMPLEVEL, vlistinqvarcomplevel, INT, INT)
FCALLSCSUB3 (vlistDefVarParam, VLISTDEFVARPARAM, vlistdefvarparam, INT, INT, INT)
FCALLSCFUN2 (INT, vlistInqVarParam, VLISTINQVARPARAM, vlistinqvarparam, INT, INT)
FCALLSCSUB3 (vlistDefVarCode, VLISTDEFVARCODE, vlistdefvarcode, INT, INT, INT)
......
......@@ -2064,7 +2064,7 @@ void streamDefCompType(int streamID, int comptype)
}
void streamDefZlevel(int streamID, int zlevel)
void streamDefCompLevel(int streamID, int complevel)
{
stream_t *streamptr;
......@@ -2072,7 +2072,7 @@ void streamDefZlevel(int streamID, int zlevel)
stream_check_ptr(__func__, streamptr);
streamptr->zlevel = zlevel;
streamptr->complevel = complevel;
}
......@@ -2088,7 +2088,7 @@ int streamInqCompType(int streamID)
}
int streamInqZlevel(int streamID)
int streamInqCompLevel(int streamID)
{
stream_t *streamptr;
......@@ -2096,5 +2096,5 @@ int streamInqZlevel(int streamID)
stream_check_ptr(__func__, streamptr);
return (streamptr->zlevel);
return (streamptr->complevel);
}
......@@ -2758,7 +2758,7 @@ int cdfDefVar(int streamID, int varID)
{
if ( lchunk && (streamptr->filetype == FILETYPE_NC4 || streamptr->filetype == FILETYPE_NC4C) )
{
cdfDefVarDeflate(fileID, ncvarid, streamptr->zlevel);
cdfDefVarDeflate(fileID, ncvarid, streamptr->complevel);
}
else
{
......
......@@ -410,7 +410,7 @@ void stream_init_entry(stream_t *streamptr)
streamptr->sortname = cdiSortName;
streamptr->have_missval = cdiHaveMissval;
streamptr->comptype = COMPRESS_NONE;
streamptr->zlevel = 0;
streamptr->complevel = 0;
basetimeInit(&streamptr->basetime);
......
......@@ -238,8 +238,8 @@ typedef struct {
int unreduced;
int sortname;
int have_missval;
int comptype; /* compression type */
int zlevel;
int comptype; // compression type
int complevel; // compression level
int curfile;
int nfiles;
char **fnames;
......
......@@ -44,8 +44,8 @@ typedef struct
int instID;
int modelID;
int tableID;
int comptype; // compression type
int zlevel;
int comptype; // compression type
int complevel; // 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].zlevel = 1;
vartable[varID].complevel = 1;
vartable[varID].lmissval = 0;
vartable[varID].missval = 0;
vartable[varID].name = NULL;
......@@ -834,9 +834,9 @@ void varDefCompType(int varID, int comptype)
}
void varDefZlevel(int varID, int zlevel)
void varDefCompLevel(int varID, int complevel)
{
vartable[varID].zlevel = zlevel;
vartable[varID].complevel = complevel;
}
......
......@@ -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);
......
......@@ -71,7 +71,7 @@ typedef struct
double addoffset;
levinfo_t *levinfo;
int comptype; // compression type
int zlevel;
int complevel; // compression level
cdi_atts_t atts;
}
var_t;
......
......@@ -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].zlevel = 1;
vlistptr->vars[varID].complevel = 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 vlistDefVarZlevel(int vlistID, int varID, int zlevel)
void vlistDefVarCompLevel(int vlistID, int varID, int complevel)
{
vlist_t *vlistptr;
......@@ -1515,11 +1515,11 @@ void vlistDefVarZlevel(int vlistID, int varID, int zlevel)
vlistCheckVarID(__func__, vlistID, varID);
vlistptr->vars[varID].zlevel = zlevel;
vlistptr->vars[varID].complevel = complevel;
}
int vlistInqVarZlevel(int vlistID, int varID)
int vlistInqVarCompLevel(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].zlevel);
return (vlistptr->vars[varID].complevel);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment