Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdo
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
cdo
Commits
64243c85
Commit
64243c85
authored
7 months ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Added string_contains()
parent
fe708a94
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/Detrend.cc
+2
-2
2 additions, 2 deletions
src/Detrend.cc
src/Fldstat.cc
+3
-2
3 additions, 2 deletions
src/Fldstat.cc
src/Trend.cc
+2
-2
2 additions, 2 deletions
src/Trend.cc
src/Trendarith.cc
+2
-2
2 additions, 2 deletions
src/Trendarith.cc
src/util_string.h
+6
-0
6 additions, 0 deletions
src/util_string.h
with
15 additions
and
8 deletions
src/Detrend.cc
+
2
−
2
View file @
64243c85
...
...
@@ -27,7 +27,7 @@
#include
"arithmetic.h"
static
void
detrendGetP
arameter
(
bool
&
tstepIsEqual
)
get_p
arameter
(
bool
&
tstepIsEqual
)
{
auto
pargc
=
cdo_operator_argc
();
if
(
pargc
)
...
...
@@ -88,7 +88,7 @@ public:
void
init
()
override
{
detrendGetP
arameter
(
tstepIsEqual
);
get_p
arameter
(
tstepIsEqual
);
streamID1
=
cdo_open_read
(
0
);
...
...
This diff is collapsed.
Click to expand it.
src/Fldstat.cc
+
3
−
2
View file @
64243c85
...
...
@@ -155,7 +155,7 @@ printWeightsWarning(int ngrids, const std::string &varname)
}
static
void
fldstatGetP
arameter
(
bool
&
useWeights
)
get_p
arameter
(
bool
&
useWeights
)
{
auto
pargc
=
cdo_operator_argc
();
if
(
pargc
)
...
...
@@ -280,10 +280,11 @@ public:
if
(
operfunc
==
FieldFunc_Pctl
)
{
operator_check_argc
(
1
);
operator_input_arg
(
"percentile number"
);
pn
=
parameter_to_double
(
cdo_operator_argv
(
0
));
}
else
if
(
needWeights
)
{
fldstatGetP
arameter
(
useWeights
);
}
else
if
(
needWeights
)
{
get_p
arameter
(
useWeights
);
}
else
{
operator_check_argc
(
0
);
}
streamID1
=
cdo_open_read
(
0
);
...
...
This diff is collapsed.
Click to expand it.
src/Trend.cc
+
2
−
2
View file @
64243c85
...
...
@@ -28,7 +28,7 @@
#include
"arithmetic.h"
static
void
trendGetP
arameter
(
bool
&
tstepIsEqual
)
get_p
arameter
(
bool
&
tstepIsEqual
)
{
auto
pargc
=
cdo_operator_argc
();
if
(
pargc
)
...
...
@@ -90,7 +90,7 @@ public:
void
init
()
override
{
trendGetP
arameter
(
tstepIsEqual
);
get_p
arameter
(
tstepIsEqual
);
streamID1
=
cdo_open_read
(
0
);
...
...
This diff is collapsed.
Click to expand it.
src/Trendarith.cc
+
2
−
2
View file @
64243c85
...
...
@@ -68,7 +68,7 @@ sub_trend(double zj, Field &field1, const Field &field2, const Field &field3)
}
static
void
trendarithGetP
arameter
(
bool
&
tstepIsEqual
)
get_p
arameter
(
bool
&
tstepIsEqual
)
{
auto
pargc
=
cdo_operator_argc
();
if
(
pargc
)
...
...
@@ -135,7 +135,7 @@ public:
operfunc
=
cdo_operator_f1
(
operatorID
);
tstepIsEqual
=
true
;
trendarithGetP
arameter
(
tstepIsEqual
);
get_p
arameter
(
tstepIsEqual
);
streamID1
=
cdo_open_read
(
0
);
streamID2
=
cdo_open_read
(
1
);
...
...
This diff is collapsed.
Click to expand it.
src/util_string.h
+
6
−
0
View file @
64243c85
...
...
@@ -55,6 +55,12 @@ string_format(const std::string &format, Args... args)
return
std
::
string
(
buf
.
get
(),
static_cast
<
char
*>
(
buf
.
get
())
+
size
-
1
);
// We don't want the '\0' inside
}
inline
bool
string_contains
(
const
std
::
string
&
s
,
unsigned
char
ch
)
{
return
(
s
.
find
(
ch
)
!=
std
::
string
::
npos
);
}
namespace
Util
{
namespace
String
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment