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
84803fa9
Commit
84803fa9
authored
May 26, 2019
by
Uwe Schulzweida
Browse files
netCDF: don't decode timevalue if timeunits is missing.
parent
f0cf1a5c
Changes
4
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
84803fa9
2019-0
5-23
Uwe Schulzweida
2019-0
6-11
Uwe Schulzweida
* using CGRIBEX library version 1.9.3
* Version 1.9.7 released
2019-05-26 Uwe Schulzweida
* netCDF: don't decode timevalue if timeunits is missing
2019-05-17 Uwe Schulzweida
* vlistInqVarLongname: return CDI_MAX_NAME chars (bug fix)
...
...
src/basetime.c
View file @
84803fa9
...
...
@@ -14,6 +14,7 @@ void basetimeInit(basetime_t *basetime)
basetime
->
ncdimid
=
CDI_UNDEFID
;
basetime
->
ncvarboundsid
=
CDI_UNDEFID
;
basetime
->
leadtimeid
=
CDI_UNDEFID
;
basetime
->
lunits
=
false
;
basetime
->
lwrf
=
false
;
basetime
->
timevar_cache
=
NULL
;
}
...
...
src/basetime.h
View file @
84803fa9
...
...
@@ -19,6 +19,7 @@ typedef struct {
int
ncdimid
;
int
ncvarboundsid
;
int
leadtimeid
;
bool
lunits
;
bool
lwrf
;
// true for time axis in WRF format
timecache_t
*
timevar_cache
;
}
...
...
src/stream_cdf_i.c
View file @
84803fa9
...
...
@@ -3992,6 +3992,7 @@ int cdfInqContents(stream_t *streamptr)
int
nctimevarid
=
streamptr
->
basetime
.
ncvarid
;
if
(
nctimevarid
!=
CDI_UNDEFID
&&
(
!
time_has_units
||
streamptr
->
basetime
.
lwrf
))
ncvars
[
nctimevarid
].
units
[
0
]
=
0
;
if
(
nctimevarid
!=
CDI_UNDEFID
&&
time_has_units
)
streamptr
->
basetime
.
lunits
=
true
;
if
(
time_has_units
)
{
...
...
@@ -4001,6 +4002,7 @@ int cdfInqContents(stream_t *streamptr)
{
nctimevarid
=
CDI_UNDEFID
;
streamptr
->
basetime
.
ncvarid
=
CDI_UNDEFID
;
streamptr
->
basetime
.
lunits
=
false
;
}
if
(
leadtime_id
!=
CDI_UNDEFID
&&
taxis
->
type
==
TAXIS_RELATIVE
)
...
...
@@ -4179,7 +4181,7 @@ int cdfInqTimestep(stream_t * streamptr, int tsID)
double
timevalue
=
tsID
;
int
nctimevarid
=
streamptr
->
basetime
.
ncvarid
;
if
(
nctimevarid
!=
CDI_UNDEFID
)
if
(
nctimevarid
!=
CDI_UNDEFID
&&
streamptr
->
basetime
.
lunits
)
{
int
fileID
=
streamptr
->
fileID
;
size_t
index
=
(
size_t
)
tsID
;
...
...
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