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
2b1e78ef
Commit
2b1e78ef
authored
May 16, 2017
by
Fabian Wachsmann
Browse files
Maintain coordinates attribute and added maximal string length to functions
parent
c03ae90d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cdf_write.c
View file @
2b1e78ef
...
...
@@ -558,7 +558,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
char
coordinates
[
CDI_MAX_NAME
];
coordinates
[
0
]
=
0
;
if
(
zaxis_is_scalar
)
if
(
zaxis_is_scalar
||
zaxisInqType
(
zaxisID
)
==
ZAXIS_CHAR
)
{
int
nczvarID
=
streamptr
->
nczvarID
[
zaxisindex
];
if
(
nczvarID
!=
CDI_UNDEFID
)
...
...
src/cdi.h
View file @
2b1e78ef
...
...
@@ -1011,11 +1011,17 @@ void zaxisPrint(int zaxisID);
void
zaxisDefLevels
(
int
zaxisID
,
const
double
levels
[]);
/* zaxisDefCvals: Define area types of a Z-axis */
void
zaxisDefCvals
(
int
zaxisID
,
const
char
*
cvals
[]);
void
zaxisDefCvals
(
int
zaxisID
,
const
char
*
cvals
[]
,
size_t
clength
);
/* zaxisInqLevels: Get all levels of a Z-axis */
int
zaxisInqLevels
(
int
zaxisID
,
double
levels
[]);
/* zaxisInqCLen: Get maximal string length of character Z-axis */
int
zaxisInqCLen
(
int
zaxisID
);
/* zaxisInqCLevels: Get all string values of a character Z-axis */
int
zaxisInqCLevels
(
int
zaxisID
,
char
***
clevels
);
/* zaxisDefLevel: Define one level of a Z-axis */
void
zaxisDefLevel
(
int
zaxisID
,
int
levelID
,
double
levels
);
...
...
src/stream_cdf_i.c
View file @
2b1e78ef
...
...
@@ -2853,6 +2853,7 @@ int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
double
*
zvar
=
NULL
;
char
**
zcvals
=
NULL
;
size_t
zclength
=
0
;
int
zaxisType
=
CDI_UNDEFID
;
if
(
zvarid
!=
CDI_UNDEFID
)
zaxisType
=
ncvars
[
zvarid
].
zaxistype
;
...
...
@@ -2880,8 +2881,8 @@ int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
if
(
ncvars
[
zvarid
].
ndims
==
2
)
{
zprec
=
CDI_DATATYPE_UINT8
;
size_t
str
length
=
ncdims
[
ncvars
[
zvarid
].
dimids
[
1
]].
len
;
cdf_load_cvals
(
zsize
*
str
length
,
zvarid
,
ncvar
,
&
zcvals
,
zsize
);
zc
length
=
ncdims
[
ncvars
[
zvarid
].
dimids
[
1
]].
len
;
cdf_load_cvals
(
zsize
*
zc
length
,
zvarid
,
ncvar
,
&
zcvals
,
zsize
);
}
}
...
...
@@ -2946,7 +2947,7 @@ int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
return
CDI_EDIMSIZE
;
}
ncvar
->
zaxisID
=
varDefZaxis
(
vlistID
,
zaxisType
,
(
int
)
zsize
,
zvar
,
(
const
char
**
)
zcvals
,
with_bounds
,
lbounds
,
ubounds
,
ncvar
->
zaxisID
=
varDefZaxis
(
vlistID
,
zaxisType
,
(
int
)
zsize
,
zvar
,
(
const
char
**
)
zcvals
,
zclength
,
with_bounds
,
lbounds
,
ubounds
,
(
int
)
vctsize
,
vct
,
pname
,
plongname
,
punits
,
zprec
,
1
,
0
);
int
zaxisID
=
ncvar
->
zaxisID
;
...
...
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