Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
e0c8a360
Commit
e0c8a360
authored
May 19, 2016
by
Uwe Schulzweida
Browse files
Added option --timestat_date
parent
be6c5091
Changes
5
Hide whitespace changes
Inline
Side-by-side
doc/tex/appendix.tex
View file @
e0c8a360
...
...
@@ -90,8 +90,8 @@ CDO\_RESET\_HISTORY & 0 & Set to 1 to reset the NetCDF {\it histo
CDO
\_
REMAP
\_
NORM
&
fracarea
&
Choose the normalization for the conservative interpolation
\\
\hline
CDO
\_
GRIDSEARCH
\_
RADIUS
&
180
&
Grid search radius in degree. Used by the operators
\\
&
&
setmisstonn, remapdis and remapnn.
\\
\hline
CDO
\_
TIMESTAT
\_
DATE
&
None
&
Set t
he date information
of a time statistic operator to
\\
&
&
the "first
", "mid
dle
" or "last" contributing timestep.
\\
\hline
CDO
\_
TIMESTAT
\_
DATE
&
None
&
Set t
arget timestamp
of a time statistic operator to
the "first",
\\
&
&
"middle
", "mid
high
" or "last" contributing
source
timestep.
\\
\hline
CDO
\_
USE
\_
FFTW
&
1
&
Set to 0 to switch off usage of FFTW. Used in the Filter module.
\\
\hline
CDO
\_
VERSION
\_
INFO
&
1
&
Set to 0 to disable NetCDF global attribute CDO
\\
\hline
\end{tabular}
...
...
doc/tex/usage.tex
View file @
e0c8a360
...
...
@@ -104,6 +104,10 @@ The following options are available for all operators:
\makebox
[1.5in][l]
{
\hspace*
{
1cm
}
\sl
-t
$
<
$
partab
$
>
$}
\>
Set the GRIB1 (cgribex) default parameter table name or file (see chapter 1.6 on page
\pageref
{
PARAMETER
_
TABLE
}
).
\\
\>
Predefined tables are:
{
\tt
echam4 echam5 echam6 mpiom1 ecmwf remo
}
\\
\makebox
[1.5in][l]
{
\hspace*
{
1cm
}
\sl
-
\,
-timestat
\_
date
$
<
$
srcdate
$
>
$}
\>
\\
\makebox
[1.5in][l]
{
\hspace*
{
1cm
}}
\>
Target timestamp (time statistics):
{
\tt
first, middle, midhigh
}
or
{
\tt
last
}
source timestep.
\\
\makebox
[1.5in][l]
{
\hspace*
{
1cm
}
\sl
-V, -
\,
-version
}
\>
Print the version number.
\\
\makebox
[1.5in][l]
{
\hspace*
{
1cm
}
\sl
-v, -
\,
-verbose
}
...
...
src/cdo.c
View file @
e0c8a360
...
...
@@ -252,6 +252,8 @@ void cdo_usage(void)
fprintf
(
stderr
,
" %s"
,
name
);
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
" --timestat_date <srcdate>
\n
"
);
fprintf
(
stderr
,
" Target timestamp (time statistics): first, middle, midhigh or last source timestep.
\n
"
);
fprintf
(
stderr
,
" -V, --version Print the version number
\n
"
);
fprintf
(
stderr
,
" -v, --verbose Print extra details for some operators
\n
"
);
fprintf
(
stderr
,
" -W Print extra warning messages
\n
"
);
...
...
@@ -706,8 +708,6 @@ void defineVarnames(const char *arg)
static
void
get_env_vars
(
void
)
{
char
*
envstr
;
username
=
getenv
(
"LOGNAME"
);
if
(
username
==
NULL
)
{
...
...
@@ -715,7 +715,7 @@ void get_env_vars(void)
if
(
username
==
NULL
)
username
=
"unknown"
;
}
envstr
=
getenv
(
"CDO_GRID_SEARCH_DIR"
);
char
*
envstr
=
getenv
(
"CDO_GRID_SEARCH_DIR"
);
if
(
envstr
)
{
size_t
len
=
strlen
(
envstr
);
...
...
@@ -987,15 +987,13 @@ void check_stacksize()
#if defined(HAVE_GETRLIMIT)
#if defined(RLIMIT_STACK)
{
#define MIN_STACK_SIZE 67108864L
/* 64MB */
int
status
;
struct
rlimit
rlim
;
RLIM_T
min_stack_size
=
MIN_STACK_SIZE
;
status
=
getrlimit
(
RLIMIT_STACK
,
&
rlim
);
int
status
=
getrlimit
(
RLIMIT_STACK
,
&
rlim
);
if
(
status
==
0
)
{
#define MIN_STACK_SIZE 67108864L
/* 64MB */
RLIM_T
min_stack_size
=
MIN_STACK_SIZE
;
if
(
min_stack_size
>
rlim
.
rlim_max
)
min_stack_size
=
rlim
.
rlim_max
;
if
(
rlim
.
rlim_cur
<
min_stack_size
)
{
...
...
@@ -1038,14 +1036,12 @@ static
long
str_to_int
(
const
char
*
intstring
)
{
long
intval
=
-
1
;
long
fact
=
1
;
if
(
intstring
)
{
int
loop
,
len
;
len
=
(
int
)
strlen
(
intstring
);
for
(
loop
=
0
;
loop
<
len
;
loop
++
)
long
fact
=
1
;
int
len
=
(
int
)
strlen
(
intstring
);
for
(
int
loop
=
0
;
loop
<
len
;
loop
++
)
{
if
(
!
isdigit
((
int
)
intstring
[
loop
])
)
{
...
...
@@ -1078,6 +1074,7 @@ int parse_options_long(int argc, char *argv[])
int
lpercentile
;
int
lprintoperators
=
0
;
int
lenableexcept
;
int
ltimestat_date
;
struct
cdo_option
opt_long
[]
=
{
...
...
@@ -1090,6 +1087,7 @@ int parse_options_long(int argc, char *argv[])
{
"gridsearchradius"
,
required_argument
,
&
lgridsearchradius
,
1
},
{
"remap_genweights"
,
required_argument
,
&
lremap_genweights
,
1
},
{
"enableexcept"
,
required_argument
,
&
lenableexcept
,
1
},
{
"timestat_date"
,
required_argument
,
&
ltimestat_date
,
1
},
{
"cmor"
,
no_argument
,
&
CDO_CMOR_Mode
,
1
},
{
"reduce_dim"
,
no_argument
,
&
CDO_Reduce_Dim
,
1
},
{
"float"
,
no_argument
,
&
CDO_Memtype
,
MEMTYPE_FLOAT
},
...
...
@@ -1119,6 +1117,7 @@ int parse_options_long(int argc, char *argv[])
lgridsearchradius
=
0
;
lremap_genweights
=
0
;
lenableexcept
=
0
;
ltimestat_date
=
0
;
c
=
cdo_getopt_long
(
argc
,
argv
,
"f:b:e:P:g:i:k:l:m:n:t:D:z:aBCcdhLMOpQRrsSTuVvWXZ"
,
opt_long
,
NULL
);
if
(
c
==
-
1
)
break
;
...
...
@@ -1158,6 +1157,17 @@ int parse_options_long(int argc, char *argv[])
cdo_feenableexcept
((
unsigned
)
except
);
if
(
signal
(
SIGFPE
,
cdo_sig_handler
)
==
SIG_ERR
)
cdoWarning
(
"can't catch SIGFPE!"
);
}
else
if
(
ltimestat_date
)
{
int
timestatdate
=
-
1
;
if
(
strcmp
(
CDO_optarg
,
"first"
)
==
0
)
timestatdate
=
TIMESTAT_FIRST
;
else
if
(
strcmp
(
CDO_optarg
,
"last"
)
==
0
)
timestatdate
=
TIMESTAT_LAST
;
else
if
(
strcmp
(
CDO_optarg
,
"middle"
)
==
0
)
timestatdate
=
TIMESTAT_MEAN
;
else
if
(
strcmp
(
CDO_optarg
,
"midhigh"
)
==
0
)
timestatdate
=
TIMESTAT_MIDHIGH
;
if
(
timestatdate
<
0
)
cdoAbort
(
"option --%s: unsupported argument: %s"
,
"timestat_date"
,
CDO_optarg
);
extern
int
CDO_Timestat_Date
;
CDO_Timestat_Date
=
timestatdate
;
}
else
if
(
luse_fftw
)
{
int
intarg
=
parameter2int
(
CDO_optarg
);
...
...
src/datetime.c
View file @
e0c8a360
...
...
@@ -2,7 +2,7 @@
#include
"cdo_int.h"
#include
"datetime.h"
static
int
t
imestat_
d
ate
=
-
1
;
int
CDO_T
imestat_
D
ate
=
-
1
;
static
void
get_timestat_date
(
int
*
tstat_date
)
...
...
@@ -42,10 +42,10 @@ void dtlist_init(dtlist_type *dtlist)
dtlist
->
stat
=
TIMESTAT_LAST
;
dtlist
->
dtinfo
=
NULL
;
if
(
t
imestat_
d
ate
==
-
1
)
if
(
CDO_T
imestat_
D
ate
==
-
1
)
{
t
imestat_
d
ate
=
0
;
get_timestat_date
(
&
t
imestat_
d
ate
);
CDO_T
imestat_
D
ate
=
0
;
get_timestat_date
(
&
CDO_T
imestat_
D
ate
);
}
}
...
...
@@ -224,7 +224,7 @@ void dtlist_stat_taxisDefTimestep(dtlist_type *dtlist, int taxisID, int nsteps)
cdoAbort
(
"Internal error; unexpected nsteps=%d (limit=%ld)!"
,
nsteps
,
dtlist
->
size
);
int
stat
=
dtlist
->
stat
;
if
(
t
imestat_
d
ate
>
0
)
stat
=
t
imestat_
d
ate
;
if
(
CDO_T
imestat_
D
ate
>
0
)
stat
=
CDO_T
imestat_
D
ate
;
if
(
stat
==
TIMESTAT_MEAN
)
dtlist_mean
(
dtlist
,
nsteps
);
else
if
(
stat
==
TIMESTAT_MIDHIGH
)
dtlist_midhigh
(
dtlist
,
nsteps
);
...
...
src/operator_help.h
View file @
e0c8a360
...
...
@@ -4090,7 +4090,7 @@ static const char *WindHelp[] = {
"DESCRIPTION"
,
" 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
s
to be ordered from"
,
" U and V are on a regular Gaussian grid. The Gaussian latitudes need to be ordered from"
,
" north to south."
,
""
,
"OPERATORS"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment