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
33f07080
Commit
33f07080
authored
Aug 02, 2016
by
Uwe Schulzweida
Browse files
gridToCurvilinear: added support for CDI_PROJ_RLL.
parent
e5297f5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/grid.c
View file @
33f07080
...
...
@@ -873,10 +873,19 @@ int gridToCurvilinear(int gridID1, int lbounds)
{
long
index
;
int
gridtype
=
gridInqType
(
gridID1
);
size_t
gridsize
=
(
size_t
)
gridInqSize
(
gridID1
);
int
gridID2
=
gridCreate
(
GRID_CURVILINEAR
,
(
int
)
gridsize
);
int
gridID2
=
gridCreate
(
GRID_CURVILINEAR
,
(
int
)
gridsize
);
bool
lrotated
=
false
;
if
(
gridtype
==
GRID_PROJECTION
&&
gridInqProjType
(
gridID1
)
==
CDI_PROJ_RLL
)
{
gridtype
=
GRID_LONLAT
;
lrotated
=
true
;
}
gridDefPrec
(
gridID2
,
DATATYPE_FLT32
);
switch
(
gridtype
)
{
case
GRID_LONLAT
:
...
...
@@ -957,12 +966,22 @@ int gridToCurvilinear(int gridID1, int lbounds)
else
for
(
int
i
=
0
;
i
<
ny
;
++
i
)
yvals
[
i
]
=
0
;
if
(
gridIsRotated
(
gridID1
)
)
{
double
xpole
=
gridInqXpole
(
gridID1
);
double
ypole
=
gridInqYpole
(
gridID1
);
double
angle
=
gridInqAngle
(
gridID1
);
if
(
gridIsRotated
(
gridID1
)
||
lrotated
)
{
double
xpole
=
0
,
ypole
=
0
,
angle
=
0
;
if
(
lrotated
)
{
gridInqProjParamRLL
(
gridID1
,
&
xpole
,
&
ypole
,
&
angle
);
gridDefProj
(
gridID2
,
gridID1
);
}
else
{
xpole
=
gridInqXpole
(
gridID1
);
ypole
=
gridInqYpole
(
gridID1
);
angle
=
gridInqAngle
(
gridID1
);
}
for
(
int
j
=
0
;
j
<
ny
;
j
++
)
for
(
int
i
=
0
;
i
<
nx
;
i
++
)
{
...
...
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