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
f3414919
Commit
f3414919
authored
2 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
percMethod: changed type to string.
parent
8527e8ff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#25629
passed
2 years ago
Stage: build
Stage: check
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Ydrunpctl.cc
+7
-13
7 additions, 13 deletions
src/Ydrunpctl.cc
with
7 additions
and
13 deletions
src/Ydrunpctl.cc
+
7
−
13
View file @
f3414919
...
...
@@ -43,7 +43,7 @@ Ydrunpctl(void *process)
const
auto
pn
=
parameter_to_double
(
cdo_operator_argv
(
0
));
const
auto
ndates
=
parameter_to_int
(
cdo_operator_argv
(
1
));
char
*
percMethod
=
nullptr
,
*
readMethod
=
nullptr
;
std
::
string
percMethod
,
readMethod
;
if
(
cdo_operator_argc
()
>
2
)
{
auto
params
=
cdo_get_oper_argv
();
...
...
@@ -51,16 +51,12 @@ Ydrunpctl(void *process)
KVList
kvlist
;
if
(
kvlist
.
parse_arguments
(
cdo_operator_argc
()
-
2
,
params
)
!=
0
)
cdo_abort
(
"Argument parse error!"
);
auto
kv
=
kvlist
.
search
(
"pm"
);
if
(
kv
&&
kv
->
nvalues
>
0
)
percMethod
=
strdup
(
kv
->
values
[
0
]
.
c_str
()
);
if
(
kv
&&
kv
->
nvalues
>
0
)
percMethod
=
parameter_to_word
(
kv
->
values
[
0
]);
kv
=
kvlist
.
search
(
"rm"
);
if
(
kv
&&
kv
->
nvalues
>
0
)
readMethod
=
strdup
(
kv
->
values
[
0
]
.
c_str
()
);
if
(
kv
&&
kv
->
nvalues
>
0
)
readMethod
=
parameter_to_word
(
kv
->
values
[
0
]);
}
if
(
percMethod
)
{
if
(
strcmp
(
percMethod
,
"r8"
)
==
0
)
percentile_set_method
(
"rtype8"
);
free
(
percMethod
);
}
if
(
percMethod
==
"r8"
)
percentile_set_method
(
"rtype8"
);
const
auto
streamID1
=
cdo_open_read
(
0
);
const
auto
streamID2
=
cdo_open_read
(
1
);
...
...
@@ -235,7 +231,7 @@ Ydrunpctl(void *process)
tsID
++
;
}
if
(
readMethod
&&
readMethod
[
0
]
==
'c'
&&
cdo_assert_files_only
())
if
(
readMethod
==
"c"
&&
cdo_assert_files_only
())
{
const
auto
endYear
=
cdiDateTimes
[
ndates
-
1
].
date
.
year
;
const
auto
cdiStream
=
streamOpenRead
(
cdo_get_stream_name
(
0
));
...
...
@@ -289,15 +285,13 @@ Ydrunpctl(void *process)
}
}
if
(
missTimes
!=
ndates
-
1
)
cdo_abort
(
"Addding the missing values when using the 'readMethod
ar
' method was not possible"
);
if
(
missTimes
!=
ndates
-
1
)
cdo_abort
(
"Addding the missing values when using the 'readMethod' method was not possible"
);
streamClose
(
cdiStream
);
}
else
if
(
readMethod
&&
readMethod
[
0
]
==
'c'
)
else
if
(
readMethod
==
"c"
)
cdo_warning
(
"Operators cannot be piped in circular mode"
);
if
(
readMethod
)
free
(
readMethod
);
/*
int outyear = 1e9;
for (dayOfYear = 0; dayOfYear < MaxDays; dayOfYear++)
...
...
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