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
d32971c1
Commit
d32971c1
authored
Aug 20, 2015
by
Uwe Schulzweida
Browse files
coordinate attribute: bug fix for vertical coordinate
parent
22d6de38
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_cdf.c
View file @
d32971c1
...
...
@@ -3338,6 +3338,17 @@ int cdfDefVar(stream_t *streamptr, int varID)
char
coordinates
[
CDI_MAX_NAME
];
coordinates
[
0
]
=
0
;
if
(
zaxis_is_scalar
)
{
int
nczvarID
=
streamptr
->
nczvarID
[
zaxisindex
];
if
(
nczvarID
!=
CDI_UNDEFID
)
{
len
=
strlen
(
coordinates
);
if
(
len
)
coordinates
[
len
++
]
=
' '
;
cdf_inq_varname
(
fileID
,
nczvarID
,
coordinates
+
len
);
}
}
if
(
gridtype
!=
GRID_GENERIC
&&
gridtype
!=
GRID_LONLAT
&&
gridtype
!=
GRID_CURVILINEAR
)
{
size_t
len
=
strlen
(
gridNamePtr
(
gridtype
));
...
...
@@ -3370,16 +3381,6 @@ int cdfDefVar(stream_t *streamptr, int varID)
{
cdf_put_att_text
(
fileID
,
ncvarid
,
"coordinates"
,
9
,
"tlon tlat"
);
}
else
if
(
zaxis_is_scalar
)
{
int
nczvarID
=
streamptr
->
nczvarID
[
zaxisindex
];
if
(
nczvarID
!=
CDI_UNDEFID
)
{
len
=
strlen
(
coordinates
);
if
(
len
)
coordinates
[
len
++
]
=
' '
;
cdf_inq_varname
(
fileID
,
nczvarID
,
coordinates
+
len
);
}
}
else
if
(
gridtype
==
GRID_LONLAT
&&
xid
==
UNDEFID
&&
yid
==
UNDEFID
&&
gridsize
==
1
)
{
int
ncxvarID
=
streamptr
->
ncxvarID
[
gridindex
];
...
...
@@ -3403,6 +3404,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
int
ncxvarID
=
streamptr
->
ncxvarID
[
gridindex
];
int
ncyvarID
=
streamptr
->
ncyvarID
[
gridindex
];
int
ncavarID
=
streamptr
->
ncavarID
[
gridindex
];
printf
(
"curvi
\n
"
);
if
(
ncyvarID
!=
CDI_UNDEFID
)
{
len
=
strlen
(
coordinates
);
...
...
@@ -5674,6 +5676,7 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
if
(
status
==
NC_NOERR
)
{
cdfSetVar
(
ncvars
,
dimvarid
,
FALSE
);
printf
(
"coord varname: %s
\n
"
,
varname
);
if
(
cdiIgnoreAttCoordinates
==
FALSE
)
{
ncvars
[
ncvarid
].
coordvarids
[
i
]
=
dimvarid
;
...
...
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