Skip to content

Commit

Permalink
Merge branch 'release/1.21.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaciel committed May 14, 2024
2 parents ab6b0c5 + 5bbf422 commit 979a904
Show file tree
Hide file tree
Showing 700 changed files with 1,815 additions and 1,409 deletions.
1 change: 1 addition & 0 deletions .github/ci-config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cmake_options: -DENABLE_BUILD_TOOLS=ON
dependencies: |
ecmwf/ecbuild
MathisRosenhauer/libaec@master
Expand Down
2 changes: 2 additions & 0 deletions .github/ci-hpc-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ build:
- ecmwf/eckit@develop
- ecmwf/atlas@develop
parallel: 64
env:
- MIR_CACHING=0
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.0
1.21.0
139 changes: 128 additions & 11 deletions etc/mir/parameter-class.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/mir/action/filter/ShTruncate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ bool ShTruncate::sameAs(const Action& other) const {


void ShTruncate::print(std::ostream& out) const {
out << "ShTruncate[" << "truncation=" << truncation_ << "]";
out << "ShTruncate["
<< "truncation=" << truncation_ << "]";
}


Expand Down
3 changes: 2 additions & 1 deletion src/mir/action/interpolate/Gridded2GridDef.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ void Gridded2GridDef::custom(std::ostream& out) const {


void Gridded2GridDef::print(std::ostream& out) const {
out << "Gridded2GridDef[" << "griddef=" << griddef_ << ",";
out << "Gridded2GridDef["
<< "griddef=" << griddef_ << ",";
Gridded2UnrotatedGrid::print(out);
out << "]";
}
Expand Down
3 changes: 2 additions & 1 deletion src/mir/action/interpolate/Gridded2RegularLL.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Gridded2RegularLL::Gridded2RegularLL(const param::MIRParametrisation& parametris

repres::latlon::LatLon::globaliseBoundingBox(bbox_, increments_, reference_);

Log::debug() << "Gridded2RegularLL: globalise:" << "\n\t" << increments_ << "\n\t" << bbox_
Log::debug() << "Gridded2RegularLL: globalise:"
<< "\n\t" << increments_ << "\n\t" << bbox_
<< "\n\t"
"shifted in latitude? "
<< increments_.isLatitudeShifted(bbox_)
Expand Down
3 changes: 2 additions & 1 deletion src/mir/action/interpolate/Gridded2RotatedLL.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Gridded2RotatedLL::Gridded2RotatedLL(const param::MIRParametrisation& parametris

repres::latlon::LatLon::globaliseBoundingBox(bbox_, increments_, reference_);

Log::debug() << "Gridded2RotatedLL: globalise:" << "\n\t" << increments_ << "\n\t" << bbox_
Log::debug() << "Gridded2RotatedLL: globalise:"
<< "\n\t" << increments_ << "\n\t" << bbox_
<< "\n\t"
"shifted in latitude? "
<< increments_.isLatitudeShifted(bbox_)
Expand Down
3 changes: 2 additions & 1 deletion src/mir/action/plan/Action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ Action* ActionFactory::build(const std::string& name, const param::MIRParametris

if (j != m->end()) {
std::ostringstream oss;
oss << "ActionFactory: ambiguous '" << name << "'" << ", could be '" << j->first << "'"
oss << "ActionFactory: ambiguous '" << name << "'"
<< ", could be '" << j->first << "'"
<< " or '" << p->first << "'";
Log::error() << " " << j->first << std::endl;
throw exception::SeriousBug(oss.str());
Expand Down
33 changes: 26 additions & 7 deletions src/mir/action/plan/ActionPlan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,21 @@ void ActionPlan::execute(context::Context& ctx) const {

for (const auto& p : *this) {
if (Log::debug_active()) {
Log::debug() << "Executing:" << "\n" << sep << "\n" << *p << "\n" << sep << std::endl;
Log::debug() << "Executing:"
<< "\n"
<< sep << "\n"
<< *p << "\n"
<< sep << std::endl;
}

p->perform(ctx);

if (Log::debug_active()) {
Log::debug() << "Result:" << "\n" << sep << "\n" << ctx << "\n" << sep << std::endl;
Log::debug() << "Result:"
<< "\n"
<< sep << "\n"
<< ctx << "\n"
<< sep << std::endl;
}
}

Expand Down Expand Up @@ -180,7 +188,11 @@ void ActionPlan::estimate(context::Context& ctx, api::MIREstimation& estimation)
void ActionPlan::compress() {
const char* sep = "#########";

Log::debug() << "Compress:" << "\n" << sep << "\n" << *this << "\n" << sep << std::endl;
Log::debug() << "Compress:"
<< "\n"
<< sep << "\n"
<< *this << "\n"
<< sep << std::endl;

bool hasCompressed = false;
bool more = true;
Expand All @@ -193,8 +205,9 @@ void ActionPlan::compress() {

if (action(i).mergeWithNext(action(i + 1))) {

Log::debug() << "ActionPlan::compress: " << "\n " << oldAction.str() << "\n + " << action(i + 1)
<< "\n = " << action(i) << std::endl;
Log::debug() << "ActionPlan::compress: "
<< "\n " << oldAction.str() << "\n + " << action(i + 1) << "\n = " << action(i)
<< std::endl;

delete at(i + 1);
erase(begin() + long(i + 1));
Expand All @@ -217,10 +230,16 @@ void ActionPlan::compress() {
}

if (hasCompressed) {
Log::debug() << "Compress result:" << "\n" << sep << "\n" << *this << "\n" << sep << std::endl;
Log::debug() << "Compress result:"
<< "\n"
<< sep << "\n"
<< *this << "\n"
<< sep << std::endl;
}
else {
Log::debug() << "Compress result: unable to compress" << "\n" << sep << std::endl;
Log::debug() << "Compress result: unable to compress"
<< "\n"
<< sep << std::endl;
}
}

Expand Down
9 changes: 5 additions & 4 deletions src/mir/action/transform/ShToGridded.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ void ShToGridded::transform(data::MIRField& field, const repres::Representation&
}
else if (!creator.supported()) {

Log::warning() << "ShToGridded: LegendreCacheCreator is not supported for:" << "\n representation: "
<< representation << "\n options: " << options_ << std::endl
Log::warning() << "ShToGridded: LegendreCacheCreator is not supported for:"
<< "\n representation: " << representation << "\n options: " << options_ << std::endl
<< "ShToGridded: continuing with hindered performance" << std::endl;

trans = atlas_trans_t(grid, domain, truncation, options_);
Expand Down Expand Up @@ -317,8 +317,9 @@ bool ShToGridded::mergeWithNext(const Action& next) {
repres::RepresentationHandle out(outputRepresentation());
cropping_.boundingBox(out->extendBoundingBox(bbox));

Log::debug() << "ShToGridded::mergeWithNext: " << "\n " << oldAction.str() << "\n + " << next
<< "\n = " << *this << "\n + " << "(...)" << std::endl;
Log::debug() << "ShToGridded::mergeWithNext: "
<< "\n " << oldAction.str() << "\n + " << next << "\n = " << *this << "\n + "
<< "(...)" << std::endl;
}
return false;
}
Expand Down
5 changes: 3 additions & 2 deletions src/mir/caching/InMemoryCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ void InMemoryCache<T>::reserve(const InMemoryCacheUsage& usage) {
auto u = usage;
auto p = (f + u) - c;

Log::debug() << "CACHE-RESERVE-" << name_ << " " << " => " << u << " footprint: " << f << " capacity: " << c
<< " f+u: " << f + u << " f+u-c: " << p << std::endl;
Log::debug() << "CACHE-RESERVE-" << name_ << " "
<< " => " << u << " footprint: " << f << " capacity: " << c << " f+u: " << f + u << " f+u-c: " << p
<< std::endl;


if (p) {
Expand Down
1 change: 1 addition & 0 deletions src/mir/compare/Field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <algorithm>
#include <ostream>

#include "eckit/log/JSON.h"
#include "eckit/option/CmdArgs.h"
#include "eckit/option/SimpleOption.h"

Expand Down
30 changes: 18 additions & 12 deletions src/mir/compare/FieldComparator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,16 @@ void FieldComparator::compareFieldStatistics(const MultiFile& multi1, const Mult
constexpr double relativeErrorMax = 0.01;

if (s1.values_ != s2.values_) {
Log::info() << "Number of data values mismatch:" << "\n " << multi1 << ": " << s1.values_ << " " << field1
<< "\n " << multi2 << ": " << s2.values_ << " " << field2 << std::endl;
Log::info() << "Number of data values mismatch:"
<< "\n " << multi1 << ": " << s1.values_ << " " << field1 << "\n " << multi2 << ": " << s2.values_
<< " " << field2 << std::endl;
error("statistics-mismatches");
}

if (s1.missing_ != s2.missing_) {
Log::info() << "Number of missing values mismatch:" << "\n " << multi1 << ": " << s1.missing_ << " " << field1
<< "\n " << multi2 << ": " << s2.missing_ << " " << field2 << std::endl;
Log::info() << "Number of missing values mismatch:"
<< "\n " << multi1 << ": " << s1.missing_ << " " << field1 << "\n " << multi2 << ": "
<< s2.missing_ << " " << field2 << std::endl;
error("statistics-mismatches");
}

Expand Down Expand Up @@ -641,8 +643,9 @@ void FieldComparator::compareFieldValues(const FieldComparator::MultiFile& multi
auto problems = comp->execute(input1->field(), input2->field());

if (!problems.empty()) {
Log::info() << "Value compare failed between:" << "\n " << multi1 << ": " << field1 << "\n " << multi2
<< ": " << field2 << "\n reporting " << *comp << "\n failed because" << problems << std::endl;
Log::info() << "Value compare failed between:"
<< "\n " << multi1 << ": " << field1 << "\n " << multi2 << ": " << field2 << "\n reporting "
<< *comp << "\n failed because" << problems << std::endl;
error("values-mismatches");
}
}
Expand All @@ -669,8 +672,9 @@ void FieldComparator::compareFieldMissingValues(const FieldComparator::MultiFile
auto problems = comp->execute(input1->field(), input2->field());

if (!problems.empty()) {
Log::info() << "Value compare failed between:" << "\n " << multi1 << ": " << field1 << "\n " << multi2 << ": "
<< field2 << "\n reporting " << *comp << "\n failed because" << problems << std::endl;
Log::info() << "Value compare failed between:"
<< "\n " << multi1 << ": " << field1 << "\n " << multi2 << ": " << field2 << "\n reporting "
<< *comp << "\n failed because" << problems << std::endl;
error("values-mismatches");
}
}
Expand Down Expand Up @@ -733,7 +737,8 @@ void FieldComparator::missingField(const MultiFile& multi1, const MultiFile& mul

std::vector<Field> matches = field.bestMatches(fields);
if (!matches.empty()) {
Log::info() << " ? " << "No match found in " << multi2 << std::endl;
Log::info() << " ? "
<< "No match found in " << multi2 << std::endl;
size_t cnt = 0;

auto flds = field.sortByDifference(fields);
Expand Down Expand Up @@ -781,7 +786,8 @@ void FieldComparator::missingField(const MultiFile& multi1, const MultiFile& mul
}
else {

Log::info() << " + " << "Possible matched in " << multi2 << std::endl;
Log::info() << " + "
<< "Possible matched in " << multi2 << std::endl;

size_t cnt = 0;
for (const auto& other : matches) {
Expand Down Expand Up @@ -845,8 +851,8 @@ void FieldComparator::compareCounts(const std::string& name, const MultiFile& mu
size_t n2 = count(multi2, fields2);

if (n1 != n2) {
Log::info() << name << " count mismatch" << "\n " << n1 << " " << multi1 << "\n " << n2 << " " << multi2
<< std::endl;
Log::info() << name << " count mismatch"
<< "\n " << n1 << " " << multi1 << "\n " << n2 << " " << multi2 << std::endl;
error("count-mismatches");
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/mir/data/CartesianVector2DField.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ void CartesianVector2DField::rotate(const util::Rotation& rotation, MIRValuesVec


void CartesianVector2DField::print(std::ostream& out) const {
out << "CartesianVector2DField[" << "]";
out << "CartesianVector2DField["
<< "]";
}


Expand Down
3 changes: 2 additions & 1 deletion src/mir/input/GribInput.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ bool ConditionT<std::string>::eval(grib_handle* h) const {
}

if (err != 0) {
Log::debug() << "ConditionT<std::string>::eval(" << ",key=" << key_ << ") failed " << err << std::endl;
Log::debug() << "ConditionT<std::string>::eval("
<< ",key=" << key_ << ") failed " << err << std::endl;
GRIB_ERROR(err, key_);
}

Expand Down
3 changes: 2 additions & 1 deletion src/mir/method/MethodWeighted.cc
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ const WeightMatrix& MethodWeighted::getMatrix(context::Context& ctx, const repre

j << "interpolation";
j.startObject();
j << "engine" << "mir";
j << "engine"
<< "mir";
j << "version" << caching::WeightCache::version();
const static std::map<eckit::Hash::digest_t, std::string> KNOWN_METHOD{
{"73e1dd539879ffbbbb22d6bc789c2262", "linear"},
Expand Down
1 change: 1 addition & 0 deletions src/mir/method/fe/CalculateCellLongestDiagonal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ double CalculateCellLongestDiagonal::operator()(atlas::Mesh& mesh, bool include_
d = std::max(d, util::Earth::distance(P[ni], P[nj]));
if (d > dMax) {
Log::warning() << "CalculateCellLongestDiagonal: limited to maximum " << dMax << "m";
mesh.metadata().set(name_, dMax);
return dMax;
}
}
Expand Down
Loading

0 comments on commit 979a904

Please sign in to comment.