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
3b7ef021
Commit
3b7ef021
authored
19 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Add function vlistChangeVarGrid
parent
51637717
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ChangeLog
+1
-0
1 addition, 0 deletions
ChangeLog
src/cdi.h
+1
-0
1 addition, 0 deletions
src/cdi.h
src/vlist_var.c
+51
-5
51 additions, 5 deletions
src/vlist_var.c
with
53 additions
and
5 deletions
ChangeLog
+
1
−
0
View file @
3b7ef021
2006-03-?? Uwe Schulzweida <schulzweida@dkrz.de>
* vlist_var: Add function vlistChangeVarGrid
* program cdi: add option -s for short info
* cdfInqContents: improve GRID_CELL support
* cdfDefTime: attr text bounds for time axis (bug fix [Veronika])
...
...
This diff is collapsed.
Click to expand it.
src/cdi.h
+
1
−
0
View file @
3b7ef021
...
...
@@ -228,6 +228,7 @@ void vlistDefAttribute(int vlistID, const char *attname, const char *attstrin
/* vlistDefVar: Create a new Variable */
int
vlistDefVar
(
int
vlistID
,
int
gridID
,
int
zaxisID
,
int
timeID
);
void
vlistChangeVarGrid
(
int
vlistID
,
int
varID
,
int
gridID
);
void
vlistChangeVarZaxis
(
int
vlistID
,
int
varID
,
int
zaxisID
);
void
vlistInqVar
(
int
vlistID
,
int
varID
,
int
*
gridID
,
int
*
zaxisID
,
int
*
timeID
);
...
...
This diff is collapsed.
Click to expand it.
src/vlist_var.c
+
51
−
5
View file @
3b7ef021
...
...
@@ -463,7 +463,7 @@ void vlistInqVarLongname(int vlistID, int varID, char *longname)
void
vlistInqVarStdname
(
int
vlistID
,
int
varID
,
char
*
stdname
)
{
static
char
func
[]
=
"vlistInqVarStdname"
;
int
code
,
tableID
;
/*
int code, tableID;
*/
VLIST
*
vlistptr
;
vlistptr
=
vlist_to_pointer
(
vlistID
);
...
...
@@ -1138,12 +1138,58 @@ void vlistChangeVarZaxis(int vlistID, int varID, int zaxisID)
}
else
{
if
(
vlistptr
->
nzaxis
+
1
>=
MAX_ZAXIS
)
Error
(
func
,
"Maximum of %d zaxis reached"
,
MAX_ZAXIS
)
;
for
(
index
=
0
;
index
<
vlistptr
->
nzaxis
;
index
++
)
if
(
vlistptr
->
zaxisIDs
[
index
]
==
zaxisID
)
break
;
vlistptr
->
zaxisIDs
[
vlistptr
->
nzaxis
]
=
zaxisID
;
vlistptr
->
nzaxis
++
;
if
(
index
==
nvars
)
{
if
(
vlistptr
->
nzaxis
+
1
>=
MAX_ZAXIS
)
Error
(
func
,
"Maximum of %d zaxis reached"
,
MAX_ZAXIS
);
vlistptr
->
zaxisIDs
[
vlistptr
->
nzaxis
]
=
zaxisID
;
vlistptr
->
nzaxis
++
;
}
}
vlistptr
->
vars
[
varID
].
zaxisID
=
zaxisID
;
}
void
vlistChangeVarGrid
(
int
vlistID
,
int
varID
,
int
gridID
)
{
static
char
func
[]
=
"vlistChangeVarGrid"
;
int
nvars
,
index
;
VLIST
*
vlistptr
;
vlistptr
=
vlist_to_pointer
(
vlistID
);
vlistCheckVarID
(
func
,
vlistID
,
varID
);
nvars
=
vlistptr
->
nvars
;
for
(
index
=
0
;
index
<
nvars
;
index
++
)
if
(
index
!=
varID
)
if
(
vlistptr
->
vars
[
index
].
gridID
==
vlistptr
->
vars
[
varID
].
gridID
)
break
;
if
(
index
==
nvars
)
{
for
(
index
=
0
;
index
<
vlistptr
->
ngrids
;
index
++
)
if
(
vlistptr
->
gridIDs
[
index
]
==
vlistptr
->
vars
[
varID
].
gridID
)
vlistptr
->
gridIDs
[
index
]
=
gridID
;
}
else
{
for
(
index
=
0
;
index
<
vlistptr
->
ngrids
;
index
++
)
if
(
vlistptr
->
gridIDs
[
index
]
==
gridID
)
break
;
if
(
index
==
nvars
)
{
if
(
vlistptr
->
ngrids
+
1
>=
MAX_GRIDS
)
Error
(
func
,
"Maximum of %d grids reached"
,
MAX_GRIDS
);
vlistptr
->
gridIDs
[
vlistptr
->
ngrids
]
=
gridID
;
vlistptr
->
ngrids
++
;
}
}
vlistptr
->
vars
[
varID
].
gridID
=
gridID
;
}
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