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
2c832404
Commit
2c832404
authored
Sep 29, 2017
by
Uwe Schulzweida
Browse files
Added interface routine vlistDefVarTimetype() and vlistInqVarTimetype().
parent
6e246856
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cdi.h
View file @
2c832404
...
...
@@ -225,8 +225,9 @@ typedef struct {
/* TIME types */
#define TIME_CONSTANT 0
/* obsolate, use TSTEP_CONSTANT */
#define TIME_VARIABLE 1
/* obsolate, use TSTEP_INSTANT */
#define TIME_CONSTANT 0
/* Time constant */
#define TIME_VARYING 1
/* Time varying */
#define TIME_VARIABLE 1
/* obsolate, use TIME_VARYING */
/* TSTEP types */
...
...
@@ -571,6 +572,9 @@ int vlistInqVarZaxis(int vlistID, int varID);
/* used in MPIOM */
int
vlistInqVarID
(
int
vlistID
,
int
code
);
void
vlistDefVarTimetype
(
int
vlistID
,
int
varID
,
int
tsteptype
);
int
vlistInqVarTimetype
(
int
vlistID
,
int
varID
);
void
vlistDefVarTsteptype
(
int
vlistID
,
int
varID
,
int
tsteptype
);
/* vlistInqVarTsteptype: Get the timestep type of a Variable */
...
...
src/vlist.h
View file @
2c832404
...
...
@@ -54,6 +54,7 @@ typedef struct
int
param
;
int
gridID
;
int
zaxisID
;
int
timetype
;
/* TIME_* */
int
tsteptype
;
/* TSTEP_* */
int
datatype
;
/* CDI_DATATYPE_PACKX for GRIB data, else CDI_DATATYPE_FLT32 or CDI_DATATYPE_FLT64 */
int
instID
;
...
...
@@ -127,7 +128,6 @@ void vlistDestroyVarLongname(int vlistID, int varID);
void
vlistDestroyVarStdname
(
int
vlistID
,
int
varID
);
void
vlistDestroyVarUnits
(
int
vlistID
,
int
varID
);
void
cdiVlistDestroy_
(
int
vlistID
);
void
vlistDefVarTsteptype
(
int
vlistID
,
int
varID
,
int
tsteptype
);
int
vlistInqVarMissvalUsed
(
int
vlistID
,
int
varID
);
int
vlistHasTime
(
int
vlistID
);
...
...
src/vlist_var.c
View file @
2c832404
...
...
@@ -32,6 +32,7 @@ void vlistvarInitEntry(int vlistID, int varID)
vlistptr
->
vars
[
varID
].
flag
=
0
;
vlistptr
->
vars
[
varID
].
param
=
0
;
vlistptr
->
vars
[
varID
].
datatype
=
CDI_UNDEFID
;
vlistptr
->
vars
[
varID
].
timetype
=
CDI_UNDEFID
;
vlistptr
->
vars
[
varID
].
tsteptype
=
TSTEP_INSTANT
;
vlistptr
->
vars
[
varID
].
timave
=
0
;
vlistptr
->
vars
[
varID
].
timaccu
=
0
;
...
...
@@ -1192,6 +1193,24 @@ void vlistDefVarAddoffset(int vlistID, int varID, double addoffset)
}
void
vlistDefVarTimetype
(
int
vlistID
,
int
varID
,
int
timetype
)
{
vlist_t
*
vlistptr
=
vlist_to_pointer
(
vlistID
);
if
(
vlistptr
->
vars
[
varID
].
timetype
!=
timetype
)
{
vlistptr
->
vars
[
varID
].
timetype
=
timetype
;
reshSetStatus
(
vlistID
,
&
vlistOps
,
RESH_DESYNC_IN_USE
);
}
}
int
vlistInqVarTimetype
(
int
vlistID
,
int
varID
)
{
vlist_t
*
vlistptr
=
vlist_to_pointer
(
vlistID
);
return
vlistptr
->
vars
[
varID
].
timetype
;
}
void
vlistDefVarTsteptype
(
int
vlistID
,
int
varID
,
int
tsteptype
)
{
vlist_t
*
vlistptr
=
vlist_to_pointer
(
vlistID
);
...
...
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