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
49ad33da
Commit
49ad33da
authored
Jun 26, 2017
by
Uwe Schulzweida
Browse files
remap_define_reg2d: bug fix for non monotonic increasing longitudes.
parent
534e23ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/remaplib.cc
View file @
49ad33da
...
@@ -567,8 +567,13 @@ void remap_define_reg2d(int gridID, remapgrid_t *grid)
...
@@ -567,8 +567,13 @@ void remap_define_reg2d(int gridID, remapgrid_t *grid)
char
yunits
[
CDI_MAX_NAME
];
yunits
[
0
]
=
0
;
char
yunits
[
CDI_MAX_NAME
];
yunits
[
0
]
=
0
;
cdiGridInqKeyStr
(
gridID
,
CDI_KEY_YUNITS
,
CDI_MAX_NAME
,
yunits
);
cdiGridInqKeyStr
(
gridID
,
CDI_KEY_YUNITS
,
CDI_MAX_NAME
,
yunits
);
grid_to_radian
(
yunits
,
nx
,
grid
->
reg2d_center_lon
,
"grid reg2d center lon"
);
grid_to_radian
(
yunits
,
nx
,
grid
->
reg2d_center_lon
,
"grid reg2d center lon"
);
grid_to_radian
(
yunits
,
ny
,
grid
->
reg2d_center_lat
,
"grid reg2d center lat"
);
grid_to_radian
(
yunits
,
ny
,
grid
->
reg2d_center_lat
,
"grid reg2d center lat"
);
if
(
grid
->
reg2d_center_lon
[
nx
-
1
]
<
grid
->
reg2d_center_lon
[
0
]
)
for
(
long
i
=
1
;
i
<
nx
;
++
i
)
if
(
grid
->
reg2d_center_lon
[
i
]
<
grid
->
reg2d_center_lon
[
i
-
1
]
)
grid
->
reg2d_center_lon
[
i
]
+=
PI2
;
if
(
grid
->
is_cyclic
)
grid
->
reg2d_center_lon
[
nx
]
=
grid
->
reg2d_center_lon
[
0
]
+
PI2
;
if
(
grid
->
is_cyclic
)
grid
->
reg2d_center_lon
[
nx
]
=
grid
->
reg2d_center_lon
[
0
]
+
PI2
;
...
...
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