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
f01d9986
Commit
f01d9986
authored
Jun 07, 2012
by
Uwe Schulzweida
Browse files
added support for more timestep type
parent
fad1fa14
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cdi.h
View file @
f01d9986
...
...
@@ -166,9 +166,13 @@ extern "C" {
#define TSTEP_MAX 4
#define TSTEP_MIN 5
#define TSTEP_DIFF 6
#define TSTEP_RANGE 7
#define TSTEP_INSTANT2 8
#define TSTEP_INSTANT3 9
#define TSTEP_RMS 7
#define TSTEP_SD 8
#define TSTEP_COV 9
#define TSTEP_RATIO 10
#define TSTEP_RANGE 11
#define TSTEP_INSTANT2 12
#define TSTEP_INSTANT3 13
/* TAXIS types */
...
...
src/stream_gribapi.c
View file @
f01d9986
...
...
@@ -196,9 +196,15 @@ int gribapiGetTsteptype(grib_handle *gh)
if
(
status
==
0
&&
len
>
1
&&
len
<
256
)
{
if
(
strncmp
(
"instant"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_INSTANT
;
else
if
(
strncmp
(
"min"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_MIN
;
else
if
(
strncmp
(
"max"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_MAX
;
else
if
(
strncmp
(
"avg"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_AVG
;
else
if
(
strncmp
(
"accum"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_ACCUM
;
else
if
(
strncmp
(
"max"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_MAX
;
else
if
(
strncmp
(
"min"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_MIN
;
else
if
(
strncmp
(
"diff"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_DIFF
;
else
if
(
strncmp
(
"rms"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_RMS
;
else
if
(
strncmp
(
"sd"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_SD
;
else
if
(
strncmp
(
"cov"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_COV
;
else
if
(
strncmp
(
"ratio"
,
stepType
,
len
)
==
0
)
tsteptype
=
TSTEP_RATIO
;
else
if
(
lprint
)
{
Message
(
"stepType %s unsupported, set to instant!"
,
stepType
);
...
...
@@ -2062,9 +2068,15 @@ int gribapiDefTsteptype(grib_handle *gh, int tsteptype, int timeunit, int factor
switch
(
tsteptype
)
{
case
TSTEP_INSTANT
:
strcpy
(
stepType
,
"instant"
);
proDefTempNum
=
0
;
break
;
case
TSTEP_MIN
:
strcpy
(
stepType
,
"min"
);
proDefTempNum
=
8
;
break
;
case
TSTEP_MAX
:
strcpy
(
stepType
,
"max"
);
proDefTempNum
=
8
;
break
;
case
TSTEP_AVG
:
strcpy
(
stepType
,
"avg"
);
proDefTempNum
=
8
;
break
;
case
TSTEP_ACCUM
:
strcpy
(
stepType
,
"accum"
);
proDefTempNum
=
8
;
break
;
case
TSTEP_MAX
:
strcpy
(
stepType
,
"max"
);
proDefTempNum
=
8
;
break
;
case
TSTEP_MIN
:
strcpy
(
stepType
,
"min"
);
proDefTempNum
=
8
;
break
;
case
TSTEP_DIFF
:
strcpy
(
stepType
,
"diff"
);
proDefTempNum
=
8
;
break
;
case
TSTEP_RMS
:
strcpy
(
stepType
,
"rms"
);
proDefTempNum
=
8
;
break
;
case
TSTEP_SD
:
strcpy
(
stepType
,
"sd"
);
proDefTempNum
=
8
;
break
;
case
TSTEP_COV
:
strcpy
(
stepType
,
"cov"
);
proDefTempNum
=
8
;
break
;
case
TSTEP_RATIO
:
strcpy
(
stepType
,
"ratio"
);
proDefTempNum
=
8
;
break
;
default:
strcpy
(
stepType
,
"instant"
);
proDefTempNum
=
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