Skip to content

Commit

Permalink
EASE polar grids
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaciel committed May 16, 2024
1 parent a47b86d commit 02a9f69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions etc/mir/netcdf.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
# yamllint disable rule:line-length
<UNDEFINED>:
paramId: 151

air_pressure_at_sea_level:
paramId: 151
Expand Down
8 changes: 4 additions & 4 deletions src/mir/netcdf/Endowed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ void Endowed::getAttributes(int nc, int i, int nattr) {
NC_CALL(nc_inq_attname(nc, i, j, name), path());
NC_CALL(nc_inq_att(nc, i, name, &type, &len), path());

Type& kind = Type::lookup(type);
Value* attribute = kind.attributeValue(nc, i, name, len, path());

add(new InputAttribute(*this, name, attribute));
Type& kind = Type::lookup(type);
if (Value* attribute = kind.attributeValue(nc, i, name, len, path()); attribute != nullptr) {
add(new InputAttribute(*this, name, attribute));
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/mir/netcdf/Type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ Value* TypeT<unsigned char>::attributeValue(int nc, int id, const char* name, si

template <>
Value* TypeT<short>::attributeValue(int nc, int id, const char* name, size_t len, const std::string& path) {
if (len != 1) {
return nullptr;
}
short value;
ASSERT(len == 1);
NC_CALL(nc_get_att_short(nc, id, name, &value), path);
Expand Down

0 comments on commit 02a9f69

Please sign in to comment.