diff --git a/src/orca-jedi/CMakeLists.txt b/src/orca-jedi/CMakeLists.txt index 39bee20..0f60b52 100644 --- a/src/orca-jedi/CMakeLists.txt +++ b/src/orca-jedi/CMakeLists.txt @@ -20,6 +20,8 @@ model/ModelBiasCovariance.h model/ModelBias.h model/ModelBiasIncrement.h model/Model.h +norm/Norm.h +norm/Norm.cc state/State.h state/State.cc nemo_io/NemoFieldReader.h diff --git a/src/orca-jedi/norm/Norm.cc b/src/orca-jedi/norm/Norm.cc new file mode 100644 index 0000000..d6a2b65 --- /dev/null +++ b/src/orca-jedi/norm/Norm.cc @@ -0,0 +1,37 @@ +/* + * (C) British Crown Copyright 2026 Met Office + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + */ + +#include "orca-jedi/norm/Norm.h" + +#include "eckit/exception/Exceptions.h" + +namespace orcamodel { + +Norm::Norm(const oops::Variables &, + const eckit::Configuration &, + const State &) { + throw eckit::NotImplemented(Here()); +} + +void Norm::apply(Increment &) const { + throw eckit::NotImplemented(Here()); +} + +void Norm::applyInverse(Increment &) const { + throw eckit::NotImplemented(Here()); +} + +const double Norm::computeNorm(const Increment &) const { + throw eckit::NotImplemented(Here()); + return 0.0; +} + +void Norm::print(std::ostream &) const { + throw eckit::NotImplemented(Here()); +} + +} // namespace orcamodel diff --git a/src/orca-jedi/norm/Norm.h b/src/orca-jedi/norm/Norm.h new file mode 100644 index 0000000..3e96ff7 --- /dev/null +++ b/src/orca-jedi/norm/Norm.h @@ -0,0 +1,43 @@ +/* + * (C) British Crown Copyright 2026 Met Office + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + */ + +#pragma once + +#include + +#include "eckit/config/Configuration.h" + +#include "oops/base/Variables.h" +#include "oops/util/ObjectCounter.h" +#include "oops/util/Printable.h" + +#include "orca-jedi/increment/Increment.h" +#include "orca-jedi/state/State.h" + +namespace orcamodel { + +class Norm : public util::Printable, + private util::ObjectCounter { + public: + static const std::string classname() {return "orcamodel::Norm";} + +// Constructor, destructor + Norm(const oops::Variables &, + const eckit::Configuration &, + const State &); + ~Norm() = default; + +// Apply norm to increment + void apply(Increment &) const; + void applyInverse(Increment &) const; + const double computeNorm(const Increment &) const; + + private: + void print(std::ostream &) const override; +}; + +} // namespace orcamodel diff --git a/src/orca-jedi/utilities/OrcaModelTraits.h b/src/orca-jedi/utilities/OrcaModelTraits.h index d9a2b33..02f7ef5 100644 --- a/src/orca-jedi/utilities/OrcaModelTraits.h +++ b/src/orca-jedi/utilities/OrcaModelTraits.h @@ -16,6 +16,7 @@ #include "orca-jedi/model/ModelBias.h" #include "orca-jedi/model/ModelBiasIncrement.h" #include "orca-jedi/model/ModelBiasCovariance.h" +#include "orca-jedi/norm/Norm.h" #include "orca-jedi/state/State.h" #include "orca-jedi/utilities/ModelData.h" #include "orca-jedi/variablechanges/VariableChange.h" @@ -38,6 +39,7 @@ struct OrcaModelTraits { typedef orcamodel::ModelBiasIncrement ModelAuxIncrement; typedef orcamodel::ModelBiasCovariance ModelAuxCovariance; typedef orcamodel::Model Model; + typedef orcamodel::Norm Norm; typedef orcamodel::State State; typedef orcamodel::LinearModel LinearModel; typedef orcamodel::VariableChange VariableChange;