Commit 0f86735c authored by Uwe Schulzweida's avatar Uwe Schulzweida

Merge branch 'develop'

parents 694b914f 6b45528b
2017-08-15 Uwe Schulzweida
2017-07-27 Uwe Schulzweida
* Using CDI library version 1.9.0
* Version 1.9.0 release
......
CDO NEWS
--------
Version 1.9.0 (15 September 2017):
Version 1.9.0 (27 August 2017):
New features:
* Code changed from ANSI C99 to ISO C++11
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for cdo 1.9.0rc3.
# Generated by GNU Autoconf 2.68 for cdo 1.9.0.
#
# 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.0rc3'
PACKAGE_STRING='cdo 1.9.0rc3'
PACKAGE_VERSION='1.9.0'
PACKAGE_STRING='cdo 1.9.0'
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.0rc3 to adapt to many kinds of systems.
\`configure' configures cdo 1.9.0 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.0rc3:";;
short | recursive ) echo "Configuration of cdo 1.9.0:";;
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.0rc3
cdo configure 1.9.0
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.0rc3, which was
It was created by cdo $as_me 1.9.0, 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.0rc3'
VERSION='1.9.0'
cat >>confdefs.h <<_ACEOF
......@@ -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.0rc3, which was
This file was extended by cdo $as_me 1.9.0, 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.0rc3
cdo config.status 1.9.0
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.9.0rc3], [http://mpimet.mpg.de/cdo])
AC_INIT([cdo], [1.9.0], [http://mpimet.mpg.de/cdo])
AC_DEFINE_UNQUOTED(CDO, ["$PACKAGE_VERSION"], [CDO version])
......
libcdi @ b6dd1e74
Subproject commit 2b8896fbcd2208d5ab773f79b1815dc88dcc918e
Subproject commit b6dd1e7488d2fe2c3d51f2858b73b848611d561b
......@@ -26,18 +26,18 @@
#include "cdo_int.h"
#include "pstream.h"
/* correlation in time */
// correlation in time
static
int correlation_t(long gridsize, double missval1, double missval2, int *nofvals,
double *work0, double *work1, double *work2, double *work3, double *work4)
size_t correlation_t(size_t gridsize, double missval1, double missval2, size_t *nofvals,
double *work0, double *work1, double *work2, double *work3, double *work4)
{
int nvals, nmiss = 0;
size_t nmiss = 0;
double temp0, temp1, temp2, temp3, temp4, temp5, temp6;
double cor;
for ( long i = 0; i < gridsize; i++ )
for ( size_t i = 0; i < gridsize; ++i )
{
nvals = nofvals[i];
size_t nvals = nofvals[i];
if ( nvals > 0 )
{
......@@ -68,24 +68,22 @@ int correlation_t(long gridsize, double missval1, double missval2, int *nofvals,
return nmiss;
}
/* covariance in time */
// covariance in time
static
int covariance_t(long gridsize, double missval1, double missval2, int *nofvals,
double *work0, double *work1, double *work2)
size_t covariance_t(size_t gridsize, double missval1, double missval2, size_t *nofvals,
double *work0, double *work1, double *work2)
{
int nvals, nmiss = 0;
double temp;
double dnvals;
size_t nmiss = 0;
double covar;
for ( long i = 0; i < gridsize; i++ )
for ( size_t i = 0; i < gridsize; ++i )
{
nvals = nofvals[i];
dnvals = nvals;
size_t nvals = nofvals[i];
if ( nvals > 0 )
{
temp = DIVMN( MULMN(work0[i], work1[i]), dnvals*dnvals);
double dnvals = nvals;
double temp = DIVMN( MULMN(work0[i], work1[i]), dnvals*dnvals);
covar = SUBMN( DIVMN(work2[i], dnvals), temp);
if ( DBL_IS_EQUAL(covar, missval1) ) nmiss++;
......@@ -105,13 +103,10 @@ int covariance_t(long gridsize, double missval1, double missval2, int *nofvals,
void *Timstat2(void *argument)
{
int nwork = 0;
int vdate = 0, vtime = 0;
int nrecs2, nlevs;
long i, gridsize;
int varID, levelID, gridID;
int varID, levelID;
int nmiss;
double missval1, missval2;
cdoInitialize(argument);
......@@ -123,6 +118,7 @@ void *Timstat2(void *argument)
int operatorID = cdoOperatorID();
int operfunc = cdoOperatorF1(operatorID);
int nwork = 0;
if ( operfunc == func_cor ) nwork = 5;
else if ( operfunc == func_covar ) nwork = 3;
......@@ -149,30 +145,30 @@ void *Timstat2(void *argument)
int streamID3 = pstreamOpenWrite(cdoStreamName(2), cdoFiletype());
pstreamDefVlist(streamID3, vlistID3);
gridsize = vlistGridsizeMax(vlistID1);
size_t gridsize = vlistGridsizeMax(vlistID1);
double *array1 = (double*) Malloc(gridsize*sizeof(double));
double *array2 = (double*) Malloc(gridsize*sizeof(double));
double ****work = (double ****) Malloc(nvars*sizeof(double ***));
int ***nofvals = (int ***) Malloc(nvars*sizeof(int **));
size_t ***nofvals = (size_t ***) Malloc(nvars*sizeof(size_t **));
for ( varID = 0; varID < nvars; varID++ )
{
gridID = vlistInqVarGrid(vlistID1, 0);
int gridID = vlistInqVarGrid(vlistID1, 0);
gridsize = gridInqSize(gridID);
nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
work[varID] = (double ***) Malloc(nlevs*sizeof(double **));
nofvals[varID] = (int **) Malloc(nlevs*sizeof(int *));
nofvals[varID] = (size_t **) Malloc(nlevs*sizeof(size_t *));
for ( levelID = 0; levelID < nlevs; levelID++ )
{
nofvals[varID][levelID] = (int*) Malloc(gridsize*sizeof(int));
memset(nofvals[varID][levelID], 0, gridsize*sizeof(int));
nofvals[varID][levelID] = (size_t*) Malloc(gridsize*sizeof(size_t));
memset(nofvals[varID][levelID], 0, gridsize*sizeof(size_t));
work[varID][levelID] = (double **) Malloc(nwork*sizeof(double *));
for ( i = 0; i < nwork; i++ )
for ( int i = 0; i < nwork; i++ )
{
work[varID][levelID][i] = (double*) Malloc(gridsize*sizeof(double));
memset(work[varID][levelID][i], 0, gridsize*sizeof(double));
......@@ -203,15 +199,15 @@ void *Timstat2(void *argument)
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
missval1 = vlistInqVarMissval(vlistID1, varID);
missval2 = vlistInqVarMissval(vlistID2, varID);
double missval1 = vlistInqVarMissval(vlistID1, varID);
double missval2 = vlistInqVarMissval(vlistID2, varID);
pstreamReadRecord(streamID1, array1, &nmiss);
pstreamReadRecord(streamID2, array2, &nmiss);
if ( operfunc == func_cor )
{
for ( i = 0; i < gridsize; i++)
for ( size_t i = 0; i < gridsize; ++i )
{
if ( ( ! DBL_IS_EQUAL(array1[i], missval1) ) &&
( ! DBL_IS_EQUAL(array2[i], missval2) ) )
......@@ -227,7 +223,7 @@ void *Timstat2(void *argument)
}
else if ( operfunc == func_covar )
{
for ( i = 0; i < gridsize; i++)
for ( size_t i = 0; i < gridsize; ++i )
{
if ( ( ! DBL_IS_EQUAL(array1[i], missval1) ) &&
( ! DBL_IS_EQUAL(array2[i], missval2) ) )
......@@ -256,8 +252,8 @@ void *Timstat2(void *argument)
gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
missval1 = vlistInqVarMissval(vlistID1, varID);
missval2 = vlistInqVarMissval(vlistID2, varID);
double missval1 = vlistInqVarMissval(vlistID1, varID);
double missval2 = vlistInqVarMissval(vlistID2, varID);
if ( operfunc == func_cor )
{
......@@ -283,7 +279,7 @@ void *Timstat2(void *argument)
for ( levelID = 0; levelID < nlevs; levelID++ )
{
Free(nofvals[varID][levelID]);
for ( i = 0; i < nwork; i++ )
for ( int i = 0; i < nwork; i++ )
Free(work[varID][levelID][i]);
Free(work[varID][levelID]);
}
......
......@@ -1055,7 +1055,7 @@ std::vector<std::string> SettimeHelp = {
"",
"DESCRIPTION",
" This module sets the time axis or part of the time axis. Which part of the",
" time axis is overwritten depends on the chosen operator.",
" time axis is overwritten/created depends on the chosen operator.",
"",
"OPERATORS",
" setdate Set date",
......
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