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

add new function: streamSync

parent bf6dec40
2008-12-?? Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* add new function: streamSync
* Version 1.2.1 released
2008-08-13 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* using GRIB library version 1.2.0
......
......@@ -121,7 +121,6 @@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SZLIBDIR = @SZLIBDIR@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
......
......@@ -115,7 +115,6 @@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SZLIBDIR = @SZLIBDIR@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for cdi 1.2.0.
# Generated by GNU Autoconf 2.61 for cdi 1.2.1.
#
# Report bugs to <Uwe.Schulzweida@zmaw.de>.
#
......@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='cdi'
PACKAGE_TARNAME='cdi'
PACKAGE_VERSION='1.2.0'
PACKAGE_STRING='cdi 1.2.0'
PACKAGE_VERSION='1.2.1'
PACKAGE_STRING='cdi 1.2.1'
PACKAGE_BUGREPORT='Uwe.Schulzweida@zmaw.de'
# Factoring default headers for most tests.
......@@ -710,7 +710,6 @@ RANLIB
CPP
GREP
EGREP
SZLIBDIR
FC
LIBOBJS
LTLIBOBJS'
......@@ -1230,7 +1229,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures cdi 1.2.0 to adapt to many kinds of systems.
\`configure' configures cdi 1.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1301,7 +1300,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of cdi 1.2.0:";;
short | recursive ) echo "Configuration of cdi 1.2.1:";;
esac
cat <<\_ACEOF
......@@ -1406,7 +1405,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
cdi configure 1.2.0
cdi configure 1.2.1
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
......@@ -1420,7 +1419,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by cdi $as_me 1.2.0, which was
It was created by cdi $as_me 1.2.1, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
......@@ -2245,7 +2244,7 @@ fi
# Define the identity of the package.
PACKAGE='cdi'
VERSION='1.2.0'
VERSION='1.2.1'
cat >>confdefs.h <<_ACEOF
......@@ -6393,10 +6392,14 @@ if test "${with_szlib+set}" = set; then
withval=$with_szlib; SZLIBDIR=$with_szlib
fi
{ echo "$as_me:$LINENO: result: $SZLIBDIR" >&5
if test -z "$SZLIBDIR" ; then
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
else
{ echo "$as_me:$LINENO: result: $SZLIBDIR" >&5
echo "${ECHO_T}$SZLIBDIR" >&6; }
LDFLAGS="$LDFLAGS -L$SZLIBDIR/lib"
CPPFLAGS="$CPPFLAGS -I$SZLIBDIR/include"
LDFLAGS="$LDFLAGS -L$SZLIBDIR/lib"
CPPFLAGS="$CPPFLAGS -I$SZLIBDIR/include"
{ echo "$as_me:$LINENO: checking for SZ_BufftoBuffCompress in -lsz" >&5
echo $ECHO_N "checking for SZ_BufftoBuffCompress in -lsz... $ECHO_C" >&6; }
......@@ -6470,8 +6473,8 @@ else
LDFLAGS="$LDFLAGS"
fi
SZLIBDIR=$SZLIBDIR
# AC_SUBST([SZLIBDIR], [$SZLIBDIR])
fi
# Check C / Fortran interface
......@@ -6916,7 +6919,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by cdi $as_me 1.2.0, which was
This file was extended by cdi $as_me 1.2.1, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -6969,7 +6972,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
cdi config.status 1.2.0
cdi config.status 1.2.1
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
......@@ -7248,7 +7251,7 @@ RANLIB!$RANLIB$ac_delim
CPP!$CPP$ac_delim
GREP!$GREP$ac_delim
EGREP!$EGREP$ac_delim
SZLIBDIR!$SZLIBDIR$ac_delim
FC!$FC$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
......@@ -7290,12 +7293,11 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
FC!$FC$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 3; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 2; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
......
# Process this file with autoconf to produce a configure script.
AC_INIT(cdi, 1.2.0, Uwe.Schulzweida@zmaw.de)
AC_INIT(cdi, 1.2.1, Uwe.Schulzweida@zmaw.de)
CONFIG_ABORT=yes
......@@ -208,11 +208,15 @@ AC_ARG_WITH([szlib],
[AS_HELP_STRING([--with-szlib=<directory>],
[Specify location of SZLIB library. Configure will expect to find subdirs include and lib.])],
[SZLIBDIR=$with_szlib])
AC_MSG_RESULT([$SZLIBDIR])
LDFLAGS="$LDFLAGS -L$SZLIBDIR/lib"
CPPFLAGS="$CPPFLAGS -I$SZLIBDIR/include"
AC_CHECK_LIB(sz, SZ_BufftoBuffCompress,, LDFLAGS="$LDFLAGS")
AC_SUBST([SZLIBDIR], [$SZLIBDIR])
if test -z "$SZLIBDIR" ; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([$SZLIBDIR])
LDFLAGS="$LDFLAGS -L$SZLIBDIR/lib"
CPPFLAGS="$CPPFLAGS -I$SZLIBDIR/include"
AC_CHECK_LIB(sz, SZ_BufftoBuffCompress, , LDFLAGS="$LDFLAGS")
# AC_SUBST([SZLIBDIR], [$SZLIBDIR])
fi
# Check C / Fortran interface
UD_CHECK_CFINT([$srcdir/src/cfortran.h])
......
......@@ -482,6 +482,15 @@ Read a variable.
Read a horizontal slice of a variable.
\section*{\tt \htmlref{streamSync}{streamSync}}
\begin{verbatim}
void streamSync (intstreamID);
\end{verbatim}
Synchronize an Open Dataset to Disk.
\section*{\tt \htmlref{streamWriteVar}{streamWriteVar}}
\begin{verbatim}
......
......@@ -483,6 +483,15 @@ Read a variable.
Read a horizontal slice of a variable.
\section*{\tt \htmlref{streamSync}{streamSync}}
\begin{verbatim}
SUBROUTINE streamSync (INTEGER streamID)
\end{verbatim}
Synchronize an Open Dataset to Disk.
\section*{\tt \htmlref{streamWriteVar}{streamWriteVar}}
\begin{verbatim}
......
......@@ -117,7 +117,6 @@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SZLIBDIR = @SZLIBDIR@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
......
......@@ -135,7 +135,6 @@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SZLIBDIR = @SZLIBDIR@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
......
......@@ -151,6 +151,18 @@ void cdf_enddef(int ncid)
}
void cdf_sync(int ncid)
{
static char func[] = "cdf_sync";
int status;
status = nc_sync(ncid);
if ( status != NC_NOERR )
Error(func, "%s", nc_strerror(status));
}
void cdf_inq(int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp)
{
static char func[] = "cdf_inq";
......
......@@ -11,6 +11,7 @@ void cdf_close (int ncid);
void cdf_redef (int ncid);
void cdf_enddef (int ncid);
void cdf_sync (int ncid);
void cdf_inq (int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp);
......
......@@ -180,6 +180,9 @@ int streamOpenAppend(const char *path);
/* streamClose: Close an open dataset */
void streamClose(int streamID);
/* streamSync: Synchronize an Open Dataset to Disk */
void streamSync(int streamID);
/* streamDefVlist: Define the Vlist for a stream */
void streamDefVlist(int streamID, int vlistID);
......@@ -673,6 +676,12 @@ void taxisDefRdate(int taxisID, int date);
/* taxisDefRtime: Define the reference date */
void taxisDefRtime(int taxisID, int time);
int taxisHasBounds(int taxisID);
void taxisInqVdateBounds(int taxisID, int *vdate_lb, int *vdate_ub);
void taxisInqVtimeBounds(int taxisID, int *vtime_lb, int *vtime_ub);
/* taxisDefCalendar: Define the calendar */
void taxisDefCalendar(int taxisID, int calendar);
......
!
! Fortran interface for CDI library version 1.2.0
! Fortran interface for CDI library version 1.2.1
!
INTEGER CDI_UNDEFID
......@@ -303,6 +303,10 @@
! (INTEGER streamID)
EXTERNAL streamClose
! streamSync
! (INTEGER streamID)
EXTERNAL streamSync
! streamDefVlist
! (INTEGER streamID,
! INTEGER vlistID)
......@@ -1519,6 +1523,22 @@
! INTEGER time)
EXTERNAL taxisDefRtime
INTEGER taxisHasBounds
! (INTEGER taxisID)
EXTERNAL taxisHasBounds
! taxisInqVdateBounds
! (INTEGER taxisID,
! INTEGER vdate_lb,
! INTEGER vdate_ub)
EXTERNAL taxisInqVdateBounds
! taxisInqVtimeBounds
! (INTEGER taxisID,
! INTEGER vtime_lb,
! INTEGER vtime_ub)
EXTERNAL taxisInqVtimeBounds
! taxisDefCalendar
! (INTEGER taxisID,
! INTEGER calendar)
......
......@@ -65,6 +65,7 @@ FCALLSCFUN1 (INT, streamOpenRead, STREAMOPENREAD, streamopenread, STRING)
FCALLSCFUN2 (INT, streamOpenWrite, STREAMOPENWRITE, streamopenwrite, STRING, INT)
FCALLSCFUN1 (INT, streamOpenAppend, STREAMOPENAPPEND, streamopenappend, STRING)
FCALLSCSUB1 (streamClose, STREAMCLOSE, streamclose, INT)
FCALLSCSUB1 (streamSync, STREAMSYNC, streamsync, INT)
FCALLSCSUB2 (streamDefVlist, STREAMDEFVLIST, streamdefvlist, INT, INT)
FCALLSCFUN1 (INT, streamInqVlist, STREAMINQVLIST, streaminqvlist, INT)
FCALLSCFUN1 (INT, streamInqFiletype, STREAMINQFILETYPE, streaminqfiletype, INT)
......@@ -327,6 +328,9 @@ FCALLSCSUB2 (taxisDefVdate, TAXISDEFVDATE, taxisdefvdate, INT, INT)
FCALLSCSUB2 (taxisDefVtime, TAXISDEFVTIME, taxisdefvtime, INT, INT)
FCALLSCSUB2 (taxisDefRdate, TAXISDEFRDATE, taxisdefrdate, INT, INT)
FCALLSCSUB2 (taxisDefRtime, TAXISDEFRTIME, taxisdefrtime, INT, INT)
FCALLSCFUN1 (INT, taxisHasBounds, TAXISHASBOUNDS, taxishasbounds, INT)
FCALLSCSUB3 (taxisInqVdateBounds, TAXISINQVDATEBOUNDS, taxisinqvdatebounds, INT, PINT, PINT)
FCALLSCSUB3 (taxisInqVtimeBounds, TAXISINQVTIMEBOUNDS, taxisinqvtimebounds, INT, PINT, PINT)
FCALLSCSUB2 (taxisDefCalendar, TAXISDEFCALENDAR, taxisdefcalendar, INT, INT)
FCALLSCSUB2 (taxisDefTunit, TAXISDEFTUNIT, taxisdeftunit, INT, INT)
FCALLSCSUB2 (taxisDefNumavg, TAXISDEFNUMAVG, taxisdefnumavg, INT, INT)
......
......@@ -1197,6 +1197,63 @@ void streamClose(int streamID)
}
/*
@Function streamSync
@Title Synchronize an Open Dataset to Disk
@Prototype void streamSync(int streamID)
@Parameter
@Item streamID Stream ID, from a previous call to @fref{streamOpenWrite}
@Description
The function @func{streamSync} offers a way to synchronize the disk copy of a dataset with in-memory buffers.
@EndFunction
*/
void streamSync(int streamID)
{
static char func[] = "streamSync";
int filetype;
int fileID;
int vlistID;
STREAM *streamptr;
streamptr = stream_to_pointer(streamID);
stream_check_ptr(func, streamptr);
fileID = streamptr->fileID;
filetype = streamptr->filetype;
vlistID = streamInqVlist(streamID);
if ( fileID == CDI_UNDEFID )
Warning(func, "File %s not open!", streamptr->filename);
else
{
if ( streamptr->filemode == 'w' || streamptr->filemode == 'a' )
{
switch (filetype)
{
#if defined (HAVE_LIBNETCDF)
case FILETYPE_NC:
case FILETYPE_NC2:
case FILETYPE_NC4:
{
void cdf_sync (int ncid);
cdf_sync(fileID);
break;
}
#endif
default:
{
break;
}
}
}
}
}
/*
@Function streamDefTimestep
@Title Define time step
......
......@@ -58,13 +58,14 @@ char *strdup(const char *s);
#endif
#ifndef DBL_IS_EQUAL
#if defined (HAVE_ISNAN)
# define DBL_IS_EQUAL(x,y) (isnan(x)||isnan(y)?(isnan(x)&&isnan(y)?1:0):!(fabs(x - y) > 0))
#if defined (XXX_HAVE_ISNAN)
# define DBL_IS_NAN(x) (isnan(x))
# define DBL_IS_EQUAL(x,y) (DBL_IS_NAN(x)||DBL_IS_NAN(y)?(DBL_IS_NAN(x)&&DBL_IS_NAN(y)?1:0):!(x < y || y < x))
#elif defined (XXX_FP_NAN)
# define DBL_IS_NAN(x) (fpclassify(x) == FP_NAN)
# define DBL_IS_EQUAL(x,y) (DBL_IS_NAN(x)||DBL_IS_NAN(y)?(DBL_IS_NAN(x)&&DBL_IS_NAN(y)?1:0):!(x < y || y < x))
#else
/*
# define DBL_IS_EQUAL(x,y) (fabs(x - y) <= 2.0*(y*DBL_EPSILON + DBL_MIN))
*/
# define DBL_IS_EQUAL(x,y) (!(fabs(x - y) > 0))
# define DBL_IS_EQUAL(x,y) (!(x < y || y < x))
#endif
#endif
......
......@@ -598,6 +598,19 @@ int taxisInqType(int taxisID)
}
int taxisHasBounds(int taxisID)
{
static char func[] = "taxisHasBounds";
TAXIS *taxisptr;
taxisptr = taxis_to_pointer(taxisID);
taxis_check_ptr(func, taxisptr);
return (taxisptr->has_bounds);
}
void taxisCopyTimestep(int taxisID2, int taxisID1)
{
static char func[] = "taxisCopyTimestep";
......@@ -655,6 +668,20 @@ int taxisInqVdate(int taxisID)
}
void taxisInqVdateBounds(int taxisID, int *vdate_lb, int *vdate_ub)
{
static char func[] = "taxisInqVdateBounds";
TAXIS *taxisptr;
taxisptr = taxis_to_pointer(taxisID);
taxis_check_ptr(func, taxisptr);
*vdate_lb = taxisptr->vdate_lb;
*vdate_ub = taxisptr->vdate_ub;
}
/*
@Function taxisInqVtime
@Title Get the verification time
......@@ -684,6 +711,20 @@ int taxisInqVtime(int taxisID)
}
void taxisInqVtimeBounds(int taxisID, int *vtime_lb, int *vtime_ub)
{
static char func[] = "taxisInqVtimeBounds";
TAXIS *taxisptr;
taxisptr = taxis_to_pointer(taxisID);
taxis_check_ptr(func, taxisptr);
*vtime_lb = taxisptr->vtime_lb;
*vtime_ub = taxisptr->vtime_ub;
}
/*
@Function taxisInqRdate
@Title Get the reference date
......
......@@ -107,7 +107,6 @@ RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SZLIBDIR = @SZLIBDIR@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
......
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