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
cba2aedc
Commit
cba2aedc
authored
Aug 18, 2009
by
Uwe Schulzweida
Browse files
No commit message
No commit message
parent
b2e3fa89
Changes
11
Hide whitespace changes
Inline
Side-by-side
.gitattributes
View file @
cba2aedc
...
...
@@ -128,10 +128,10 @@ src/servicelib.c -text
src/stream.c -text
src/stream_cdf.c -text
src/stream_cdf.h -text
src/stream_cgribex.c -text
src/stream_cgribex.h -text
src/stream_ext.c -text
src/stream_ext.h -text
src/stream_grb.c -text
src/stream_grb.h -text
src/stream_history.c -text
src/stream_ieg.c -text
src/stream_ieg.h -text
...
...
app/cdi.c
View file @
cba2aedc
...
...
@@ -55,7 +55,8 @@ int Ztype = COMPRESS_NONE;
int
Zlevel
=
0
;
static
void
version
(
void
)
static
void
version
(
void
)
{
fprintf
(
stderr
,
"CDI version 1.7.0
\n
"
);
cdiPrintVersion
();
...
...
@@ -79,7 +80,8 @@ static void version(void)
*/
}
static
void
usage
(
void
)
static
void
usage
(
void
)
{
char
*
name
;
int
id
;
...
...
@@ -106,8 +108,9 @@ static void usage(void)
}
static
void
printInfo
(
int
gridtype
,
int
date
,
int
time
,
int
code
,
double
level
,
int
datasize
,
int
nmiss
,
double
missval
,
const
double
*
data
)
static
void
printInfo
(
int
gridtype
,
int
date
,
int
time
,
int
code
,
double
level
,
int
datasize
,
int
nmiss
,
double
missval
,
const
double
*
data
)
{
static
int
rec
=
0
;
int
i
,
ivals
=
0
,
imiss
=
0
;
...
...
@@ -179,7 +182,8 @@ static void printInfo(int gridtype, int date, int time, int code, double level,
}
static
void
printShortinfo
(
int
streamID
,
int
vlistID
,
int
vardis
)
static
void
printShortinfo
(
int
streamID
,
int
vlistID
,
int
vardis
)
{
int
varID
;
int
gridsize
=
0
;
...
...
@@ -433,7 +437,8 @@ static void printShortinfo(int streamID, int vlistID, int vardis)
#define IsBigendian() ( u_byteorder.c[sizeof(long) - 1] )
static
void
setDefaultDataType
(
char
*
datatypestr
)
static
void
setDefaultDataType
(
char
*
datatypestr
)
{
static
union
{
unsigned
long
l
;
unsigned
char
c
[
sizeof
(
long
)];}
u_byteorder
=
{
1
};
int
nbits
=
-
1
;
...
...
@@ -532,21 +537,21 @@ static void setDefaultDataType(char *datatypestr)
}
}
static
void
setDefaultFileType
(
char
*
filetypestr
)
static
void
setDefaultFileType
(
char
*
filetypestr
)
{
if
(
filetypestr
)
{
char
*
ftstr
=
filetypestr
;
if
(
strn
cmp
(
filetypestr
,
"grb2"
,
4
)
==
0
)
{
ftstr
+=
4
;
DefaultFileType
=
FILETYPE_GRB2
;}
else
if
(
strn
cmp
(
filetypestr
,
"grb"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_
NC2
;
}
else
if
(
strn
cmp
(
filetypestr
,
"nc2"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_NC2
;
}
else
if
(
strn
cmp
(
filetypestr
,
"nc4"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_NC4
;
}
else
if
(
strn
cmp
(
filetypestr
,
"nc"
,
2
)
==
0
)
{
ftstr
+=
2
;
DefaultFileType
=
FILETYPE_NC
;
}
else
if
(
strn
cmp
(
filetypestr
,
"srv"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_SRV
;
}
else
if
(
strn
cmp
(
filetypestr
,
"ext"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_EXT
;
}
else
if
(
strn
cmp
(
filetypestr
,
"ieg"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_IEG
;
}
if
(
mem
cmp
(
filetypestr
,
"grb2"
,
4
)
==
0
)
{
ftstr
+=
4
;
DefaultFileType
=
FILETYPE_GRB2
;}
else
if
(
mem
cmp
(
filetypestr
,
"grb"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_
GRB
;
}
else
if
(
mem
cmp
(
filetypestr
,
"nc2"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_NC2
;
}
else
if
(
mem
cmp
(
filetypestr
,
"nc4"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_NC4
;
}
else
if
(
mem
cmp
(
filetypestr
,
"nc"
,
2
)
==
0
)
{
ftstr
+=
2
;
DefaultFileType
=
FILETYPE_NC
;
}
else
if
(
mem
cmp
(
filetypestr
,
"srv"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_SRV
;
}
else
if
(
mem
cmp
(
filetypestr
,
"ext"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_EXT
;
}
else
if
(
mem
cmp
(
filetypestr
,
"ieg"
,
3
)
==
0
)
{
ftstr
+=
3
;
DefaultFileType
=
FILETYPE_IEG
;
}
else
{
fprintf
(
stderr
,
"Unsupported filetype %s!
\n
"
,
filetypestr
);
...
...
configure
View file @
cba2aedc
...
...
@@ -1310,6 +1310,7 @@ Optional Features:
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-largefile omit support for large files
--enable-grib GRIB support [default=yes]
--enable-dap Build OPeNDAP/DODS-enabled clients if possible
[default=no]
...
...
@@ -1333,7 +1334,7 @@ Optional Packages:
expect to find subdirs include and lib.
--with-hdf5=<directory> Specify location of HDF5 library. Configure will
expect to find subdirs include and lib.
--with-grib
Use the
internal
GRIB library [default=yes]
--with-
c
grib
ex
Use the GRIB library [default=yes]
--with-service Use the internal SERVICE library [default=yes]
--with-extra Use the internal EXTRA library [default=yes]
--with-ieg Use the internal IEG library [default=yes]
...
...
@@ -6242,18 +6243,17 @@ fi
fi
# ----------------------------------------------------------------------
# Compile interface with internal GRIB library
#
# Enable GRIB support
# Check whether --
with
-grib was given.
if
test
"
${
with
_grib
+set
}
"
=
set
;
then
withval
=
$with_grib
;
# Check whether --
enable
-grib was given.
if
test
"
${
enable
_grib
+set
}
"
=
set
;
then
enableval
=
$enable_grib
;
enable_grib
=
${
enableval
}
else
with
_grib
=
"
yes
"
enable
_grib
=
yes
fi
if
test
"
${
with
_grib
}
"
=
"yes"
;
then
if
test
"
${
enable
_grib
}
"
=
"yes"
;
then
cat
>>
confdefs.h
<<
\
_ACEOF
#define HAVE_LIBGRIB 1
...
...
@@ -6263,8 +6263,33 @@ fi
{
echo
"
$as_me
:
$LINENO
: checking for GRIB support"
>
&5
echo
$ECHO_N
"checking for GRIB support...
$ECHO_C
"
>
&6
;
}
{
echo
"
$as_me
:
$LINENO
: result:
$with_grib
"
>
&5
echo
"
${
ECHO_T
}
$with_grib
"
>
&6
;
}
{
echo
"
$as_me
:
$LINENO
: result:
$enable_grib
"
>
&5
echo
"
${
ECHO_T
}
$enable_grib
"
>
&6
;
}
# ----------------------------------------------------------------------
# Compile interface with internal CGRIBEX library
#
# Check whether --with-cgribex was given.
if
test
"
${
with_cgribex
+set
}
"
=
set
;
then
withval
=
$with_cgribex
;
else
with_cgribex
=
"yes"
fi
if
test
"
${
with_cgribex
}
"
=
"yes"
;
then
cat
>>
confdefs.h
<<
\
_ACEOF
#define HAVE_LIBCGRIBEX 1
_ACEOF
fi
{
echo
"
$as_me
:
$LINENO
: checking for CGRIBEX support"
>
&5
echo
$ECHO_N
"checking for CGRIBEX support...
$ECHO_C
"
>
&6
;
}
{
echo
"
$as_me
:
$LINENO
: result:
$with_cgribex
"
>
&5
echo
"
${
ECHO_T
}
$with_cgribex
"
>
&6
;
}
# ----------------------------------------------------------------------
# Compile interface with internal SERVICE library
...
...
configure.ac
View file @
cba2aedc
...
...
@@ -148,18 +148,30 @@ else
fi
# ----------------------------------------------------------------------
# Compile interface with internal GRIB library
#
AC_ARG_WITH([grib],
[AC_HELP_STRING([--with-grib], [Use the internal GRIB library [default=yes]])],,
with_grib="yes")
# Enable GRIB support
AC_ARG_ENABLE(grib,AS_HELP_STRING([--enable-grib],[GRIB support [[default=yes]]]),enable_grib=${enableval},enable_grib=yes)
if test "${
with
_grib}" = "yes"
; then
AC_DEFINE(HAVE_LIBGRIB, [1], [Define to 1 for GRIB
interface
])
if test "${
enable
_grib}" = "yes"; then
AC_DEFINE(HAVE_LIBGRIB, [1], [Define to 1 for GRIB
support
])
fi
AC_MSG_CHECKING([for GRIB support])
AC_MSG_RESULT($with_grib)
AC_MSG_RESULT($enable_grib)
# ----------------------------------------------------------------------
# Compile interface with internal CGRIBEX library
#
AC_ARG_WITH([cgribex],
[AC_HELP_STRING([--with-cgribex], [Use the GRIB library [default=yes]])],,
with_cgribex="yes")
if test "${with_cgribex}" = "yes" ; then
AC_DEFINE(HAVE_LIBCGRIBEX, [1], [Define to 1 for GRIB1 decoding/encoding with cgribex])
fi
AC_MSG_CHECKING([for CGRIBEX support])
AC_MSG_RESULT($with_cgribex)
# ----------------------------------------------------------------------
# Compile interface with internal SERVICE library
...
...
src/Makefile.am
View file @
cba2aedc
...
...
@@ -23,7 +23,7 @@ libcdi_a_SOURCES = \
vlist_att.c
\
basetime.c
\
stream_history.c
\
stream_gr
b.c
\
stream_
c
gr
ibex.c
\
stream_cdf.c
\
stream_srv.c
\
stream_ext.c
\
...
...
@@ -62,7 +62,7 @@ libcdi_a_SOURCES = \
timebase.h
\
vlist.h
\
taxis.h
\
stream_gr
b
.h
\
stream_
c
gr
ibex
.h
\
stream_cdf.h
\
stream_srv.h
\
stream_ext.h
\
...
...
src/Makefile.in
View file @
cba2aedc
...
...
@@ -63,7 +63,7 @@ am_libcdi_a_OBJECTS = cdiFortran.$(OBJEXT) cdi_error.$(OBJEXT) \
table.
$(OBJEXT)
util.
$(OBJEXT)
varscan.
$(OBJEXT)
\
calendar.
$(OBJEXT)
timebase.
$(OBJEXT)
vlist.
$(OBJEXT)
\
vlist_var.
$(OBJEXT)
vlist_att.
$(OBJEXT)
basetime.
$(OBJEXT)
\
stream_history.
$(OBJEXT)
stream_gr
b
.
$(OBJEXT)
\
stream_history.
$(OBJEXT)
stream_
c
gr
ibex
.
$(OBJEXT)
\
stream_cdf.
$(OBJEXT)
stream_srv.
$(OBJEXT)
stream_ext.
$(OBJEXT)
\
stream_ieg.
$(OBJEXT)
grid.
$(OBJEXT)
zaxis.
$(OBJEXT)
\
stream.
$(OBJEXT)
stream_var.
$(OBJEXT)
stream_record.
$(OBJEXT)
\
...
...
@@ -214,7 +214,7 @@ libcdi_a_SOURCES = \
vlist_att.c
\
basetime.c
\
stream_history.c
\
stream_gr
b.c
\
stream_
c
gr
ibex.c
\
stream_cdf.c
\
stream_srv.c
\
stream_ext.c
\
...
...
@@ -253,7 +253,7 @@ libcdi_a_SOURCES = \
timebase.h
\
vlist.h
\
taxis.h
\
stream_gr
b
.h
\
stream_
c
gr
ibex
.h
\
stream_cdf.h
\
stream_srv.h
\
stream_ext.h
\
...
...
@@ -383,8 +383,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/servicelib.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/stream.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/stream_cdf.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/stream_cgribex.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/stream_ext.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/stream_grb.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/stream_history.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/stream_ieg.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/stream_int.Po@am__quote@
...
...
src/config.h.in
View file @
cba2aedc
...
...
@@ -12,10 +12,13 @@
/* Define to 1 if you have the `isnan' function. */
#undef HAVE_ISNAN
/* Define to 1 for GRIB1 decoding/encoding with cgribex */
#undef HAVE_LIBCGRIBEX
/* Define to 1 for EXTRA interface */
#undef HAVE_LIBEXTRA
/* Define to 1 for GRIB
interface
*/
/* Define to 1 for GRIB
support
*/
#undef HAVE_LIBGRIB
/* Define to 1 if you have the `grib_api' library (-lgrib_api). */
...
...
src/stream.c
View file @
cba2aedc
...
...
@@ -8,7 +8,7 @@
#include
"cdi.h"
#include
"stream_int.h"
#include
"cdf.h"
#include
"stream_gr
b
.h"
#include
"stream_
c
gr
ibex
.h"
#include
"stream_cdf.h"
#include
"stream_srv.h"
#include
"stream_ext.h"
...
...
src/stream_gr
b
.c
→
src/stream_
c
gr
ibex
.c
View file @
cba2aedc
File moved
src/stream_gr
b
.h
→
src/stream_
c
gr
ibex
.h
View file @
cba2aedc
File moved
src/stream_record.c
View file @
cba2aedc
...
...
@@ -10,7 +10,7 @@
#include
"cdi.h"
#include
"cdf_int.h"
#include
"stream_int.h"
#include
"stream_gr
b
.h"
#include
"stream_
c
gr
ibex
.h"
#include
"stream_cdf.h"
#include
"stream_srv.h"
#include
"stream_ext.h"
...
...
@@ -228,8 +228,7 @@ void streamDefRecord(int streamID, int varID, int levelID)
gridID
=
vlistInqVarGrid
(
vlistID
,
varID
);
zaxisID
=
vlistInqVarZaxis
(
vlistID
,
varID
);
code
=
vlistInqVarCode
(
vlistID
,
varID
);
level
=
(
int
)
zaxisInqLevel
(
zaxisID
,
levelID
);
level
=
(
int
)
zaxisInqLevel
(
zaxisID
,
levelID
);
streamptr
->
record
->
varID
=
varID
;
streamptr
->
record
->
levelID
=
levelID
;
...
...
@@ -252,6 +251,13 @@ void streamDefRecord(int streamID, int varID, int levelID)
break
;
}
#endif
#if defined (HAVE_LIBGRIB_API)
case
FILETYPE_GRB2
:
{
status
=
grbDefRecord
(
streamID
);
break
;
}
#endif
#if defined (HAVE_LIBSERVICE)
case
FILETYPE_SRV
:
{
...
...
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