Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
300491d3
Commit
300491d3
authored
Apr 11, 2017
by
Uwe Schulzweida
Browse files
Call CDO function proj_lcc_to_lonlat() if available.
parent
bb4f4ecf
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/grid.c
View file @
300491d3
...
...
@@ -22,6 +22,7 @@
double
grid_missval
=
-
9999
.;
int
(
*
proj_lonlat_to_lcc_func
)()
=
NULL
;
int
(
*
proj_lcc_to_lonlat_func
)()
=
NULL
;
/* the value in the second pair of brackets must match the length of
* the longest string (including terminating NUL) */
...
...
@@ -3723,13 +3724,21 @@ int gridVerifyGribParamLCC(int gridID, double missval, double *lon_0, double *la
if
(
lwarn
)
{
lwarn
=
false
;
//
lwarn = false;
const
char
*
projection
=
"lambert_conformal_conic"
;
if
(
IS_EQUAL
(
*
lon_0
,
missval
)
)
{
Warning
(
"%s mapping parameter %s missing!"
,
projection
,
"longitude_of_central_meridian"
);
}
if
(
IS_EQUAL
(
*
lat_0
,
missval
)
)
{
Warning
(
"%s mapping parameter %s missing!"
,
projection
,
"latitude_of_central_meridian"
);
}
if
(
IS_EQUAL
(
*
lat_1
,
missval
)
)
{
Warning
(
"%s mapping parameter %s missing!"
,
projection
,
"standard_parallel"
);
}
if
(
IS_EQUAL
(
*
xval_0
,
missval
)
||
IS_EQUAL
(
*
yval_0
,
missval
)
)
{
Warning
(
"%s mapping parameter %s missing!"
,
projection
,
"longitudeOfFirstGridPointInDegrees and latitudeOfFirstGridPointInDegrees"
);
}
if
(
IS_NOT_EQUAL
(
*
x_0
,
missval
)
&&
IS_NOT_EQUAL
(
*
y_0
,
grid_missval
)
&&
(
IS_EQUAL
(
*
xval_0
,
missval
)
||
IS_EQUAL
(
*
yval_0
,
missval
))
)
{
if
(
proj_lcc_to_lonlat_func
)
{
*
xval_0
=
-
(
*
x_0
);
*
yval_0
=
-
(
*
y_0
);
proj_lcc_to_lonlat_func
(
missval
,
*
lon_0
,
*
lat_0
,
*
lat_1
,
*
lat_2
,
*
a
,
*
rf
,
0
.
0
,
0
.
0
,
(
size_t
)
1
,
xval_0
,
yval_0
);
}
if
(
IS_EQUAL
(
*
xval_0
,
missval
)
||
IS_EQUAL
(
*
yval_0
,
missval
)
)
Warning
(
"%s mapping parameter %s missing!"
,
projection
,
"longitudeOfFirstGridPointInDegrees and latitudeOfFirstGridPointInDegrees"
);
}
}
return
0
;
...
...
src/grid.h
View file @
300491d3
...
...
@@ -8,6 +8,7 @@
extern
double
grid_missval
;
extern
int
(
*
proj_lonlat_to_lcc_func
)();
extern
int
(
*
proj_lcc_to_lonlat_func
)();
typedef
unsigned
char
mask_t
;
...
...
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