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
libcdi
Commits
6abbab42
Commit
6abbab42
authored
Apr 11, 2017
by
Uwe Schulzweida
Browse files
Use abs values of increment.
parent
1dd5bee0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/stream_cgribex.c
View file @
6abbab42
...
...
@@ -1708,7 +1708,7 @@ void cgribexDefGrid(int *isec1, int *isec2, double *fsec2, int *isec4, int gridI
{
xfirst
=
gridInqXval
(
gridID
,
0
);
xlast
=
gridInqXval
(
gridID
,
(
lcurvi
?
nlon
*
nlat
:
nlon
)
-
1
);
xinc
=
gridInqXinc
(
gridID
);
xinc
=
fabs
(
gridInqXinc
(
gridID
)
)
;
}
}
...
...
@@ -1746,7 +1746,6 @@ void cgribexDefGrid(int *isec1, int *isec2, double *fsec2, int *isec4, int gridI
else
{
ISEC2_LatIncr
=
(
int
)
lround
(
yinc
*
1000
);
if
(
ISEC2_LatIncr
<
0
)
ISEC2_LatIncr
=
-
ISEC2_LatIncr
;
}
if
(
ISEC2_NumLon
>
1
&&
ISEC2_NumLat
==
1
)
...
...
src/stream_gribapi.c
View file @
6abbab42
...
...
@@ -2063,7 +2063,7 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
{
xfirst
=
gridInqXval
(
gridID
,
0
);
xlast
=
gridInqXval
(
gridID
,
(
lcurvi
?
nlon
*
nlat
:
nlon
)
-
1
);
xinc
=
gridInqXinc
(
gridID
);
xinc
=
fabs
(
gridInqXinc
(
gridID
)
)
;
}
}
...
...
@@ -2072,9 +2072,18 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
{
yfirst
=
gridInqYval
(
gridID
,
0
);
ylast
=
gridInqYval
(
gridID
,
(
lcurvi
?
nlon
*
nlat
:
nlat
)
-
1
);
yinc
=
gridInqYinc
(
gridID
);
yinc
=
fabs
(
gridInqYinc
(
gridID
)
)
;
}
{
long
iscan
=
xfirst
>
xlast
;
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"iScansNegatively"
,
iscan
),
0
);
}
{
long
jscan
=
yfirst
<
ylast
;
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"jScansPositively"
,
jscan
),
0
);
}
if
(
gridtype
!=
GRID_GAUSSIAN_REDUCED
)
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"Ni"
,
nlon
),
0
);
GRIB_CHECK
(
my_grib_set_double
(
gh
,
"longitudeOfFirstGridPointInDegrees"
,
xfirst
),
0
);
GRIB_CHECK
(
my_grib_set_double
(
gh
,
"longitudeOfLastGridPointInDegrees"
,
xlast
),
0
);
...
...
@@ -2084,11 +2093,6 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
GRIB_CHECK
(
my_grib_set_double
(
gh
,
"latitudeOfFirstGridPointInDegrees"
,
yfirst
),
0
);
GRIB_CHECK
(
my_grib_set_double
(
gh
,
"latitudeOfLastGridPointInDegrees"
,
ylast
),
0
);
{
long
jscan
=
yfirst
<
ylast
;
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"jScansPositively"
,
jscan
),
0
);
}
if
(
gridtype
==
GRID_GAUSSIAN
||
gridtype
==
GRID_GAUSSIAN_REDUCED
)
{
int
np
=
gridInqNP
(
gridID
);
...
...
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