Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mpim-sw
cdo
Commits
3f760564
Commit
3f760564
authored
Jan 07, 2021
by
Uwe Schulzweida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proj_inv_xyvals: check result for NaNs.
parent
fcc7af99
Pipeline
#5661
passed with stages
in 14 minutes and 43 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
NEWS
NEWS
+2
-0
src/mpim_grid/grid_proj.cc
src/mpim_grid/grid_proj.cc
+7
-0
No files found.
NEWS
View file @
3f760564
...
...
@@ -5,6 +5,8 @@ Improvement
Version 1.9.10 (29 January 2021):
New features:
* Added option --ignore_time_bounds to ignore time bounds for time range statistics
Fixed bugs:
* timselmean: failed with variables on different grids [Bug #9978]
* Ymonarith: failed with variables on different grids
...
...
src/mpim_grid/grid_proj.cc
View file @
3f760564
...
...
@@ -73,29 +73,36 @@ gen_param(const char *fmt, ...)
static
void
proj_fwd_xyvals
(
PJ
*
proj
,
size_t
nvals
,
double
*
xvals
,
double
*
yvals
)
{
size_t
num_nans
=
0
;
PJ_COORD
p
;
for
(
size_t
i
=
0
;
i
<
nvals
;
i
++
)
{
p
.
uv
.
u
=
proj_torad
(
xvals
[
i
]);
p
.
uv
.
v
=
proj_torad
(
yvals
[
i
]);
p
=
proj_trans
(
proj
,
PJ_FWD
,
p
);
if
(
std
::
isnan
(
p
.
uv
.
u
)
||
std
::
isnan
(
p
.
uv
.
v
))
num_nans
++
;
xvals
[
i
]
=
p
.
uv
.
u
;
yvals
[
i
]
=
p
.
uv
.
v
;
}
if
(
num_nans
)
cdoWarning
(
"%s: %zu of %zu projection coodinates are NaN!"
,
__func__
,
num_nans
,
2
*
nvals
);
}
static
void
proj_inv_xyvals
(
PJ
*
proj
,
size_t
nvals
,
double
*
xvals
,
double
*
yvals
)
{
size_t
num_nans
=
0
;
PJ_COORD
p
;
for
(
size_t
i
=
0
;
i
<
nvals
;
i
++
)
{
p
.
uv
.
u
=
xvals
[
i
];
p
.
uv
.
v
=
yvals
[
i
];
p
=
proj_trans
(
proj
,
PJ_INV
,
p
);
if
(
std
::
isnan
(
p
.
uv
.
u
)
||
std
::
isnan
(
p
.
uv
.
v
))
num_nans
++
;
xvals
[
i
]
=
proj_todeg
(
p
.
uv
.
u
);
yvals
[
i
]
=
proj_todeg
(
p
.
uv
.
v
);
}
if
(
num_nans
)
cdoWarning
(
"%s: %zu of %zu projection coodinates are NaN!"
,
__func__
,
num_nans
,
2
*
nvals
);
}
static
int
...
...
Write
Preview
Markdown
is supported
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