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
cdo
Commits
5ef70d05
Commit
5ef70d05
authored
Jan 07, 2021
by
Uwe Schulzweida
Browse files
grid_read_mapping: set default name for CDI_KEY_GRIDMAP_VARNAME.
parent
24ae64ad
Pipeline
#5635
passed with stages
in 14 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/grid_read.cc
View file @
5ef70d05
...
...
@@ -256,6 +256,7 @@ grid_read_data(size_t ikv, size_t nkv, KVMap *kvmap, GridDesciption &grid, size_
static
void
grid_read_mapping
(
size_t
igmap
,
size_t
nkv
,
KVMap
*
kvmap
,
int
gridID
)
{
bool
hasGridmapVarname
=
false
;
for
(
size_t
ik
=
igmap
;
ik
<
nkv
;
++
ik
)
{
if
(
!
kvmap
[
ik
].
isValid
)
continue
;
...
...
@@ -269,14 +270,25 @@ grid_read_mapping(size_t igmap, size_t nkv, KVMap *kvmap, int gridID)
if
(
key
==
"grid_mapping"
)
{
hasGridmapVarname
=
true
;
cdiDefKeyString
(
gridID
,
CDI_GLOBAL
,
CDI_KEY_GRIDMAP_VARNAME
,
value
.
c_str
());
continue
;
}
if
(
key
==
"grid_mapping_name"
)
cdiDefKeyString
(
gridID
,
CDI_GLOBAL
,
CDI_KEY_GRIDMAP_NAME
,
value
.
c_str
());
if
(
key
==
"grid_mapping_name"
)
{
if
(
!
hasGridmapVarname
)
{
if
(
value
==
"rotated_latitude_longitude"
)
cdiDefKeyString
(
gridID
,
CDI_GLOBAL
,
CDI_KEY_GRIDMAP_VARNAME
,
"rotated_pole"
);
else
cdiDefKeyString
(
gridID
,
CDI_GLOBAL
,
CDI_KEY_GRIDMAP_VARNAME
,
"crs"
);
}
const
auto
dtype
=
literalsFindDatatype
(
nvalues
,
values
);
cdiDefKeyString
(
gridID
,
CDI_GLOBAL
,
CDI_KEY_GRIDMAP_NAME
,
value
.
c_str
());
}
const
auto
dtype
=
literalsFindDatatype
(
nvalues
,
values
);
if
(
dtype
==
CDI_DATATYPE_INT8
||
dtype
==
CDI_DATATYPE_INT16
||
dtype
==
CDI_DATATYPE_INT32
)
{
std
::
vector
<
int
>
ivals
(
nvalues
);
...
...
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