Commit bf886a61 authored by Uwe Schulzweida's avatar Uwe Schulzweida

Merge branch 'develop'

parents 9dd2233a 97bf5614
Schulzweida, U. (2017), Climate Data Operators (CDO) User Guide, Version 1.8.0,
Schulzweida, U. (2017), Climate Data Operators (CDO) User Guide, Version 1.8.2,
https://code.zmaw.de/projects/cdo/embedded/cdo.pdf
2017-05-15 Uwe Schulzweida
* Using CDI library version 1.8.2
* Version 1.8.2 release
2017-05-10 Uwe Schulzweida
* grid_check_lat_borders_rad: remove RAD2DEG (bug fix for remapycon with non global reg2d source grids)
2017-04-25 Uwe Schulzweida
* setcalendar, settaxis memory error (bug introduce in 1.8.1) [Bug #7691]
2017-04-21 Uwe Schulzweida
* setpartab: variable name does not change [Bug #7681]
* cmorlite: skipped empty key values [Bug #7681]
2017-04-14 Uwe Schulzweida
* removed fpe handling (speedup of 50% for ensmean ...)
2017-04-13 Uwe Schulzweida
* Using CDI library version 1.8.1
......
CDO NEWS
--------
Version 1.8.2 (15 May 2017):
Fixed bugs:
* setpartab: variable name does not change [Bug #7681]
* cmorlite: skipped empty key values [Bug #7681]
* setcalendar, settaxis memory error (bug introduce in 1.8.1) [Bug #7691]
Version 1.8.1 (6 April 2017):
New features:
......
......@@ -33,7 +33,7 @@ case "${HOSTNAME}" in
bailung*|d133*|d134*)
CDOLIBS="--enable-nearpt3 \
--with-fftw3 \
--with-grib_api=$HOME/local/grib_api-1.14.7 \
--with-grib_api=$HOME/local/grib_api-1.14.7aec \
--with-netcdf=$HOME/local/netcdf-c-4.3.3.1-threadsafe \
--with-hdf5=$HOME/local/hdf5-1.8.15-threadsafe \
--with-udunits2=/opt/local \
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for cdo 1.8.1.
# Generated by GNU Autoconf 2.68 for cdo 1.8.2.
#
# Report bugs to <http://mpimet.mpg.de/cdo>.
#
......@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='cdo'
PACKAGE_TARNAME='cdo'
PACKAGE_VERSION='1.8.1'
PACKAGE_STRING='cdo 1.8.1'
PACKAGE_VERSION='1.8.2'
PACKAGE_STRING='cdo 1.8.2'
PACKAGE_BUGREPORT='http://mpimet.mpg.de/cdo'
PACKAGE_URL=''
......@@ -1399,7 +1399,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 1.8.1 to adapt to many kinds of systems.
\`configure' configures cdo 1.8.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1469,7 +1469,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of cdo 1.8.1:";;
short | recursive ) echo "Configuration of cdo 1.8.2:";;
esac
cat <<\_ACEOF
......@@ -1619,7 +1619,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
cdo configure 1.8.1
cdo configure 1.8.2
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
......@@ -2212,7 +2212,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 cdo $as_me 1.8.1, which was
It was created by cdo $as_me 1.8.2, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
......@@ -3161,7 +3161,7 @@ fi
# Define the identity of the package.
PACKAGE='cdo'
VERSION='1.8.1'
VERSION='1.8.2'
cat >>confdefs.h <<_ACEOF
......@@ -21801,7 +21801,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by cdo $as_me 1.8.1, which was
This file was extended by cdo $as_me 1.8.2, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -21867,7 +21867,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
cdo config.status 1.8.1
cdo config.status 1.8.2
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
......
......@@ -4,7 +4,7 @@
# autoconf 2.68
# libtool 2.4.2
AC_INIT([cdo], [1.8.1], [http://mpimet.mpg.de/cdo])
AC_INIT([cdo], [1.8.2], [http://mpimet.mpg.de/cdo])
AC_DEFINE_UNQUOTED(CDO, ["$PACKAGE_VERSION"], [CDO version])
......
......@@ -198,7 +198,7 @@ keepaspectratio]{cdo_libdep.pdf}}%
\end{picture}
\begin{flushright}
\large \textbf{Climate Data Operators \\ Version 1.8.1 \\ April 2017}
\large \textbf{Climate Data Operators \\ Version 1.8.2 \\ May 2017}
\end{flushright}
\vfill
......
......@@ -14,7 +14,7 @@
\put(0,0.0){\line(1,0){3.95}}
\end{picture}
\begin{flushright}
{\small{Climate Data Operators \\ Version 1.8.1 \\ April 2017}}
{\small{Climate Data Operators \\ Version 1.8.2 \\ Mayy 2017}}
\end{flushright}
\vspace*{0mm}
......
......@@ -1207,6 +1207,8 @@ sub print_description {
if ( $math == 0 && $verb == 0 && $text == 0 ) {
# $line =~ s/CDO_PCTL_NBINS/CDO\\_PCTL\\_NBINS/og;
$line =~ s/_/\\_/og;
$line =~ s/i\\_1/i_1/og;
$line =~ s/i\\_2/i_2/og;
$line =~ s/\@newline/ \\\\/og;
$line =~ s/infiles/\\texttt{infiles}/og;
$line =~ s/infile1/\\texttt{infile1}/og;
......
......@@ -19,6 +19,7 @@ of two fields for each timestep. With
@IfMan
S(t) = {x, i_1(t,x) != missval and i_2(t,x) != missval}
@EndifMan
@IfDoc
@BeginDisplayMath
......@@ -29,6 +30,7 @@ it is
@IfMan
o(t,1) = Cor{(i_1(t,x), i_2(t,x)), x_1 < x <= x_n}
@EndifMan
@IfDoc
@BeginDisplayMath
......
......@@ -18,6 +18,7 @@ for each timestep. With
@IfMan
S(t) = {x, i_1(t,x) != missval and i_2(t,x) != missval}
@EndifMan
@IfDoc
@BeginDisplayMath
......@@ -28,6 +29,7 @@ it is
@IfMan
o(t,1) = Covar{(i_1(t,x), i_2(t,x)), x_1 < x <= x_n}
@EndifMan
@IfDoc
@BeginDisplayMath
......
......@@ -18,6 +18,7 @@ of two fields over all timesteps. With
@IfMan
S(x) = {t, i_1(t,x) != missval and i_2(t,x) != missval}
@EndifMan
@IfDoc
@BeginDisplayMath
......@@ -28,6 +29,7 @@ it is
@IfMan
o(1,x) = Cor{(i_1(t,x), i_2(t,x)), t_1 < t <= t_n}
@EndifMan
@IfDoc
@BeginDisplayMath
......
......@@ -17,6 +17,7 @@ over all timesteps. With
@IfMan
S(x) = {t, i_1(t,x) != missval and i_2(t,x) != missval}
@EndifMan
@IfDoc
@BeginDisplayMath
......@@ -27,10 +28,11 @@ it is
@IfMan
o(1,x) = Covar{(i_1(t,x), i_2(t,x)), t_1 < t <= t_n}
@EndifMan
@IfDoc
@BeginDisplayMath
o(1,x) = n^{-1} \sum\limits_{t \in S(x)} \left(i_1(t,x) - \overline{i_1(t,x)} \right)^2 \left(i_2(t,x) - \overline{i_2(t,x)} \right)^2
o(1,x) = n^{-1} \sum\limits_{t \in S(x)} \left(i_1(t,x) - \overline{i_1(t,x)} \right) \left(i_2(t,x) - \overline{i_2(t,x)} \right)
@EndDisplayMath
@EndifDoc
For every gridpoint @math{x} only those timesteps @math{t} belong to the sample,
......
......@@ -10,7 +10,7 @@ In this section the abbreviations as in the following table are used:
\makebox[2.5cm][l]{\textbf{covar}} \\
\end{array}
& &
n^{-1} \sum_{i=1}^{n} (x_i - \overline{x})^2 (y_i - \overline{y})^2
n^{-1} \sum_{i=1}^{n} (x_i - \overline{x}) (y_i - \overline{y})
\\
\begin{array}{l}
\makebox[2.5cm][l]{\textbf{covar} weighted by} \\
......
This diff is collapsed.
......@@ -232,7 +232,7 @@ void apply_cmorlist(list_t *pmlist, int nvars, int vlistID2, var_t *vars)
keyValues_t *kv = *(keyValues_t **)kvnode->data;
const char *key = kv->key;
const char *value = (kv->nvalues == 1) ? kv->values[0] : NULL;
if ( !value ) continue;
if ( !value || (value && !*value) ) continue;
if ( STR_IS_EQ(key, "missing_value") )
{
......@@ -277,9 +277,9 @@ void apply_cmorlist(list_t *pmlist, int nvars, int vlistID2, var_t *vars)
keyValues_t *kv = *(keyValues_t **)kvnode->data;
const char *key = kv->key;
const char *value = (kv->nvalues == 1) ? kv->values[0] : NULL;
if ( !value ) continue;
if ( !value || (value && !*value) ) continue;
//printf("key=%s value=%s\n", key, value);
// printf("key=%s value=>%s<\n", key, value);
if ( STR_IS_EQ(key, "standard_name") ) vlistDefVarStdname(vlistID2, varID, value);
else if ( STR_IS_EQ(key, "long_name") ) vlistDefVarLongname(vlistID2, varID, value);
......
This diff is collapsed.
......@@ -29,7 +29,13 @@
#include "grid.h"
#include "grid_search.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "clipping/geometry.h"
#ifdef __cplusplus
}
#endif
void fillmiss(field_type *field1, field_type *field2, int nfill)
......
......@@ -94,20 +94,20 @@ void *Fldstat(void *argument)
cdoInitialize(argument);
cdoOperatorAdd("fldrange", func_range, 0, NULL);
cdoOperatorAdd("fldmin", func_min, 0, NULL);
cdoOperatorAdd("fldmax", func_max, 0, NULL);
cdoOperatorAdd("fldsum", func_sum, 0, NULL);
cdoOperatorAdd("fldmean", func_mean, 1, NULL);
cdoOperatorAdd("fldavg", func_avg, 1, NULL);
cdoOperatorAdd("fldstd", func_std, 1, NULL);
cdoOperatorAdd("fldstd1", func_std1, 1, NULL);
cdoOperatorAdd("fldvar", func_var, 1, NULL);
cdoOperatorAdd("fldvar1", func_var1, 1, NULL);
cdoOperatorAdd("fldpctl", func_pctl, 0, NULL);
cdoOperatorAdd("fldrange", func_range, 0, NULL);
cdoOperatorAdd("fldmin", func_min, 0, NULL);
cdoOperatorAdd("fldmax", func_max, 0, NULL);
cdoOperatorAdd("fldsum", func_sum, 0, NULL);
cdoOperatorAdd("fldmean", func_meanw, 1, NULL);
cdoOperatorAdd("fldavg", func_avgw, 1, NULL);
cdoOperatorAdd("fldstd", func_stdw, 1, NULL);
cdoOperatorAdd("fldstd1", func_std1w, 1, NULL);
cdoOperatorAdd("fldvar", func_varw, 1, NULL);
cdoOperatorAdd("fldvar1", func_var1w, 1, NULL);
cdoOperatorAdd("fldpctl", func_pctl, 0, NULL);
int operatorID = cdoOperatorID();
int operfunc = cdoOperatorF1(operatorID);
int operfunc = cdoOperatorF1(operatorID);
bool needWeights = cdoOperatorF2(operatorID) != 0;
double pn = 0;
......
......@@ -447,13 +447,12 @@ int genBoxGrid(int gridID1, int xinc, int yinc)
static
void gridboxstat(field_type *field1, field_type *field2, int xinc, int yinc, int statfunc)
{
bool useWeight = false;
bool useWeight = (field1->weight != NULL);
/*
double findex = 0;
progressInit();
*/
if ( field1->weight ) useWeight = true;
int gridsize = xinc*yinc;
field_type *field = (field_type*) Malloc(ompNumThreads*sizeof(field_type));
......@@ -461,17 +460,15 @@ void gridboxstat(field_type *field1, field_type *field2, int xinc, int yinc, int
{
field[i].size = gridsize;
field[i].ptr = (double*) Malloc(gridsize*sizeof(double));
field[i].weight = NULL;
if ( useWeight )
field[i].weight = (double*) Malloc(gridsize*sizeof(double));
field[i].weight = (useWeight) ? (double*) Malloc(gridsize*sizeof(double)) : NULL;
field[i].missval = field1->missval;
field[i].nmiss = 0;
}
int gridID1 = field1->grid;
int gridID2 = field2->grid;
double *array1 = field1->ptr;
double *array2 = field2->ptr;
double *array1 = field1->ptr;
double *array2 = field2->ptr;
double missval = field1->missval;
int nlon1 = gridInqXsize(gridID1);
......@@ -554,22 +551,19 @@ void *Gridboxstat(void *argument)
int xinc = parameter2int(operatorArgv()[0]);
int yinc = parameter2int(operatorArgv()[1]);
cdoOperatorAdd("gridboxmin", func_min, 0, NULL);
cdoOperatorAdd("gridboxmax", func_max, 0, NULL);
cdoOperatorAdd("gridboxsum", func_sum, 0, NULL);
cdoOperatorAdd("gridboxmean", func_mean, 0, NULL);
cdoOperatorAdd("gridboxavg", func_avg, 0, NULL);
cdoOperatorAdd("gridboxvar", func_var, 0, NULL);
cdoOperatorAdd("gridboxvar1", func_var1, 0, NULL);
cdoOperatorAdd("gridboxstd", func_std, 0, NULL);
cdoOperatorAdd("gridboxstd1", func_std1, 0, NULL);
cdoOperatorAdd("gridboxmin", func_min, 0, NULL);
cdoOperatorAdd("gridboxmax", func_max, 0, NULL);
cdoOperatorAdd("gridboxsum", func_sum, 0, NULL);
cdoOperatorAdd("gridboxmean", func_meanw, 1, NULL);
cdoOperatorAdd("gridboxavg", func_avgw, 1, NULL);
cdoOperatorAdd("gridboxvar", func_varw, 1, NULL);
cdoOperatorAdd("gridboxvar1", func_var1w, 1, NULL);
cdoOperatorAdd("gridboxstd", func_stdw, 1, NULL);
cdoOperatorAdd("gridboxstd1", func_std1w, 1, NULL);
int operatorID = cdoOperatorID();
int operfunc = cdoOperatorF1(operatorID);
bool needWeights = (operfunc == func_mean || operfunc == func_avg ||
operfunc == func_var || operfunc == func_std ||
operfunc == func_var1 || operfunc == func_std1);
bool needWeights = cdoOperatorF2(operatorID) != 0;
int streamID1 = streamOpenRead(cdoStreamName(0));
......@@ -601,9 +595,7 @@ void *Gridboxstat(void *argument)
int gridsize1 = gridInqSize(gridID1);
field1.ptr = (double*) Malloc(gridsize1*sizeof(double));
field1.weight = NULL;
if ( needWeights )
field1.weight = (double*) Malloc(gridsize1*sizeof(double));
field1.weight = needWeights ? (double*) Malloc(gridsize1*sizeof(double)) : NULL;
int gridsize2 = gridInqSize(gridID2);
field2.ptr = (double*) Malloc(gridsize2*sizeof(double));
......
......@@ -303,6 +303,7 @@ cdo_SOURCES += Adisit.c \
Runpctl.c \
Runstat.c \
Samplegrid.c \
Samplegridicon.c \
Seascount.c \
Seaspctl.c \
Seasstat.c \
......
......@@ -217,12 +217,12 @@ am_cdo_OBJECTS = cdo-cdo.$(OBJEXT) cdo-Adisit.$(OBJEXT) \
cdo-Replace.$(OBJEXT) cdo-Replacevalues.$(OBJEXT) \
cdo-Rhopot.$(OBJEXT) cdo-Rotuv.$(OBJEXT) cdo-Runpctl.$(OBJEXT) \
cdo-Runstat.$(OBJEXT) cdo-Samplegrid.$(OBJEXT) \
cdo-Seascount.$(OBJEXT) cdo-Seaspctl.$(OBJEXT) \
cdo-Seasstat.$(OBJEXT) cdo-Selbox.$(OBJEXT) \
cdo-Selgridcell.$(OBJEXT) cdo-Select.$(OBJEXT) \
cdo-Selmulti.$(OBJEXT) cdo-Seloperator.$(OBJEXT) \
cdo-Selrec.$(OBJEXT) cdo-Seltime.$(OBJEXT) \
cdo-Selvar.$(OBJEXT) cdo-Set.$(OBJEXT) \
cdo-Samplegridicon.$(OBJEXT) cdo-Seascount.$(OBJEXT) \
cdo-Seaspctl.$(OBJEXT) cdo-Seasstat.$(OBJEXT) \
cdo-Selbox.$(OBJEXT) cdo-Selgridcell.$(OBJEXT) \
cdo-Select.$(OBJEXT) cdo-Selmulti.$(OBJEXT) \
cdo-Seloperator.$(OBJEXT) cdo-Selrec.$(OBJEXT) \
cdo-Seltime.$(OBJEXT) cdo-Selvar.$(OBJEXT) cdo-Set.$(OBJEXT) \
cdo-Setattribute.$(OBJEXT) cdo-Setbox.$(OBJEXT) \
cdo-Setgatt.$(OBJEXT) cdo-Setgrid.$(OBJEXT) \
cdo-Sethalo.$(OBJEXT) cdo-Setmiss.$(OBJEXT) \
......@@ -584,16 +584,16 @@ cdo_SOURCES = cdo.c Adisit.c Afterburner.c Arith.c Arithc.c \
Mrotuv.c Mrotuvb.c Ninfo.c Nmldump.c Output.c Outputgmt.c \
Pack.c Pardup.c Pinfo.c Pressure.c Regres.c Remap.c Remapeta.c \
Replace.c Replacevalues.c Rhopot.c Rotuv.c Runpctl.c Runstat.c \
Samplegrid.c Seascount.c Seaspctl.c Seasstat.c Selbox.c \
Selgridcell.c Select.c Selmulti.c Seloperator.c Selrec.c \
Seltime.c Selvar.c Set.c Setattribute.c Setbox.c Setgatt.c \
Setgrid.c Sethalo.c Setmiss.c Setpartab.c Setrcaname.c \
Settime.c Setzaxis.c Shiftxy.c Showinfo.c Sinfo.c Smooth.c \
Sort.c Sorttimestamp.c Specinfo.c Spectral.c Spectrum.c \
Split.c Splitrec.c Splitsel.c Splittime.c Splityear.c \
Subtrend.c Tee.c Templates.c Test.c Tests.c Timcount.c \
Timcumsum.c Timpctl.c Timselpctl.c Timselstat.c Timsort.c \
Timstat.c Timstat2.c Timstat3.c Tinfo.c Tocomplex.c \
Samplegrid.c Samplegridicon.c Seascount.c Seaspctl.c \
Seasstat.c Selbox.c Selgridcell.c Select.c Selmulti.c \
Seloperator.c Selrec.c Seltime.c Selvar.c Set.c Setattribute.c \
Setbox.c Setgatt.c Setgrid.c Sethalo.c Setmiss.c Setpartab.c \
Setrcaname.c Settime.c Setzaxis.c Shiftxy.c Showinfo.c Sinfo.c \
Smooth.c Sort.c Sorttimestamp.c Specinfo.c Spectral.c \
Spectrum.c Split.c Splitrec.c Splitsel.c Splittime.c \
Splityear.c Subtrend.c Tee.c Templates.c Test.c Tests.c \
Timcount.c Timcumsum.c Timpctl.c Timselpctl.c Timselstat.c \
Timsort.c Timstat.c Timstat2.c Timstat3.c Tinfo.c Tocomplex.c \
Transpose.c Trend.c Trms.c Tstepcount.c Vargen.c Varrms.c \
Vertintml.c Vertintap.c Vertstat.c Vertcum.c Vertwind.c \
Verifygrid.c Wct.c Wind.c WindTrans.c Writegrid.c \
......@@ -922,6 +922,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Runpctl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Runstat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Samplegrid.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Samplegridicon.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Seascount.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Seaspctl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Seasstat.Po@am__quote@
......@@ -3430,6 +3431,20 @@ cdo-Samplegrid.obj: Samplegrid.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Samplegrid.obj `if test -f 'Samplegrid.c'; then $(CYGPATH_W) 'Samplegrid.c'; else $(CYGPATH_W) '$(srcdir)/Samplegrid.c'; fi`
cdo-Samplegridicon.o: Samplegridicon.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Samplegridicon.o -MD -MP -MF $(DEPDIR)/cdo-Samplegridicon.Tpo -c -o cdo-Samplegridicon.o `test -f 'Samplegridicon.c' || echo '$(srcdir)/'`Samplegridicon.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cdo-Samplegridicon.Tpo $(DEPDIR)/cdo-Samplegridicon.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Samplegridicon.c' object='cdo-Samplegridicon.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Samplegridicon.o `test -f 'Samplegridicon.c' || echo '$(srcdir)/'`Samplegridicon.c
cdo-Samplegridicon.obj: Samplegridicon.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Samplegridicon.obj -MD -MP -MF $(DEPDIR)/cdo-Samplegridicon.Tpo -c -o cdo-Samplegridicon.obj `if test -f 'Samplegridicon.c'; then $(CYGPATH_W) 'Samplegridicon.c'; else $(CYGPATH_W) '$(srcdir)/Samplegridicon.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cdo-Samplegridicon.Tpo $(DEPDIR)/cdo-Samplegridicon.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Samplegridicon.c' object='cdo-Samplegridicon.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Samplegridicon.obj `if test -f 'Samplegridicon.c'; then $(CYGPATH_W) 'Samplegridicon.c'; else $(CYGPATH_W) '$(srcdir)/Samplegridicon.c'; fi`
cdo-Seascount.o: Seascount.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seascount.o -MD -MP -MF $(DEPDIR)/cdo-Seascount.Tpo -c -o cdo-Seascount.o `test -f 'Seascount.c' || echo '$(srcdir)/'`Seascount.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cdo-Seascount.Tpo $(DEPDIR)/cdo-Seascount.Po
......
......@@ -46,24 +46,24 @@ void *Merstat(void *argument)
int nmiss;
int nrecs;
int varID, levelID;
bool needWeights = false;
char varname[CDI_MAX_NAME];
cdoInitialize(argument);
cdoOperatorAdd("mermin", func_min, 0, NULL);
cdoOperatorAdd("mermax", func_max, 0, NULL);
cdoOperatorAdd("mersum", func_sum, 0, NULL);
cdoOperatorAdd("mermean", func_mean, 0, NULL);
cdoOperatorAdd("meravg", func_avg, 0, NULL);
cdoOperatorAdd("mervar", func_var, 0, NULL);
cdoOperatorAdd("mervar1", func_var1, 0, NULL);
cdoOperatorAdd("merstd", func_std, 0, NULL);
cdoOperatorAdd("merstd1", func_std1, 0, NULL);
cdoOperatorAdd("merpctl", func_pctl, 0, NULL);
cdoOperatorAdd("mermin", func_min, 0, NULL);
cdoOperatorAdd("mermax", func_max, 0, NULL);
cdoOperatorAdd("mersum", func_sum, 0, NULL);
cdoOperatorAdd("mermean", func_meanw, 1, NULL);
cdoOperatorAdd("meravg", func_avgw, 1, NULL);
cdoOperatorAdd("mervar", func_varw, 1, NULL);
cdoOperatorAdd("mervar1", func_var1w, 1, NULL);
cdoOperatorAdd("merstd", func_stdw, 1, NULL);
cdoOperatorAdd("merstd1", func_std1w, 1, NULL);
cdoOperatorAdd("merpctl", func_pctl, 0, NULL);
int operatorID = cdoOperatorID();
int operfunc = cdoOperatorF1(operatorID);
bool needWeights = cdoOperatorF2(operatorID) != 0;
double pn = 0;
if ( operfunc == func_pctl )
......@@ -73,11 +73,6 @@ void *Merstat(void *argument)
percentile_check_number(pn);
}
if ( operfunc == func_mean || operfunc == func_avg ||
operfunc == func_var || operfunc == func_std ||
operfunc == func_var1 || operfunc == func_std1 )
needWeights = true;
int streamID1 = streamOpenRead(cdoStreamName(0));
int vlistID1 = streamInqVlist(streamID1);
......
This diff is collapsed.
This diff is collapsed.
......@@ -121,7 +121,7 @@ void apply_parameterlist(pt_mode_t ptmode, list_t *pmlist, int nvars, int vlistI
list_t *kvlist = NULL;
if ( ptmode == CODE_NUMBER )
{
codenum = vlistInqVarCode(vlistID2, varID);
codenum = vlistInqVarCode(vlistID2, varID);
snprintf(valstr, sizeof(valstr), "%d", codenum);
kvlist = pmlist_search_kvlist_ventry(pmlist, "code", valstr, nventry, ventry);
if ( kvlist )
......@@ -176,7 +176,7 @@ void apply_parameterlist(pt_mode_t ptmode, list_t *pmlist, int nvars, int vlistI
if ( lv1 && STR_IS_EQ(key, "standard_name") ) vlistDefVarStdname(vlistID2, varID, value);
else if ( lv1 && STR_IS_EQ(key, "long_name") ) vlistDefVarLongname(vlistID2, varID, value);
else if ( lv1 && STR_IS_EQ(key, "units") ) cdo_define_var_units(var, vlistID2, varID, value);
else if ( lv1 && STR_IS_EQ(key, "name") ) /*vlistDefVarName(vlistID2, varID, parameter2word(value))*/;
else if ( lv1 && STR_IS_EQ(key, "name") && ptmode != VARIABLE_NAME ) vlistDefVarName(vlistID2, varID, parameter2word(value));
else if ( lv1 && STR_IS_EQ(key, "out_name") )
{
const char *outname = parameter2word(value);
......@@ -352,6 +352,8 @@ void *Setpartab(void *argument)
tableformat = 1;
}
if ( cdoVerbose ) cdoPrint("Table format version %d", tableformat);
int streamID1 = streamOpenRead(cdoStreamName(0));
int vlistID1 = streamInqVlist(streamID1);
......
This diff is collapsed.
......@@ -24,6 +24,9 @@
#include "remap.h"
#if defined(HAVE_LIBYAC)
#ifdef __cplusplus
extern "C" {
#endif
#include "points.h"
#include "grid_reg2d.h"
#include "grid_search.h"
......@@ -31,6 +34,9 @@
#include "search.h"
#include "clipping.h"
#include "area.h"
#ifdef __cplusplus
}
#endif
#endif
int timer_yar_remap, timer_yar_remap_init, timer_yar_remap_sort, timer_yar_remap_con, timer_yar_remap_bil;
......
......@@ -45,8 +45,8 @@ int array_minmaxsum_val(size_t len, const double *array, double *rmin, double *r
int array_minmaxmean_val(size_t len, const double *array, double *rmin, double *rmax, double *rmean)
{
int excepts = FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW;
feclearexcept(FE_ALL_EXCEPT);
// int excepts = FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW;
// feclearexcept(FE_ALL_EXCEPT); // expensive !!!!
double min = DBL_MAX;
double max = -DBL_MAX;
......@@ -67,18 +67,31 @@ int array_minmaxmean_val(size_t len, const double *array, double *rmin, double *
if ( rmax ) *rmax = max;
if ( rmean ) *rmean = mean;
return fetestexcept(excepts);
// return fetestexcept(excepts);
return 0;
}
int array_mean_val(size_t len, const double *restrict array, double *rmean)
{
double rsum = 0;
for ( size_t i = 0; i < len; ++i ) rsum += array[i];