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

No commit message

No commit message
parent b2e3fa89
......@@ -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
......
......@@ -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 ( strncmp(filetypestr, "grb2", 4) == 0 ) { ftstr += 4; DefaultFileType = FILETYPE_GRB2;}
else if ( strncmp(filetypestr, "grb", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC2; }
else if ( strncmp(filetypestr, "nc2", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC2; }
else if ( strncmp(filetypestr, "nc4", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC4; }
else if ( strncmp(filetypestr, "nc", 2) == 0 ) { ftstr += 2; DefaultFileType = FILETYPE_NC; }
else if ( strncmp(filetypestr, "srv", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_SRV; }
else if ( strncmp(filetypestr, "ext", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_EXT; }
else if ( strncmp(filetypestr, "ieg", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_IEG; }
if ( memcmp(filetypestr, "grb2", 4) == 0 ) { ftstr += 4; DefaultFileType = FILETYPE_GRB2;}
else if ( memcmp(filetypestr, "grb", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_GRB; }
else if ( memcmp(filetypestr, "nc2", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC2; }
else if ( memcmp(filetypestr, "nc4", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC4; }
else if ( memcmp(filetypestr, "nc", 2) == 0 ) { ftstr += 2; DefaultFileType = FILETYPE_NC; }
else if ( memcmp(filetypestr, "srv", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_SRV; }
else if ( memcmp(filetypestr, "ext", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_EXT; }
else if ( memcmp(filetypestr, "ieg", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_IEG; }
else
{
fprintf(stderr, "Unsupported filetype %s!\n", filetypestr);
......
......@@ -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-cgribex 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
......
......@@ -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
......
......@@ -23,7 +23,7 @@ libcdi_a_SOURCES = \
vlist_att.c \
basetime.c \
stream_history.c \
stream_grb.c \
stream_cgribex.c \
stream_cdf.c \
stream_srv.c \
stream_ext.c \
......@@ -62,7 +62,7 @@ libcdi_a_SOURCES = \
timebase.h \
vlist.h \
taxis.h \
stream_grb.h \
stream_cgribex.h \
stream_cdf.h \
stream_srv.h \
stream_ext.h \
......
......@@ -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_grb.$(OBJEXT) \
stream_history.$(OBJEXT) stream_cgribex.$(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_grb.c \
stream_cgribex.c \
stream_cdf.c \
stream_srv.c \
stream_ext.c \
......@@ -253,7 +253,7 @@ libcdi_a_SOURCES = \
timebase.h \
vlist.h \
taxis.h \
stream_grb.h \
stream_cgribex.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@
......
......@@ -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). */
......
......@@ -8,7 +8,7 @@
#include "cdi.h"
#include "stream_int.h"
#include "cdf.h"
#include "stream_grb.h"
#include "stream_cgribex.h"
#include "stream_cdf.h"
#include "stream_srv.h"
#include "stream_ext.h"
......
......@@ -10,7 +10,7 @@
#include "cdi.h"
#include "cdf_int.h"
#include "stream_int.h"
#include "stream_grb.h"
#include "stream_cgribex.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:
{
......
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