Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
2c832404
Commit
2c832404
authored
7 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Added interface routine vlistDefVarTimetype() and vlistInqVarTimetype().
parent
6e246856
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cdi.h
+6
-2
6 additions, 2 deletions
src/cdi.h
src/vlist.h
+1
-1
1 addition, 1 deletion
src/vlist.h
src/vlist_var.c
+19
-0
19 additions, 0 deletions
src/vlist_var.c
with
26 additions
and
3 deletions
src/cdi.h
+
6
−
2
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 */
...
...
This diff is collapsed.
Click to expand it.
src/vlist.h
+
1
−
1
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
);
...
...
This diff is collapsed.
Click to expand it.
src/vlist_var.c
+
19
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment