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

setreftime: use taxisDuplicate to copy bounds

parent 86954b7a
......@@ -251,8 +251,10 @@ src/exception.c -text
src/expr.c -text
src/expr.h -text
src/expr_lex.c -text
src/expr_lex.l -text
src/expr_yacc.c -text
src/expr_yacc.h -text
src/expr_yacc.y -text
src/field.c -text
src/field.h -text
src/field2.c -text
......@@ -298,4 +300,5 @@ src/util.c -text
src/util.h -text
src/vinterp.c -text
src/vinterp.h -text
src/yacc_lex -text
src/zaxis.c -text
Uwe Schulzweida, schulzweida@dkrz.de, is the main author.
Uwe Schulzweida, Uwe.Schulzweida@zmaw.de, is the main author.
2006-06-15 Uwe Schulzweida <schulzweida@dkrz.de>
* using CDI library version 1.0.0
* New operator: dv2ps (Wind) [request: Luis Kornblueh]
* setreftime: use taxisDuplicate to copy bounds [report: Ivonne Anders]
* Version 1.0.0 released
2006-05-04 Uwe Schulzweida <schulzweida@dkrz.de>
* using CDI library version 0.9.7
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for cdo 0.9.13.
# Generated by GNU Autoconf 2.59 for cdo 1.0.0.
#
# Report bugs to <schulzweida@dkrz.de>.
# Report bugs to <Uwe.Schulzweida@zmaw.de>.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
......@@ -269,9 +269,9 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='cdo'
PACKAGE_TARNAME='cdo'
PACKAGE_VERSION='0.9.13'
PACKAGE_STRING='cdo 0.9.13'
PACKAGE_BUGREPORT='schulzweida@dkrz.de'
PACKAGE_VERSION='1.0.0'
PACKAGE_STRING='cdo 1.0.0'
PACKAGE_BUGREPORT='Uwe.Schulzweida@zmaw.de'
# Factoring default headers for most tests.
ac_includes_default="\
......@@ -783,7 +783,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 cdo 0.9.13 to adapt to many kinds of systems.
\`configure' configures cdo 1.0.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -850,7 +850,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of cdo 0.9.13:";;
short | recursive ) echo "Configuration of cdo 1.0.0:";;
esac
cat <<\_ACEOF
......@@ -896,7 +896,7 @@ Some influential environment variables:
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to <schulzweida@dkrz.de>.
Report bugs to <Uwe.Schulzweida@zmaw.de>.
_ACEOF
fi
......@@ -992,7 +992,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
cdo configure 0.9.13
cdo configure 1.0.0
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
......@@ -1006,7 +1006,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by cdo $as_me 0.9.13, which was
It was created by cdo $as_me 1.0.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
......@@ -1692,7 +1692,7 @@ fi
# Define the identity of the package.
PACKAGE=cdo
VERSION=0.9.13
VERSION=1.0.0
cat >>confdefs.h <<_ACEOF
......@@ -4072,9 +4072,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ---------------------------------- ##
## Report this to schulzweida@dkrz.de ##
## ---------------------------------- ##
## -------------------------------------- ##
## Report this to Uwe.Schulzweida@zmaw.de ##
## -------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
......@@ -4722,9 +4722,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ---------------------------------- ##
## Report this to schulzweida@dkrz.de ##
## ---------------------------------- ##
## -------------------------------------- ##
## Report this to Uwe.Schulzweida@zmaw.de ##
## -------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
......@@ -5071,9 +5071,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ---------------------------------- ##
## Report this to schulzweida@dkrz.de ##
## ---------------------------------- ##
## -------------------------------------- ##
## Report this to Uwe.Schulzweida@zmaw.de ##
## -------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
......@@ -5351,9 +5351,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ---------------------------------- ##
## Report this to schulzweida@dkrz.de ##
## ---------------------------------- ##
## -------------------------------------- ##
## Report this to Uwe.Schulzweida@zmaw.de ##
## -------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
......@@ -5636,9 +5636,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ---------------------------------- ##
## Report this to schulzweida@dkrz.de ##
## ---------------------------------- ##
## -------------------------------------- ##
## Report this to Uwe.Schulzweida@zmaw.de ##
## -------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
......@@ -5916,9 +5916,9 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ---------------------------------- ##
## Report this to schulzweida@dkrz.de ##
## ---------------------------------- ##
## -------------------------------------- ##
## Report this to Uwe.Schulzweida@zmaw.de ##
## -------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
......@@ -6495,7 +6495,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by cdo $as_me 0.9.13, which was
This file was extended by cdo $as_me 1.0.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -6558,7 +6558,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
cdo config.status 0.9.13
cdo config.status 1.0.0
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
......
# Process this file with autoconf to produce a configure script.
AC_INIT(cdo, 0.9.13, schulzweida@dkrz.de)
AC_INIT(cdo, 1.0.0, Uwe.Schulzweida@zmaw.de)
CONFIG_ABORT=yes
......
No preview for this file type
\begin{thebibliography}{xx}
\bibitem[ECHAM]{ECHAM}
``The atmospheric general circulation model ECHAM5'', \hfill \\
Erich Roeckner et al., 2004, \hfill \\
\bibitem[ECHAM]{ECHAM} \ \\
\href{http://www.mpimet.mpg.de/wissenschaft/publikationen/reports.html}
{http://www.mpimet.mpg.de/wissenschaft/publikationen/reports.html}
{The atmospheric general circulation model ECHAM5},
from the
\href{http://www.mpimet.mpg.de}
{Max Planck Institute for Meteorologie}
\bibitem[GRIB]{GRIB}
``Guide to WMO Binary Code Form GRIB 1'', \hfill \\
John Stackpole, 1994, \hfill \\
\href{http://www.wmo.ch/web/www/WDM/Guides/Guide-binary.html}
{http://www.wmo.ch/web/www/WDM/Guides/Guide-binary.html}
\bibitem[GRIB]{GRIB} \ \\
\href{http://www.wmo.ch/web/www/WMOCodes/Guides/GRIB/GRIB1-Contents.html}
{GRIB version 1},
from the World Meteorological Organisation
(\href{http://www.wmo.ch}{WMO})
\bibitem[netCDF]{netCDF}
``NetCDF User's Guide'',\hfill \\
Russ Rew, Glenn Davis, Steve Emmerson, Harvey Davies, 2005, \hfill \\
\href{http://www.unidata.ucar.edu/packages/netcdf/index.html}
{http://www.unidata.ucar.edu/packages/netcdf/index.html}
\bibitem[netCDF]{netCDF} \ \\
\href{http://www.unidata.ucar.edu/packages/netcdf/index.html}{NetCDF Software Package},
from the
\href{http://www.unidata.ucar.edu}{UNIDATA}
Program Center of the University Corporation for Atmospheric Research
\bibitem[PINGO]{PINGO}
``The PINGO package'', \hfill \\
Juergen Waszkewitz, Peter Lenzen, Nathan Gillet, 1996, \hfill \\
\href{http://www.mad.zmaw.de/Pingo/post/down/BigPingo.pdf}
{http://www.mad.zmaw.de/Pingo/post/down/BigPingo.pdf}
\bibitem[PINGO]{PINGO} \ \\
\href{http://www.mad.zmaw.de/Pingo/post/down/BigPingo.pdf}{The PINGO package},
from the
\href{http://www.mad.zmaw.de}{Model \& Data group}
at the Max Planck Institute for Meteorologie
\bibitem[SCRIP]{SCRIP}
``A User's Guide for SCRIP'', \hfill \\
Philip W. Jones, 1998, \hfill \\
\href{http://climate.lanl.gov/Software/SCRIP/SCRIPusers.pdf}
{http://climate.lanl.gov/Software/SCRIP/SCRIPusers.pdf}
\bibitem[SCRIP]{SCRIP} \ \\
\href{http://climate.lanl.gov/Software/SCRIP}{SCRIP Software Package},
from the Los Alamos National Laboratory
\end{thebibliography}
......@@ -152,7 +152,6 @@
\Large\bf{Uwe Schulzweida}
%\Large\bf{Max-Planck-Institut f\"ur Meteorologie}
\Large\bf{Max-Planck-Institute for Meteorology}
\begin{picture}(16,1)
......
\section{Building from sources}
This section describe how to build \CDO from the sources on a UNIX system.
This section describes how to build \CDO from the sources on a UNIX system.
\CDO is using the GNU configure and build system to compile the source code.
The only requirement is a functioning ANSI C compiler.
The only requirement is a working ANSI C compiler.
%First go to the \href{http://www.mpimet.mpg.de/~cdo/download.html}{\tt download} page
%({\tt http://www.mpimet.mpg.de/\~\,cdo/download.html}) to get the latest distribution,
......@@ -81,15 +81,8 @@ possibly as root if the destination permissions require that.
\end{verbatim}
The binary is installed into the directory {\tt $<$prefix$>$/bin}.
{\tt $<$prefix$>$} defaults to {\tt /usr/local} but can be changed with
the {\tt --prefix} option of the configure script.
Alternatively, you can also copy the binary from the {\tt src} directory
manually to some {\tt bin} directory in your search path.
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "missval"
%%% End:
......@@ -49,7 +49,7 @@ void *Cond2(void *argument)
double *array1, *array2, *array3, *array4;
int **varnmiss1 = NULL;
double **vardata1 = NULL;
int taxisID2, taxisID3, taxisID4;
int taxisID2, taxisID4;
cdoInitialize(argument);
......@@ -70,7 +70,6 @@ void *Cond2(void *argument)
vlistID4 = vlistDuplicate(vlistID2);
taxisID2 = vlistInqTaxis(vlistID2);
taxisID3 = vlistInqTaxis(vlistID3);
taxisID4 = taxisDuplicate(taxisID2);
vlistDefTaxis(vlistID4, taxisID4);
......
......@@ -91,7 +91,7 @@ void *Detrend(void *argument)
vlistID2 = vlistDuplicate(vlistID1);
taxisID1 = vlistInqTaxis(vlistID1);
taxisID2 = taxisNew(TAXIS_ABSOLUTE);
taxisID2 = taxisCreate(TAXIS_ABSOLUTE);
vlistDefTaxis(vlistID2, taxisID2);
streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
......
......@@ -114,7 +114,7 @@ void *Expr(void *argument)
nvars = vlistNvars(vlistID1);
vlistID2 = vlistNew();
vlistID2 = vlistCreate();
prs_arg.init = 1;
prs_arg.vlistID1 = vlistID1;
......@@ -249,6 +249,8 @@ void *Expr(void *argument)
tsID++;
}
vlistDestroy(vlistID2);
streamClose(streamID2);
streamClose(streamID1);
......
......@@ -37,7 +37,7 @@
void *Filedes(void *argument)
{
int GRIDDES, ZAXISDES, VCT, VARDES, TIMEDES, FILEDES, VLIST;
int GRIDDES, ZAXISDES, VCT, VARDES, TAXISDES, FILEDES, VLIST;
int operatorID;
int streamID = 0;
int zaxisID;
......@@ -49,9 +49,9 @@ void *Filedes(void *argument)
GRIDDES = cdoOperatorAdd("griddes", 0, 0, NULL);
ZAXISDES = cdoOperatorAdd("zaxisdes", 0, 0, NULL);
TAXISDES = cdoOperatorAdd("taxisdes", 0, 0, NULL);
VCT = cdoOperatorAdd("vct", 0, 0, NULL);
VARDES = cdoOperatorAdd("vardes", 0, 0, NULL);
TIMEDES = cdoOperatorAdd("timedes", 0, 0, NULL);
FILEDES = cdoOperatorAdd("filedes", 0, 0, NULL);
VLIST = cdoOperatorAdd("vlist", 0, 0, NULL);
......@@ -76,6 +76,106 @@ void *Filedes(void *argument)
for ( index = 0; index < nzaxis; index++ )
zaxisPrint(vlistZaxis(vlistID, index));
}
else if ( operatorID == TAXISDES )
{
int vdate, vtime, ntsteps, nrecs;
int year, month, day, hour, minute;
int taxisID, tsID;
taxisID = vlistInqTaxis(vlistID);
ntsteps = vlistNtsteps(vlistID);
fprintf(stdout, " Time axis : ");
if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
fprintf(stdout, "relative");
else if ( taxisInqType(taxisID) == TAXIS_ABSOLUTE )
fprintf(stdout, "absolute");
else
fprintf(stdout, "unknown");
fprintf(stdout, "\n");
taxisID = vlistInqTaxis(vlistID);
if ( ntsteps != 0 )
{
if ( ntsteps == CDI_UNDEFID )
fprintf(stdout, " Time steps : unlimited\n");
else
fprintf(stdout, " Time steps : %d\n", ntsteps);
if ( taxisID != CDI_UNDEFID )
{
int calendar, unit;
if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
{
vdate = taxisInqRdate(taxisID);
vtime = taxisInqRtime(taxisID);
decode_date(vdate, &year, &month, &day);
decode_time(vtime, &hour, &minute);
fprintf(stdout, " RefTime = %4.4d-%2.2d-%2.2d %2.2d:%2.2d",
year, month, day, hour, minute);
unit = taxisInqTunit(taxisID);
if ( unit != CDI_UNDEFID )
{
if ( unit == TUNIT_YEAR )
fprintf(stdout, " Units = years");
else if ( unit == TUNIT_MONTH )
fprintf(stdout, " Units = months");
else if ( unit == TUNIT_DAY )
fprintf(stdout, " Units = days");
else if ( unit == TUNIT_HOUR )
fprintf(stdout, " Units = hours");
else if ( unit == TUNIT_MINUTE )
fprintf(stdout, " Units = minutes");
else if ( unit == TUNIT_SECOND )
fprintf(stdout, " Units = seconds");
else
fprintf(stdout, " Units = unknown");
}
calendar = taxisInqCalendar(taxisID);
if ( calendar != CDI_UNDEFID )
{
if ( calendar == CALENDAR_STANDARD )
fprintf(stdout, " Calendar = STANDARD");
else if ( calendar == CALENDAR_NONE )
fprintf(stdout, " Calendar = NONE");
else if ( calendar == CALENDAR_360DAYS )
fprintf(stdout, " Calendar = 360DAYS");
else if ( calendar == CALENDAR_365DAYS )
fprintf(stdout, " Calendar = 365DAYS");
else if ( calendar == CALENDAR_366DAYS )
fprintf(stdout, " Calendar = 366DAYS");
else
fprintf(stdout, " Calendar = unknown");
}
fprintf(stdout, "\n");
}
}
fprintf(stdout, " time verification time lower bound upper bound\n");
fprintf(stdout, " step YYYY-MM-DD HH:MM YYYY-MM-DD HH:MM YYYY-MM-DD HH:MM\n");
tsID = 0;
while ( (nrecs = streamInqTimestep(streamID, tsID)) )
{
vdate = taxisInqVdate(taxisID);
vtime = taxisInqVtime(taxisID);
decode_date(vdate, &year, &month, &day);
decode_time(vtime, &hour, &minute);
tsID++;
fprintf(stdout, " %5d %4.4d-%2.2d-%2.2d %2.2d:%2.2d", tsID, year, month, day, hour, minute);
fprintf(stdout, "\n");
}
}
}
else if ( operatorID == VCT )
{
for ( index = 0; index < nzaxis; index++)
......
......@@ -65,7 +65,7 @@ void *Fldrms(void *argument)
slon = 0;
slat = 0;
gridID3 = gridNew(GRID_LONLAT, 1);
gridID3 = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID3, 1);
gridDefYsize(gridID3, 1);
gridDefXvals(gridID3, &slon);
......
......@@ -83,7 +83,7 @@ void *Fldstat(void *argument)
slon = 0;
slat = 0;
gridID2 = gridNew(GRID_LONLAT, 1);
gridID2 = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID2, 1);
gridDefYsize(gridID2, 1);
gridDefXvals(gridID2, &slon);
......
......@@ -84,7 +84,7 @@ void *Histogram(void *argument)
vlistID2 = vlistDuplicate(vlistID1);
/* create zaxis for output bins */
zaxisID2 = zaxisNew(ZAXIS_GENERIC, nbins);
zaxisID2 = zaxisCreate(ZAXIS_GENERIC, nbins);
bins = (double *) malloc(nbins*sizeof(double));
for ( i = 0; i < nbins; i++ ) bins[i] = (fltarr[i]+fltarr[i+1])/2;
zaxisDefLevels(zaxisID2, bins);
......
......@@ -162,7 +162,7 @@ void *Input(void *argument)
array = (double *) malloc(gridsize*sizeof(double));
gridID = gridNew(GRID_GENERIC, gridsize);
gridID = gridCreate(GRID_GENERIC, gridsize);
}
else
{
......@@ -208,7 +208,7 @@ void *Input(void *argument)
array = (double *) malloc(gridsize*sizeof(double));
gridID = gridNew(GRID_GENERIC, gridsize);
gridID = gridCreate(GRID_GENERIC, gridsize);
gridDefXsize(gridID, nlon);
gridDefYsize(gridID, nlat);
}
......@@ -226,19 +226,20 @@ void *Input(void *argument)
if ( nrecs == 0 )
{
zaxisID = zaxisNew(ZAXIS_SURFACE, 1);
zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
vlistID = vlistNew();
vlistID = vlistCreate();
varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_VARIABLE);
vlistDefVarCode(vlistID, varID, code);
taxisID = taxisNew(TAXIS_ABSOLUTE);
taxisID = taxisCreate(TAXIS_ABSOLUTE);
vlistDefTaxis(vlistID, taxisID);
streamID = streamOpenWrite(cdoStreamName(0), output_filetype);
if ( streamID < 0 ) cdiError(streamID, "Open failed on %s", cdoStreamName(0));
streamDefVlist(streamID, vlistID);
vlistDestroy(vlistID);
}
vdate = date;
......
......@@ -70,7 +70,7 @@ void *Intgrid(void *argument)
operatorCheckArgc(2);
slon = atof(operatorArgv()[0]);
slat = atof(operatorArgv()[1]);
gridID2 = gridNew(GRID_LONLAT, 1);
gridID2 = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID2, 1);
gridDefYsize(gridID2, 1);
gridDefXvals(gridID2, &slon);
......
......@@ -114,7 +114,7 @@ void *Intgridtraj(void *argument)
vardata2[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
}
gridID2 = gridNew(GRID_TRAJECTORY, 1);
gridID2 = gridCreate(GRID_TRAJECTORY, 1);
gridDefXsize(gridID2, 1);
gridDefYsize(gridID2, 1);
gridDefXvals(gridID2, &xpos);
......
......@@ -72,7 +72,7 @@ void *Merge(void *argument)
taxisID1 = vlistInqTaxis(vlistID1);
taxisID2 = taxisDuplicate(taxisID1);
vlistID2 = vlistNew();
vlistID2 = vlistCreate();
vlistCopy(vlistID2, vlistIDs[0]);
/* for ( index = 1; index < nmerge; index++ ) vlistCat(vlistID2, vlistIDs[index]); */
for ( index = 1; index < nmerge; index++ ) vlistMerge(vlistID2, vlistIDs[index]);
......@@ -84,6 +84,7 @@ void *Merge(void *argument)
vlistDefTaxis(vlistID2, taxisID2);
streamDefVlist(streamID2, vlistID2);
vlistDestroy(vlistID2);
if ( ! lcopy )
{
......
Supports Markdown
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