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
40526e1a
Commit
40526e1a
authored
Feb 16, 2010
by
Uwe Schulzweida
Browse files
cleanup grib2 interface
parent
80a1fb14
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
40526e1a
2010-02-15 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* rotated grid: correct standard name [report: Michael Boettinger]
* cgribexDefTime: bug fix for timerange = -1
2010-02-10 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
...
...
app/cdi.c
View file @
40526e1a
...
...
@@ -690,7 +690,7 @@ int main(int argc, char *argv[])
if
(
Progname
==
0
)
Progname
=
argv
[
0
];
else
Progname
++
;
while
(
(
c
=
getopt
(
argc
,
argv
,
"f:t:w:z:cdhlmqrsvVZ"
))
!=
EOF
)
while
(
(
c
=
getopt
(
argc
,
argv
,
"f:t:w:z:cdhlmq
R
rsvVZ"
))
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -700,39 +700,42 @@ int main(int argc, char *argv[])
case
'f'
:
setDefaultFileType
(
optarg
);
break
;
case
'
r
'
:
Record
=
1
;
break
;
case
'
h
'
:
usage
()
;
exit
(
0
)
;
case
'l'
:
Longinfo
=
1
;
break
;
case
'm'
:
Move
=
1
;
break
;
case
'v'
:
Vardis
=
1
;
break
;
case
'V'
:
Version
=
1
;
break
;
case
'q'
:
Quiet
=
1
;
break
;
case
'R'
:
cdiDefGlobal
(
"REGULARGRID"
,
1
);
break
;
case
'r'
:
Record
=
1
;
break
;
case
's'
:
Shortinfo
=
1
;
break
;
case
't'
:
rTable
=
optarg
;
break
;
case
'v'
:
Vardis
=
1
;
break
;
case
'V'
:
Version
=
1
;
break
;
case
'w'
:
wTable
=
optarg
;
break
;
case
'z'
:
defineCompress
(
optarg
);
break
;
case
'h'
:
usage
();
exit
(
0
);
}
}
...
...
src/stream_gribapi.c
View file @
40526e1a
...
...
@@ -1872,6 +1872,8 @@ void gribapiDefGrid(grib_handle *gh, int gridID, int ljpeg)
static
char
func
[]
=
"gribapiDefGrid"
;
int
gridtype
;
static
short
lwarn
=
TRUE
;
size_t
len
;
const
char
*
mesg
;
// ISEC1_Sec2Or3Flag = 128;
...
...
@@ -1927,7 +1929,6 @@ void gribapiDefGrid(grib_handle *gh, int gridID, int ljpeg)
{
int
nlon
=
0
,
nlat
;
double
latIncr
;
size_t
len
;
if
(
gridtype
==
GRID_GAUSSIAN_REDUCED
)
{
...
...
@@ -2004,9 +2005,15 @@ void gribapiDefGrid(grib_handle *gh, int gridID, int ljpeg)
//if ( ISEC2_LastLat > ISEC2_FirstLat ) ISEC2_ScanFlag += 64;
if
(
ljpeg
)
GRIB_CHECK
(
grib_set_string
(
gh
,
"typeOfPacking"
,
"grid_jpeg"
,
&
len
),
0
);
{
mesg
=
"grid_jpeg"
;
len
=
strlen
(
mesg
);
GRIB_CHECK
(
grib_set_string
(
gh
,
"typeOfPacking"
,
mesg
,
&
len
),
0
);
}
else
GRIB_CHECK
(
grib_set_string
(
gh
,
"typeOfPacking"
,
"grid_simple"
,
&
len
),
0
);
{
mesg
=
"grid_simple"
;
len
=
strlen
(
mesg
);
GRIB_CHECK
(
grib_set_string
(
gh
,
"typeOfPacking"
,
mesg
,
&
len
),
0
);
}
break
;
}
...
...
@@ -2044,7 +2051,6 @@ void gribapiDefGrid(grib_handle *gh, int gridID, int ljpeg)
case
GRID_SPECTRAL
:
{
int
trunc
=
gridInqTrunc
(
gridID
);
size_t
len
=
15
;
GRIB_CHECK
(
grib_set_long
(
gh
,
"gridDefinitionTemplateNumber"
,
GRIBAPI_GTYPE_SPECTRAL
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"J"
,
trunc
),
0
);
...
...
@@ -2055,9 +2061,20 @@ void gribapiDefGrid(grib_handle *gh, int gridID, int ljpeg)
GRIB_CHECK
(
grib_set_long
(
gh
,
"numberOfValues"
,
gridInqSize
(
gridID
)),
0
);
if
(
gridInqComplexPacking
(
gridID
)
)
GRIB_CHECK
(
grib_set_long
(
gh
,
"complexPacking"
,
1
),
0
);
{
mesg
=
"spectral_complex"
;
len
=
strlen
(
mesg
);
GRIB_CHECK
(
grib_set_string
(
gh
,
"typeOfPacking"
,
mesg
,
&
len
),
0
);
/*
GRIB_CHECK(grib_set_long(gh, "JS", 20), 0);
GRIB_CHECK(grib_set_long(gh, "KS", 20), 0);
GRIB_CHECK(grib_set_long(gh, "MS", 20), 0);
*/
}
else
GRIB_CHECK
(
grib_set_long
(
gh
,
"complexPacking"
,
0
),
0
);
{
mesg
=
"spectral_simple"
;
len
=
strlen
(
mesg
);
GRIB_CHECK
(
grib_set_string
(
gh
,
"typeOfPacking"
,
mesg
,
&
len
),
0
);
}
break
;
}
...
...
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