Skip to content
GitLab
Menu
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
05875028
Commit
05875028
authored
Oct 14, 2019
by
Uwe Schulzweida
Browse files
Timstat: added support for cell_methods.
parent
00794ecb
Changes
5
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
05875028
...
...
@@ -3,6 +3,10 @@
* Using CDI library version 1.9.8
* Version 1.9.8 release
2019-10-14 Uwe Schulzweida
* Timstat: added support for cell_methods
2019-10-07 Uwe Schulzweida
* Expr: added function rand(x)
...
...
src/Timstat.cc
View file @
05875028
...
...
@@ -73,6 +73,7 @@
#include
<cdi.h>
#include
"cdo_options.h"
#include
"cdo_vlist.h"
#include
"functs.h"
#include
"process_int.h"
#include
"datetime.h"
...
...
@@ -212,6 +213,8 @@ Timstat(void *argument)
const
auto
vlistID1
=
cdoStreamInqVlist
(
streamID1
);
const
auto
vlistID2
=
vlistDuplicate
(
vlistID1
);
vlistDefineTimestepType
(
vlistID2
,
operfunc
);
if
(
cmplen
==
0
)
vlistDefNtsteps
(
vlistID2
,
1
);
const
auto
taxisID1
=
vlistInqTaxis
(
vlistID1
);
...
...
src/XTimstat.cc
View file @
05875028
...
...
@@ -68,6 +68,7 @@
#include
<cdi.h>
#include
"cdo_options.h"
#include
"cdo_vlist.h"
#include
"functs.h"
#include
"process_int.h"
#include
"cdo_task.h"
...
...
@@ -259,6 +260,7 @@ XTimstat(void *process)
#endif
const
auto
vlistID2
=
vlistDuplicate
(
vlistID1
);
vlistDefineTimestepType
(
vlistID2
,
operfunc
);
if
(
cmplen
==
0
)
vlistDefNtsteps
(
vlistID2
,
1
);
...
...
src/cdo_vlist.cc
View file @
05875028
...
...
@@ -28,6 +28,27 @@
#include
"array.h"
void
vlistDefineTimestepType
(
int
vlistID
,
int
operfunc
)
{
int
stepType
=
-
1
;
// clang-format off
if
(
operfunc
==
func_mean
)
stepType
=
TSTEP_AVG
;
else
if
(
operfunc
==
func_avg
)
stepType
=
TSTEP_AVG
;
else
if
(
operfunc
==
func_sum
)
stepType
=
TSTEP_SUM
;
else
if
(
operfunc
==
func_range
)
stepType
=
TSTEP_RANGE
;
else
if
(
operfunc
==
func_min
)
stepType
=
TSTEP_MIN
;
else
if
(
operfunc
==
func_max
)
stepType
=
TSTEP_MAX
;
// clang-format on
if
(
stepType
!=
-
1
)
{
auto
nvars
=
vlistNvars
(
vlistID
);
for
(
int
varID
=
0
;
varID
<
nvars
;
++
varID
)
vlistDefVarTsteptype
(
vlistID
,
varID
,
stepType
);
}
}
double
cdoZaxisInqLevel
(
int
zaxisID
,
int
levelID
)
{
...
...
src/cdo_vlist.h
View file @
05875028
...
...
@@ -20,6 +20,8 @@
#include
<vector>
#include
<map>
void
vlistDefineTimestepType
(
int
vlistID
,
int
operfunc
);
void
vlistMap
(
int
vlistID1
,
int
vlistID2
,
int
flag
,
int
mapflag
,
std
::
map
<
int
,
int
>
&
mapOfVarIDs
);
void
vlistCompare
(
int
vlistID1
,
int
vlistID2
,
int
flag
);
int
vlistCompareX
(
int
vlistID1
,
int
vlistID2
,
int
flag
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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