Commit dabdcc00 authored by Fabian Wachsmann's avatar Fabian Wachsmann
Browse files

Merge branch 'develop' into cmor3

parents 229e03aa 7238e983
2017-08-15 Uwe Schulzweida
2017-09-27 Uwe Schulzweida
* Using CDI library version 1.9.1
* Version 1.9.1 release
2017-09-01 Uwe Schulzweida
* Implementation of option --reduce_dim for z axis
2017-08-31 Uwe Schulzweida
* Implementation of option --reduce_dim for time axis
* Implementation of option --reduce_dim for x/y axis
2017-08-30 Uwe Schulzweida
* tee: added docu
* eof: check missing values
2017-08-14 Uwe Schulzweida
* eof, eof3d: set default of env. CDO_WEIGHT_MODE to off
* eof3d, eofcoeff3d: preserve variable name on output files [report: Frank Kauker]
2017-08-12 Uwe Schulzweida
* eof3d: weight was allocated for only one level (bug fix) [report: Frank Kauker]
2017-07-27 Uwe Schulzweida
* Using CDI library version 1.9.0
* Version 1.9.0 release
2017-07-25 Uwe Schulzweida
* uvDestag: HIRLAM extensions (patch from Michal Koutek)
2017-07-24 Uwe Schulzweida
* remap: deactivate links_per_value() [Bug #7821]
2017-07-22 Uwe Schulzweida
* grid_search_reg2d_nn: bug fix for nx/ny = 1
2017-07-14 Uwe Schulzweida
* settaxis: made time argument optional
......@@ -21,7 +61,7 @@
2017-06-27 Uwe Schulzweida
* expr: added support for clev in ifthenelse (bug fix).
* expr: added support for clev in ternary operator (bug fix).
* setpartabp: param key values without leading zeros (bug fix).
2017-06-08 Uwe Schulzweida
......
CDO NEWS
--------
Version 1.9.0 (15 September 2017):
Version 1.9.1 (27 September 2017):
New operators:
* tee - Duplicate a data stream
Changes operators:
* eof, eof3d: set default value of environment variable CDO_WEIGHT_MODE to off
Fixed bugs:
* --cmor option doesn't work for lon/lat bounds (introduced in 1.9.0)
* eof3d: weight array was allocated for only one level (bug fix)
Version 1.9.0 (27 July 2017):
New features:
* Code changed from ANSI C99 to ISO C++11
* Added configure option for ecCodes --with-eccodes=<yes|no|directory>
* Added range operator to all statistic modules (e.g. yearrange, zonrange)
New operators:
*
Fixed bugs:
* expr: improve ternary operator, no brackets needed anymore.
* expr: added support for clev in ternary operator.
* mergetime: wrong time information if first input file does not contain the first time step (bug introduce in 1.8.1) [Bug #7760]
* remapcon/remapycon produces wrong results for some grid combinations (introduced in 1.8.0) [Bug #7821]
* mergetime: wrong time information if first input file does not contain the first time step (bug introduced in 1.8.1) [Bug #7760]
* percentile: fix wrong result with method numpy (linear interpolation) and nist [Bug #7798]
Version 1.8.2 (15 May 2017):
......
......@@ -43,6 +43,7 @@ Operator catalog:
-------------------------------------------------------------
Copy copy Copy datasets
Copy cat Concatenate datasets
Tee tee Duplicate a data stream
Replace replace Replace variables
Duplicate duplicate Duplicates a dataset
Mergegrid mergegrid Merge grid
......
......@@ -48,7 +48,7 @@ case "${HOSTNAME}" in
$CDOLIBS \
LDFLAGS="-Wl,-rpath,$HOME/local/eccodes-2.3.0/lib -Wl,-rpath,/opt/intel/lib" \
CXX=icpc CXXFLAGS="-g -Wall -O2 -qopt-report=5 -march=native" \
CC=icc CFLAGS="-g -Wall -O2 -qopt-report=5 -march=native"
CC=icc CFLAGS="-g -Wall -O2 -qopt-report=5 -march=native -fp-model strict"
elif test "$COMP" = clang ; then
${CONFPATH}configure --prefix=$HOME/local \
--enable-maintainer-mode \
......@@ -105,12 +105,12 @@ case "${HOSTNAME}" in
if test "$COMP" = intel ; then
${CONFPATH}configure --prefix=$HOME/local --disable-openmp \
$CDOLIBS \
$CDOLIBS LDFLAGS="-Wl,-rpath,$HOME/local/eccodes-2.3.0/lib" \
CXX=icpc CXXFLAGS="-g -Wall -O2 -qopt-report=5 -march=native" \
CC=icc CFLAGS="-g -Wall -O2 -qopt-report=5 -march=native"
elif test "$COMP" = clang ; then
${CONFPATH}configure \
$CDOLIBS \
$CDOLIBS LDFLAGS="-Wl,-rpath,$HOME/local/eccodes-2.3.0/lib" \
CXX=clang++ CXXFLAGS="-g -Wall -pedantic -O3" \
CC=clang CFLAGS="-g -Wall -pedantic -O3"
elif test "$COMP" = clang4 ; then
......@@ -120,7 +120,7 @@ case "${HOSTNAME}" in
CC=clang-mp-4.0 CFLAGS="-g -Wall -pedantic -O3"
elif test "$COMP" = pgi ; then
${CONFPATH}configure --disable-openmp \
$CDOLIBS \
$CDOLIBS LDFLAGS="-Wl,-rpath,$HOME/local/eccodes-2.3.0/lib" \
CXX=pgc++ CXXFLAGS="-g -fast" \
CC=pgcc CFLAGS="-g -fast"
else
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for cdo 1.9.0rc2.
# Generated by GNU Autoconf 2.68 for cdo 1.9.1rc1.
#
# 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.9.0rc2'
PACKAGE_STRING='cdo 1.9.0rc2'
PACKAGE_VERSION='1.9.1rc1'
PACKAGE_STRING='cdo 1.9.1rc1'
PACKAGE_BUGREPORT='http://mpimet.mpg.de/cdo'
PACKAGE_URL=''
......@@ -1401,7 +1401,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.9.0rc2 to adapt to many kinds of systems.
\`configure' configures cdo 1.9.1rc1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1471,7 +1471,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of cdo 1.9.0rc2:";;
short | recursive ) echo "Configuration of cdo 1.9.1rc1:";;
esac
cat <<\_ACEOF
......@@ -1623,7 +1623,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
cdo configure 1.9.0rc2
cdo configure 1.9.1rc1
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
......@@ -2216,7 +2216,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.9.0rc2, which was
It was created by cdo $as_me 1.9.1rc1, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
......@@ -3165,7 +3165,7 @@ fi
# Define the identity of the package.
PACKAGE='cdo'
VERSION='1.9.0rc2'
VERSION='1.9.1rc1'
cat >>confdefs.h <<_ACEOF
......@@ -22387,7 +22387,7 @@ ac_config_files="$ac_config_files test/File.test test/Read_grib.test test/Read_n
ac_config_files="$ac_config_files test/Comp.test test/Compc.test"
ac_config_files="$ac_config_files test/Cat.test test/Gridarea.test test/Genweights.test test/Remap.test test/Remap2.test"
ac_config_files="$ac_config_files test/Cat.test test/Gridarea.test test/Genweights.test test/Remap.test test/Remap2.test test/Remapeta.test"
ac_config_files="$ac_config_files test/EOF.test test/Select.test test/Spectral.test test/Vertint.test"
......@@ -22983,7 +22983,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.9.0rc2, which was
This file was extended by cdo $as_me 1.9.1rc1, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -23049,7 +23049,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.9.0rc2
cdo config.status 1.9.1rc1
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
......@@ -23567,6 +23567,7 @@ do
"test/Genweights.test") CONFIG_FILES="$CONFIG_FILES test/Genweights.test" ;;
"test/Remap.test") CONFIG_FILES="$CONFIG_FILES test/Remap.test" ;;
"test/Remap2.test") CONFIG_FILES="$CONFIG_FILES test/Remap2.test" ;;
"test/Remapeta.test") CONFIG_FILES="$CONFIG_FILES test/Remapeta.test" ;;
"test/EOF.test") CONFIG_FILES="$CONFIG_FILES test/EOF.test" ;;
"test/Select.test") CONFIG_FILES="$CONFIG_FILES test/Select.test" ;;
"test/Spectral.test") CONFIG_FILES="$CONFIG_FILES test/Spectral.test" ;;
......@@ -25101,6 +25102,7 @@ _LT_EOF
"test/Genweights.test":F) chmod a+x "$ac_file" ;;
"test/Remap.test":F) chmod a+x "$ac_file" ;;
"test/Remap2.test":F) chmod a+x "$ac_file" ;;
"test/Remapeta.test":F) chmod a+x "$ac_file" ;;
"test/EOF.test":F) chmod a+x "$ac_file" ;;
"test/Select.test":F) chmod a+x "$ac_file" ;;
"test/Spectral.test":F) chmod a+x "$ac_file" ;;
......
......@@ -4,7 +4,7 @@
# autoconf 2.68
# libtool 2.4.2
AC_INIT([cdo], [1.9.0rc2], [http://mpimet.mpg.de/cdo])
AC_INIT([cdo], [1.9.1rc1], [http://mpimet.mpg.de/cdo])
AC_DEFINE_UNQUOTED(CDO, ["$PACKAGE_VERSION"], [CDO version])
......@@ -260,7 +260,7 @@ AC_PROG_AWK
AC_CONFIG_FILES([test/File.test test/Read_grib.test test/Read_netcdf.test test/Copy_netcdf.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Comp.test test/Compc.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Cat.test test/Gridarea.test test/Genweights.test test/Remap.test test/Remap2.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Cat.test test/Gridarea.test test/Genweights.test test/Remap.test test/Remap2.test test/Remapeta.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/EOF.test test/Select.test test/Spectral.test test/Vertint.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Timstat.test test/Timselstat.test test/Seasstat.test test/Runstat.test test/Multiyearstat.test test/Ydrunstat.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Gridboxstat.test test/Vertstat.test test/Fldstat.test test/Fldpctl.test test/Ensstat.test test/Enspctl.test],[chmod a+x "$ac_file"])
......
......@@ -5,6 +5,7 @@ Ninfo Information
Showinfo Information
Filedes Information
Copy File operations
Tee File operations
Replace File operations
Duplicate File operations
Mergegrid File operations
......
......@@ -198,7 +198,7 @@ keepaspectratio]{cdo_libdep.pdf}}%
\end{picture}
\begin{flushright}
\large \textbf{Climate Data Operators \\ Version 1.9.0 \\ August 2017}
\large \textbf{Climate Data Operators \\ Version 1.9.1 \\ September 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.9.0 \\ August 2017}}
{\small{Climate Data Operators \\ Version 1.9.1 \\ September 2017}}
\end{flushright}
\vspace*{0mm}
......
......@@ -73,7 +73,7 @@ Is used to choose the algorithm for eigenvalue calculation. Options are 'jacobi'
a one-sided parallel jacobi-algorithm (only executed in parallel if -P flag is set)
and 'danielson_lanczos' for a non-parallel d/l algorithm. The default setting is 'jacobi'.
@Item = CDO_WEIGHT_MODE
It is used to set the weight mode. The default is 'on'. Set it to 'off' for a non weighted version.
It is used to set the weight mode. The default is 'off'. Set it to 'on' for a weighted version.
@Item = MAX_JACOBI_ITER
Is the maximum integer number of annihilation sweeps that is executed if the
jacobi-algorithm is used to compute the eigen values. The default value is 12.
......
......@@ -57,7 +57,7 @@ INTEGER Index of last latitude (1 - nlat)
@BeginExample
To select the region with the longitudes from 30W to 60E and latitudes from 30N to 80S from all input fields use:
To select the region with the longitudes from 30W to 60E and latitudes from 30N to 80N from all input fields use:
@BeginVerbatim
cdo sellonlatbox,-30,60,30,80 infile outfile
@EndVerbatim
......
@BeginModule
@NewPage
@Name = Tee
@Title = Duplicate a data stream
@Section = File operations
@Class = File operation
@Arguments = infile outfile1 outfile2
@Operators = tee
@BeginDescription
@EndDescription
@EndModule
@BeginOperator_tee
@Title = Duplicate a data stream
@BeginDescription
This operator copies the input datasets to @file{outfile1} and @file{outfile2}.
It can be used to store intermediate results to a file.
@EndDescription
@EndOperator
@BeginExample
To compute the daily and monthy average of a dataset use:
@BeginVerbatim
cdo monavg -tee dayavg infile outfile_dayavg outfile_monavg
@EndVerbatim
@EndExample
......@@ -10,7 +10,7 @@
@BeginDescription
This module converts relative divergence and vorticity to U and V wind and vice versa.
Divergence and vorticity are spherical harmonic coefficients in spectral space and
U and V are on a regular Gaussian grid. The Gaussian latitudes need to be ordered from
U and V are on a global regular Gaussian grid. The Gaussian latitudes need to be ordered from
north to south.
@EndDescription
@EndModule
......
......@@ -91,7 +91,7 @@ The following options are available for all operators:
\makebox[1.5in][l]{\hspace*{1cm}}
\> Percentile method: \texttt{nrank nist numpy numpy\_lower numpy\_higher numpy\_nearest} \\
\makebox[1.5in][l]{\hspace*{1cm}\textsl{-\,-reduce\_dim}}
\> Reduce NetCDF dimensions (module: TIMSTAT, FLDSTAT). \\
\> Reduce NetCDF dimensions. \\
\makebox[1.5in][l]{\hspace*{1cm}\textsl{-R, -\,-regular}}
\> Convert GRIB1 data from reduced to regular grid (only with cgribex lib). \\
\makebox[1.5in][l]{\hspace*{1cm}\textsl{-r}}
......@@ -101,7 +101,7 @@ The following options are available for all operators:
\> the number of non missing values for each output period. \\
\makebox[1.5in][l]{\hspace*{1cm}\textsl{-s, -\,-silent}}
\> Silent mode. \\
\makebox[1.5in][l]{\hspace*{1cm}\textsl{-\,-sort}}
\makebox[1.5in][l]{\hspace*{1cm}\textsl{-\,-sortname}}
\> Alphanumeric sorting of NetCDF parameter names. \\
\makebox[1.5in][l]{\hspace*{1cm}\textsl{-t $<$partab$>$}}
\> Set the GRIB1 (cgribex) default parameter table name or file (see chapter 1.6 on page \pageref{PARAMETER_TABLE}).\\
......
libcdi @ 7fec3c22
Subproject commit 1698f3b092d5ee62569665b3d500bca99606d616
Subproject commit 7fec3c225a5090ddaf8239794ea08d5463192eb5
......@@ -93,14 +93,13 @@ void *CDIwrite(void *argument)
int nvars = 10, nlevs = 0, ntimesteps = 30;
const char *defaultgrid = "global_.2";
int tsID, varID, levelID;
int gridsize, i;
int i;
int vlistID;
int zaxisID, taxisID;
int vdate, vtime, julday;
int vdate, vtime;
int filetype = -1, datatype = -1;
int irun, nruns = 1;
unsigned int seed = 1;
const char *gridfile;
char sinfo[64];
off_t nvalues = 0;
double file_size = 0, data_size = 0;
......@@ -117,7 +116,7 @@ void *CDIwrite(void *argument)
if ( operatorArgc() > 5 ) cdoAbort("Too many arguments!");
gridfile = defaultgrid;
const char *gridfile = defaultgrid;
if ( operatorArgc() >= 1 ) nruns = parameter2int(operatorArgv()[0]);
if ( operatorArgc() >= 2 ) gridfile = operatorArgv()[1];
if ( operatorArgc() >= 3 ) nlevs = parameter2int(operatorArgv()[2]);
......@@ -133,16 +132,17 @@ void *CDIwrite(void *argument)
if ( nvars <= 0 ) nvars = 1;
int gridID = cdoDefineGrid(gridfile);
gridsize = gridInqSize(gridID);
int gridsize = gridInqSize(gridID);
if ( nlevs == 1 )
zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
else
{
double levels[nlevs];
double *levels = (double *) Malloc(nlevs*sizeof(double));
for ( i = 0; i < nlevs; ++i ) levels[i] = 100*i;
zaxisID = zaxisCreate(ZAXIS_HEIGHT, nlevs);
zaxisDefLevels(zaxisID, levels);
Free(levels);
}
if ( cdoVerbose )
......@@ -222,7 +222,7 @@ void *CDIwrite(void *argument)
datatype = vlistInqVarDatatype(vlistID, 0);
if ( datatype == CDI_UNDEFID ) datatype = CDI_DATATYPE_FLT32;
julday = date_to_julday(CALENDAR_PROLEPTIC, 19870101);
int julday = date_to_julday(CALENDAR_PROLEPTIC, 19870101);
t0 = timer_val(timer_write);
......
......@@ -1504,6 +1504,7 @@ static char *get_calendar_ptr(int calendar)
switch ( calendar )
{
case CALENDAR_STANDARD:
case CALENDAR_GREGORIAN:
strcpy(calendar_ptr, "gregorian"); break;
case CALENDAR_PROLEPTIC:
strcpy(calendar_ptr, "proleptic_gregorian"); break;
......
......@@ -124,12 +124,8 @@ void *Detrend(void *argument)
int nts = tsID;
memory_t *ompmem = (memory_t*) Malloc(ompNumThreads*sizeof(memory_t));
for ( i = 0; i < ompNumThreads; i++ )
{
ompmem[i].array1 = (double*) Malloc(nts*sizeof(double));
ompmem[i].array2 = (double*) Malloc(nts*sizeof(double));
}
NEW_2D(double, array1, ompNumThreads, nts);
NEW_2D(double, array2, ompNumThreads, nts);
for ( varID = 0; varID < nvars; varID++ )
{
......@@ -140,29 +136,25 @@ void *Detrend(void *argument)
for ( levelID = 0; levelID < nlevel; levelID++ )
{
#if defined(_OPENMP)
#pragma omp parallel for default(none) shared(ompmem, vars, varID, levelID, gridsize, nts, missval)
#pragma omp parallel for default(none) shared(array1, array2, vars, varID, levelID, gridsize, nts, missval)
#endif
for ( i = 0; i < gridsize; i++ )
{
int ompthID = cdo_omp_get_thread_num();
for ( int tsID = 0; tsID < nts; tsID++ )
ompmem[ompthID].array1[tsID] = vars[tsID][varID][levelID].ptr[i];
array1[ompthID][tsID] = vars[tsID][varID][levelID].ptr[i];
detrend(nts, missval, ompmem[ompthID].array1, ompmem[ompthID].array2);
detrend(nts, missval, array1[ompthID], array2[ompthID]);
for ( int tsID = 0; tsID < nts; tsID++ )
vars[tsID][varID][levelID].ptr[i] = ompmem[ompthID].array2[tsID];
vars[tsID][varID][levelID].ptr[i] = array2[ompthID][tsID];
}
}
}
for ( i = 0; i < ompNumThreads; i++ )
{
Free(ompmem[i].array1);
Free(ompmem[i].array2);
}
Free(ompmem);
DELETE_2D(array1);
DELETE_2D(array2);
for ( int tsID = 0; tsID < nts; tsID++ )
{
......
......@@ -43,20 +43,20 @@
// NO MISSING VALUE SUPPORT ADDED SO FAR
static
void scale_eigvec_grid(double *restrict out, int tsID, int npack, const int *restrict pack, const double *restrict weight, double **covar, double sum_w)
void scale_eigvec_grid(double *restrict out, int tsID, size_t npack, const size_t *restrict pack, const double *restrict weight, double **covar, double sum_w)
{
for ( int i = 0; i < npack; ++i )
for ( size_t i = 0; i < npack; ++i )
out[pack[i]] = covar[tsID][i] / sqrt(weight[pack[i]]/sum_w);
}
static
void scale_eigvec_time(double *restrict out, int tsID, int nts, int npack, const int *restrict pack, const double *restrict weight,
void scale_eigvec_time(double *restrict out, int tsID, int nts, size_t npack, const size_t *restrict pack, const double *restrict weight,
double **covar, double **data, double missval, double sum_w)
{
#if defined(_OPENMP)
#pragma omp parallel for default(none) shared(npack, nts, tsID, pack, data, covar, out)
#endif
for ( int i = 0; i < npack; ++i )
for ( size_t i = 0; i < npack; ++i )
{
double sum = 0;
for ( int j = 0; j < nts; ++j )
......@@ -65,9 +65,9 @@ void scale_eigvec_time(double *restrict out, int tsID, int nts, int npack, const
out[pack[i]] = sum;
}
/*
for ( int j = 0; j < nts; ++j )
for ( size_t j = 0; j < nts; ++j )
{
for ( int i = 0; i < npack; ++i )
for ( size_t i = 0; i < npack; ++i )
out[pack[i]] += data[j][i] * covar[tsID][j];
}
*/
......@@ -79,7 +79,7 @@ void scale_eigvec_time(double *restrict out, int tsID, int nts, int npack, const
#pragma omp parallel for default(none) reduction(+:sum) \
shared(out,weight,pack,npack)
#endif
for ( int i = 0; i < npack; ++i )
for ( size_t i = 0; i < npack; ++i )
{
// do not need to account for weights as eigenvectors are non-weighted
sum += weight[pack[i]] * out[pack[i]] * out[pack[i]];
......@@ -91,14 +91,14 @@ void scale_eigvec_time(double *restrict out, int tsID, int nts, int npack, const
#if defined(_OPENMP)
#pragma omp parallel for default(none) shared(npack,pack,sum,out)
#endif
for ( int i = 0; i < npack; ++i ) out[pack[i]] /= sum;
for ( size_t i = 0; i < npack; ++i ) out[pack[i]] /= sum;
}
else
{
#if defined(_OPENMP)
#pragma omp parallel for default(none) shared(npack,pack,out,missval)
#endif
for ( int i = 0; i < npack; ++i ) out[pack[i]] = missval;
for ( size_t i = 0; i < npack; ++i ) out[pack[i]] = missval;
}
}
......@@ -141,7 +141,7 @@ enum T_EIGEN_MODE get_eigenmode(void)
enum T_WEIGHT_MODE get_weightmode(void)
{
enum T_WEIGHT_MODE weight_mode = WEIGHT_ON;
enum T_WEIGHT_MODE weight_mode = WEIGHT_OFF;
char *envstr = getenv("CDO_WEIGHT_MODE");
if ( envstr )
......@@ -171,14 +171,11 @@ void *EOFs(void * argument)
int nmiss;
int varID, levelID;
int nts = 0;
int n = 0;
size_t n = 0;
int grid_space = 0, time_space = 0;
int timer_cov = 0, timer_eig = 0;
int calendar = CALENDAR_STANDARD;
juldate_t juldate;
double missval = 0;
typedef struct {
bool init;
......@@ -217,7 +214,7 @@ void *EOFs(void * argument)
int vlistID1 = pstreamInqVlist(streamID1);
int taxisID1 = vlistInqTaxis(vlistID1);
int gridID1 = vlistInqVarGrid(vlistID1, 0);
int gridsize = vlistGridsizeMax(vlistID1);
size_t gridsize = vlistGridsizeMax(vlistID1);
int nvars = vlistNvars(vlistID1);
int nrecs;
......@@ -226,19 +223,6 @@ void *EOFs(void * argument)
if ( vlistGrid(vlistID1, 0) != vlistGrid(vlistID1, index))
cdoAbort("Too many different grids!");
double *weight = (double *) Malloc(gridsize*sizeof(double));
for ( int i = 0; i < gridsize; ++i ) weight[i] = 1.;
if ( weight_mode == WEIGHT_ON )
{
int wstatus = gridWeights(gridID1, weight);
if ( wstatus != 0 )
{
weight_mode = WEIGHT_OFF;
cdoWarning("Using constant grid cell area weights!");
}
}
/* eigenvalues */
/* COUNT NUMBER OF TIMESTEPS if EOF_ or EOF_TIME */
......@@ -253,17 +237,17 @@ void *EOFs(void * argument)
while ( pstreamInqTimestep(streamID1, nts) ) nts++;
if ( cdoVerbose ) cdoPrint("Counted %i timeSteps", nts);
pstreamClose(streamID1);
streamID1 = pstreamOpenRead(cdoStreamName(0));
vlistID1 = pstreamInqVlist(streamID1);
taxisID1 = vlistInqTaxis(vlistID1);
}
else
if ( cdoVerbose ) cdoPrint("Found %i timeSteps", nts);
pstreamClose(streamID1);
streamID1 = pstreamOpenRead(cdoStreamName(0));
vlistID1 = pstreamInqVlist(streamID1);
taxisID1 = vlistInqTaxis(vlistID1);
if ( nts < gridsize || operfunc == EOF_TIME )
if ( (size_t)nts < gridsize || operfunc == EOF_TIME )