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
693f0f3d
Commit
693f0f3d
authored
5 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Added cdiInitKeys().
parent
f927d7da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
Replaced gridDefDatatype()/gridInqDatatype() by cdiDefKeyInt()/cdiInqKeyInt()...
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/cdi_key.c
+8
-0
8 additions, 0 deletions
src/cdi_key.c
src/cdi_key.h
+2
-0
2 additions, 0 deletions
src/cdi_key.h
src/grid.c
+5
-11
5 additions, 11 deletions
src/grid.c
src/varscan.c
+2
-3
2 additions, 3 deletions
src/varscan.c
src/zaxis.c
+4
-5
4 additions, 5 deletions
src/zaxis.c
with
21 additions
and
19 deletions
src/cdi_key.c
+
8
−
0
View file @
693f0f3d
...
...
@@ -574,6 +574,14 @@ const char *cdiInqVarKeyStringPtr(cdi_keys_t *keysp, int key)
return
NULL
;
}
void
cdiInitKeys
(
cdi_keys_t
*
keysp
)
{
keysp
->
nalloc
=
MAX_KEYS
;
keysp
->
nelems
=
0
;
for
(
int
i
=
0
;
i
<
MAX_KEYS
;
++
i
)
keysp
->
value
[
i
].
length
=
0
;
}
/*
* Local Variables:
* c-file-style: "Java"
...
...
This diff is collapsed.
Click to expand it.
src/cdi_key.h
+
2
−
0
View file @
693f0f3d
...
...
@@ -56,6 +56,8 @@ void cdiDeleteVarKeys(cdi_keys_t *keysp);
void
cdiDeleteKeys
(
int
cdiID
,
int
varID
);
void
cdiPrintKeys
(
int
cdiID
,
int
varID
);
void
cdiInitKeys
(
cdi_keys_t
*
keysp
);
#endif
/*
...
...
This diff is collapsed.
Click to expand it.
src/grid.c
+
5
−
11
View file @
693f0f3d
...
...
@@ -127,10 +127,7 @@ void grid_axis_init(struct gridaxis_t *axisptr)
axisptr
->
cvals
=
NULL
;
#endif
axisptr
->
stdname
=
NULL
;
axisptr
->
keys
.
nalloc
=
MAX_KEYS
;
axisptr
->
keys
.
nelems
=
0
;
for
(
int
i
=
0
;
i
<
MAX_KEYS
;
++
i
)
axisptr
->
keys
.
value
[
i
].
length
=
0
;
cdiInitKeys
(
&
axisptr
->
keys
);
}
void
grid_init
(
grid_t
*
gridptr
)
...
...
@@ -168,10 +165,7 @@ void grid_init(grid_t *gridptr)
gridptr
->
hasdims
=
true
;
gridptr
->
name
=
NULL
;
gridptr
->
vtable
=
&
cdiGridVtable
;
gridptr
->
keys
.
nalloc
=
MAX_KEYS
;
gridptr
->
keys
.
nelems
=
0
;
for
(
int
i
=
0
;
i
<
MAX_KEYS
;
++
i
)
gridptr
->
keys
.
value
[
i
].
length
=
0
;
cdiInitKeys
(
&
gridptr
->
keys
);
gridptr
->
atts
.
nalloc
=
MAX_ATTRIBUTES
;
gridptr
->
atts
.
nelems
=
0
;
gridptr
->
iScansNegatively
=
0
;
...
...
@@ -248,11 +242,11 @@ void grid_copy_base_scalar_fields(grid_t *gridptrOrig, grid_t *gridptrDup)
{
memcpy
(
gridptrDup
,
gridptrOrig
,
sizeof
(
grid_t
));
gridptrDup
->
self
=
CDI_UNDEFID
;
gridptrDup
->
keys
.
nelems
=
0
;
cdiInitKeys
(
&
gridptrDup
->
keys
)
;
cdiCopyVarKeys
(
&
gridptrOrig
->
keys
,
&
gridptrDup
->
keys
);
gridptrDup
->
x
.
keys
.
nelems
=
0
;
cdiInitKeys
(
&
gridptrDup
->
x
.
keys
)
;
cdiCopyVarKeys
(
&
gridptrOrig
->
x
.
keys
,
&
gridptrDup
->
x
.
keys
);
gridptrDup
->
y
.
keys
.
nelems
=
0
;
cdiInitKeys
(
&
gridptrDup
->
y
.
keys
)
;
cdiCopyVarKeys
(
&
gridptrOrig
->
y
.
keys
,
&
gridptrDup
->
y
.
keys
);
if
(
gridptrOrig
->
reference
)
gridptrDup
->
reference
=
strdupx
(
gridptrOrig
->
reference
);
}
...
...
This diff is collapsed.
Click to expand it.
src/varscan.c
+
2
−
3
View file @
693f0f3d
...
...
@@ -113,8 +113,7 @@ void paramInitEntry(unsigned varID, int param)
vartable
[
varID
].
instID
=
CDI_UNDEFID
;
vartable
[
varID
].
modelID
=
CDI_UNDEFID
;
vartable
[
varID
].
tableID
=
CDI_UNDEFID
;
vartable
[
varID
].
keys
.
nalloc
=
MAX_KEYS
;
vartable
[
varID
].
keys
.
nelems
=
0
;
cdiInitKeys
(
&
vartable
[
varID
].
keys
);
vartable
[
varID
].
comptype
=
CDI_COMPRESS_NONE
;
vartable
[
varID
].
complevel
=
1
;
vartable
[
varID
].
lmissval
=
false
;
...
...
@@ -515,7 +514,7 @@ int cmpLevelTableInv(const void* s1, const void* s2)
void
varCopyKeys
(
int
vlistID
,
int
varID
)
{
vlist_t
*
vlistptr
=
vlist_to_pointer
(
vlistID
);
vlistptr
->
vars
[
varID
].
keys
.
nelems
=
0
;
cdiInitKeys
(
&
vlistptr
->
vars
[
varID
].
keys
)
;
cdiCopyVarKeys
(
&
vartable
[
varID
].
keys
,
&
vlistptr
->
vars
[
varID
].
keys
);
}
...
...
This diff is collapsed.
Click to expand it.
src/zaxis.c
+
4
−
5
View file @
693f0f3d
...
...
@@ -133,10 +133,7 @@ void zaxis_init(zaxis_t *zaxisptr)
zaxisptr
->
nhlev
=
0
;
memset
(
zaxisptr
->
uuid
,
0
,
CDI_UUID_SIZE
);
zaxisptr
->
keys
.
nalloc
=
MAX_KEYS
;
zaxisptr
->
keys
.
nelems
=
0
;
for
(
int
i
=
0
;
i
<
MAX_KEYS
;
++
i
)
zaxisptr
->
keys
.
value
[
i
].
length
=
0
;
cdiInitKeys
(
&
zaxisptr
->
keys
);
zaxisptr
->
atts
.
nalloc
=
MAX_ATTRIBUTES
;
zaxisptr
->
atts
.
nelems
=
0
;
}
...
...
@@ -175,7 +172,7 @@ void zaxis_copy(zaxis_t *zaxisptr2, zaxis_t *zaxisptr1)
const
int
zaxisID2
=
zaxisptr2
->
self
;
memcpy
(
zaxisptr2
,
zaxisptr1
,
sizeof
(
zaxis_t
));
zaxisptr2
->
self
=
zaxisID2
;
zaxisptr2
->
keys
.
nelems
=
0
;
cdiInitKeys
(
&
zaxisptr2
->
keys
)
;
cdiCopyVarKeys
(
&
zaxisptr1
->
keys
,
&
zaxisptr2
->
keys
);
}
...
...
@@ -820,6 +817,7 @@ int zaxisInqLevels(int zaxisID, double *levels)
return
size
;
}
int
zaxisInqCLen
(
int
zaxisID
)
{
zaxis_t
*
zaxisptr
=
zaxis_to_pointer
(
zaxisID
);
...
...
@@ -833,6 +831,7 @@ int zaxisInqCLen(int zaxisID)
return
clen
;
}
int
zaxisInqCVals
(
int
zaxisID
,
char
***
clevels
)
{
zaxis_t
*
zaxisptr
=
zaxis_to_pointer
(
zaxisID
);
...
...
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