Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
a15a2879
Commit
a15a2879
authored
Aug 18, 2015
by
Uwe Schulzweida
Browse files
use axis attribute to find z axis vars without dimensions
parent
852b96e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_cdf.c
View file @
a15a2879
...
...
@@ -5655,7 +5655,7 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
cdfSetVar(ncvars, ncvarid, TRUE);
}
*/
else
if
(
(
strcmp
(
attname
,
"associate"
)
==
0
||
strcmp
(
attname
,
"
coordinates"
)
==
0
)
&&
xtypeIsText
(
atttype
)
)
else
if
(
(
strcmp
(
attname
,
"associate"
)
==
0
||
strcmp
(
attname
,
"coordinates"
)
==
0
)
&&
xtypeIsText
(
atttype
)
)
{
int
status
;
char
*
varname
=
NULL
;
...
...
@@ -5872,9 +5872,8 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
cdfGetAttText
(
ncid
,
ncvarid
,
attname
,
attstringlen
,
attstring
);
attlen
=
strlen
(
attstring
);
if
(
(
int
)
attlen
>
nvdims
)
if
(
(
int
)
attlen
>
nvdims
&&
nvdims
>
0
&&
attlen
>
1
)
{
if
(
nvdims
>
0
)
Warning
(
"Unexpected axis attribute length for %s, ignored!"
,
name
);
}
else
...
...
@@ -5890,7 +5889,7 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
}
}
if
(
i
==
(
int
)
attlen
&&
(
int
)
attlen
==
nvdims
)
if
(
i
==
(
int
)
attlen
&&
(
(
int
)
attlen
==
nvdims
||
(
attlen
==
1
&&
nvdims
==
0
))
)
{
while
(
attlen
--
)
{
...
...
@@ -5901,14 +5900,22 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
}
else
if
(
(
int
)
attstring
[
attlen
]
==
'z'
)
{
ncvars
[
ncvarid
].
zdim
=
dimidsp
[
attlen
];
cdfSetDim
(
ncvars
,
ncvarid
,
(
int
)
attlen
,
Z_AXIS
);
if
(
ncvars
[
ncvarid
].
ndims
==
1
)
{
cdfSetVar
(
ncvars
,
ncvarid
,
FALSE
);
ncdims
[
ncvars
[
ncvarid
].
dimids
[
0
]].
dimtype
=
Z_AXIS
;
}
if
(
nvdims
==
0
)
{
cdfSetVar
(
ncvars
,
ncvarid
,
FALSE
);
ncvars
[
ncvarid
].
islev
=
TRUE
;
}
else
{
ncvars
[
ncvarid
].
zdim
=
dimidsp
[
attlen
];
cdfSetDim
(
ncvars
,
ncvarid
,
(
int
)
attlen
,
Z_AXIS
);
if
(
ncvars
[
ncvarid
].
ndims
==
1
)
{
cdfSetVar
(
ncvars
,
ncvarid
,
FALSE
);
ncdims
[
ncvars
[
ncvarid
].
dimids
[
0
]].
dimtype
=
Z_AXIS
;
}
}
}
else
if
(
(
int
)
attstring
[
attlen
]
==
'y'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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