Skip to content

Commit

Permalink
Merge branch 'hotfix/1.10.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
danovaro committed Aug 9, 2023
2 parents 79c19b3 + b8b5be9 commit d2dcbe5
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.13
1.10.14
24 changes: 24 additions & 0 deletions share/metkit/params-static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,27 @@
- 263505
- 263506
- 263507
- - levtype: sfc
stream: oper
type: fc
- - 3062
- 3099
- 160198
- 228032
- 228143
- 228144
- 228164
- 228228
- 228236
- 231001
- 231002
- 231003
- 231010
- 231012
- 260199
- 260227
- 260228
- 260259
- 260360
- 260509
- 262121
27 changes: 24 additions & 3 deletions src/metkit/mars/TypeParam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,19 +322,40 @@ static void init() {
const eckit::Value rs = eckit::YAMLParser::decodeFile(LibMetkit::paramStaticYamlFile());
ASSERT(rs.isList());

r += rs;

// merge r and rs
eckit::ValueMap merge;
for (size_t i = 0; i < r.size(); ++i) {
const eckit::Value& rule = r[i];

if (!rule.isList()) {
rule.dump(Log::error()) << std::endl;
}
ASSERT(rule.isList());
ASSERT(rule.size() == 2);

merge.emplace(rule[0], rule[1]);
}

for (size_t i = 0; i < rs.size(); ++i) {
const eckit::Value& rule = rs[i];

if (!rule.isList()) {
rule.dump(Log::error()) << std::endl;
}
ASSERT(rule.isList());
ASSERT(rule.size() == 2);

(*rules).push_back(Rule(rule[0], rule[1], ids));
auto it = merge.find(rule[0]);
if (it == merge.end()) {
merge.emplace(rule[0], rule[1]);
}
else {
it->second += rule[1];
}
}

for (auto it = merge.begin(); it != merge.end(); it++) {
(*rules).push_back(Rule(it->first, it->second, ids));
}
}

Expand Down

0 comments on commit d2dcbe5

Please sign in to comment.